Kate
insertfileplugin.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _INSERT_FILE_PLUGIN_H_
00020 #define _INSERT_FILE_PLUGIN_H_
00021
00022 #include <ktexteditor/plugin.h>
00023 #include <ktexteditor/view.h>
00024
00025 #include <kxmlguiclient.h>
00026 #include <QtCore/QObject>
00027 #include <jobclasses.h>
00028 #include <kurl.h>
00029
00030 class InsertFilePlugin : public KTextEditor::Plugin
00031 {
00032 Q_OBJECT
00033
00034 public:
00035 explicit InsertFilePlugin( QObject *parent = 0,
00036 const QVariantList &args = QVariantList() );
00037 virtual ~InsertFilePlugin();
00038
00039 void addView (KTextEditor::View *view);
00040 void removeView (KTextEditor::View *view);
00041
00042
00043 private:
00044 QList<class InsertFilePluginView*> m_views;
00045 };
00046
00047 class InsertFilePluginView : public QObject, public KXMLGUIClient
00048 {
00049 Q_OBJECT
00050 public:
00051 explicit InsertFilePluginView( KTextEditor::View *view, const char *name=0 );
00052 ~InsertFilePluginView() {}
00053 public Q_SLOTS:
00054
00055 void slotInsertFile();
00056 private Q_SLOTS:
00057 void slotFinished( KJob *job );
00058
00059 private:
00060 void insertFile();
00061 KUrl _file;
00062 QString _tmpfile;
00063 KIO::FileCopyJob *_job;
00064 };
00065
00066 #endif // _INSERT_FILE_PLUGIN_H_