moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / misc / guiaction.h
blob5552541f5fa45a0ba2e0c5e54e4fb93b297de085
1 // Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 // 02111-1307, USA.
18 #ifndef KIG_MISC_GUIACTION_H
19 #define KIG_MISC_GUIACTION_H
21 #include <config.h>
23 #ifdef KIG_ENABLE_PYTHON_SCRIPTING
24 #include "../scripting/script-common.h"
25 #endif
27 #include <qstring.h>
28 #include <qcstring.h>
29 #include <kaction.h>
31 class GUIAction;
32 class KigPart;
34 class KigGUIAction
35 : public KAction
37 Q_OBJECT
38 GUIAction* mact;
39 KigPart& mdoc;
40 public:
41 KigGUIAction( GUIAction* act,
42 KigPart& doc,
43 QObject* parent );
44 void slotActivated();
46 GUIAction* guiAction();
48 void plug( KigPart* doc );
51 class GUIAction
53 public:
54 virtual ~GUIAction();
56 virtual QString description() const = 0;
57 virtual QCString iconFileName() const = 0;
58 virtual QString descriptiveName() const = 0;
59 virtual const char* actionName() const = 0;
60 virtual int shortcut() const = 0;
61 virtual void act( KigPart& ) = 0;
63 virtual void plug( KigPart* doc, KigGUIAction* kact );
66 class ObjectConstructor;
68 class ConstructibleAction
69 : public GUIAction
71 ObjectConstructor* mctor;
72 QCString mactionname;
73 int mshortcut;
74 public:
75 ConstructibleAction( ObjectConstructor* ctor, const QCString& actionname,
76 int shortcut = 0 );
77 ~ConstructibleAction();
78 QString description() const;
79 QCString iconFileName() const;
80 QString descriptiveName() const;
81 const char* actionName() const;
82 int shortcut() const;
83 void act( KigPart& );
84 void plug( KigPart* doc, KigGUIAction* kact );
87 class ConstructPointAction
88 : public GUIAction
90 const char* mactionname;
91 public:
92 ConstructPointAction( const char* actionname );
93 ~ConstructPointAction();
95 QString description() const;
96 QCString iconFileName() const;
97 QString descriptiveName() const;
98 const char* actionName() const;
99 int shortcut() const;
100 void act( KigPart& );
103 class ConstructTextLabelAction
104 : public GUIAction
106 const char* mactionname;
107 public:
108 ConstructTextLabelAction( const char* actionname );
110 QString description() const;
111 QCString iconFileName() const;
112 QString descriptiveName() const;
113 const char* actionName() const;
114 int shortcut() const;
115 void act( KigPart& );
118 class AddFixedPointAction
119 : public GUIAction
121 const char* mactionname;
122 public:
123 AddFixedPointAction( const char* actionname );
124 ~AddFixedPointAction();
125 QString description() const;
126 QCString iconFileName() const;
127 QString descriptiveName() const;
128 const char* actionName() const;
129 int shortcut() const;
130 void act( KigPart& );
133 #if 0
134 class TestAction
135 : public GUIAction
137 const char* mactionname;
138 public:
139 TestAction( const char* actionname );
140 ~TestAction();
141 QString description() const;
142 QCString iconFileName() const;
143 QString descriptiveName() const;
144 const char* actionName() const;
145 void act( KigPart& );
147 #endif
149 #ifdef KIG_ENABLE_PYTHON_SCRIPTING
151 class NewScriptAction
152 : public GUIAction
154 const char* mactionname;
155 const char* mdescname;
156 const char* mdescription;
157 const char* micon;
158 const ScriptType::Type mtype;
159 public:
160 NewScriptAction( const char* descname, const char* description,
161 const char* actionname, const ScriptType::Type type,
162 const char* icon = "" );
163 ~NewScriptAction();
164 QString description() const;
165 QCString iconFileName() const;
166 QString descriptiveName() const;
167 const char* actionName() const;
168 void act( KigPart& );
169 int shortcut() const;
172 #endif // KIG_ENABLE_PYTHON_SCRIPTING
174 #endif