KTextEditor
templateinterface2.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2010 Joseph Wenninger <jowenn@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef KDELIBS_KTEXTEDITOR_TEMPLATEINTERFACE2_H 00020 #define KDELIBS_KTEXTEDITOR_TEMPLATEINTERFACE2_H 00021 00022 #include <QtCore/QString> 00023 #include <QtCore/QMap> 00024 #include <QtGui/QImage> 00025 00026 #include <ktexteditor/ktexteditor_export.h> 00027 #include <ktexteditor/cursor.h> 00028 #include <ktexteditor/templateinterface.h> 00029 00030 namespace KTextEditor 00031 { 00032 00033 class Cursor; 00034 00035 class KTEXTEDITOR_EXPORT TemplateScript 00036 { 00037 public: 00038 virtual ~TemplateScript(); 00039 }; 00040 00047 class KTEXTEDITOR_EXPORT TemplateInterface2: public TemplateInterface 00048 { 00049 public: 00050 TemplateInterface2(); 00051 virtual ~TemplateInterface2(); 00052 00053 public: 00054 00059 bool insertTemplateText ( const Cursor &insertPosition, 00060 const QString &templateString, 00061 const QMap<QString,QString> &initialValues, 00062 TemplateScript* templateScript); 00063 00064 00065 protected: 00073 virtual bool insertTemplateTextImplementation ( const Cursor &insertPosition, 00074 const QString &templateString, 00075 const QMap<QString,QString> &initialValues, 00076 TemplateScript* templateScript) = 0; 00077 00078 00079 virtual bool insertTemplateTextImplementation ( const Cursor &insertPosition, 00080 const QString &templateString, 00081 const QMap<QString,QString> &initialValues) = 0; 00082 00083 private: 00084 class TemplateInterfacePrivate2* const d; 00085 }; 00086 00089 class KTEXTEDITOR_EXPORT TemplateScriptRegistrar { 00090 00091 public: 00092 TemplateScriptRegistrar(); 00093 virtual ~TemplateScriptRegistrar(); 00094 00106 virtual TemplateScript* registerTemplateScript(QObject *owner, const QString& script) = 0; 00107 00111 virtual void unregisterTemplateScript(TemplateScript* templateScript) = 0; 00112 00113 }; 00114 00115 } 00116 00117 Q_DECLARE_INTERFACE(KTextEditor::TemplateInterface2, 00118 "org.kde.KTextEditor.TemplateInterface2") 00119 00120 Q_DECLARE_INTERFACE(KTextEditor::TemplateScriptRegistrar, 00121 "org.kde.KTextEditor.TemplateScriptRegistrar") 00122 00123 00124 00125 #endif
KDE 4.6 API Reference