~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/app_templates/kateplugin2/plugin_app.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%{H_TEMPLATE}
2
 
 
3
 
#ifndef _PLUGIN_%{APPNAMEUC}_H_
4
 
#define _PLUGIN_%{APPNAMEUC}_H_
5
 
 
6
 
#include <kate/application.h>
7
 
#include <kate/documentmanager.h>
8
 
#include <kate/document.h>
9
 
#include <kate/mainwindow.h>
10
 
#include <kate/plugin.h>
11
 
#include <kate/view.h>
12
 
#include <kate/viewmanager.h>
13
 
#include <kate/pluginconfiginterface.h>
14
 
#include <kate/pluginconfiginterfaceextension.h>
15
 
 
16
 
#include <klibloader.h>
17
 
#include <klocale.h>
18
 
 
19
 
class %{APPNAME}ConfigPage;
20
 
 
21
 
class KatePluginFactory : public KLibFactory
22
 
{
23
 
    Q_OBJECT
24
 
 
25
 
public:
26
 
    KatePluginFactory();
27
 
    virtual ~KatePluginFactory();
28
 
 
29
 
    virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() );
30
 
 
31
 
private:
32
 
    static KInstance* s_instance;
33
 
};
34
 
 
35
 
class KatePlugin%{APPNAME} : public Kate::Plugin, Kate::PluginViewInterface, Kate::PluginConfigInterfaceExtension
36
 
{
37
 
    Q_OBJECT
38
 
 
39
 
public:
40
 
    KatePlugin%{APPNAME}( QObject* parent = 0, const char* name = 0 );
41
 
    virtual ~KatePlugin%{APPNAME}();
42
 
 
43
 
    void addView (Kate::MainWindow *win);
44
 
    void removeView (Kate::MainWindow *win);
45
 
 
46
 
    /** overwrite some functions  */
47
 
    uint configPages () const { return 1; }
48
 
    Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0);
49
 
    QString configPageName(uint) const { return i18n("%{APPNAME}"); };
50
 
    QString configPageFullName(uint) const { return i18n("Configure KatePlugin%{APPNAME}"); };
51
 
    QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const { return 0L; };
52
 
 
53
 
public slots:
54
 
    void slotInsertHello();
55
 
    void slotApplyConfig(%{APPNAME}ConfigPage*);
56
 
 
57
 
private:
58
 
    void initConfigPage( %{APPNAME}ConfigPage* );
59
 
 
60
 
private:
61
 
    QPtrList<class PluginView> m_views;
62
 
};
63
 
 
64
 
 
65
 
class %{APPNAME}ConfigPage : public Kate::PluginConfigPage
66
 
{
67
 
    Q_OBJECT
68
 
    friend class KatePlugin%{APPNAME};
69
 
 
70
 
public:
71
 
    %{APPNAME}ConfigPage (QObject* parent = 0L, QWidget *parentWidget = 0L);
72
 
    ~%{APPNAME}ConfigPage ();
73
 
 
74
 
    /** Reimplemented from Kate::PluginConfigPage; just emits configPageApplyRequest( this ).  */
75
 
    virtual void apply();
76
 
 
77
 
    virtual void reset () { ; };
78
 
    virtual void defaults () { ; };
79
 
 
80
 
signals:
81
 
    /** Ask the plugin to set initial values  */
82
 
    void configPageApplyRequest( %{APPNAME}ConfigPage* );
83
 
    /** Ask the plugin to apply changes  */
84
 
    void configPageInitRequest( %{APPNAME}ConfigPage* );
85
 
 
86
 
private: // variables
87
 
 
88
 
};
89
 
 
90
 
#endif // _PLUGIN_%{APPNAMEUC}_H_
91