kexi
manager.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KOMACRO_MANAGER_H
00021 #define KOMACRO_MANAGER_H
00022
00023 #include <qmap.h>
00024 #include <qguardedptr.h>
00025 #include <ksharedptr.h>
00026 #include <kxmlguiclient.h>
00027 #include <kstaticdeleter.h>
00028
00029 #include "komacro_export.h"
00030
00031 class QObject;
00032 class QDomElement;
00033
00034 namespace KoMacro {
00035
00036
00037 class Action;
00038 class Macro;
00039
00075 class KOMACRO_EXPORT Manager
00076 {
00077 friend class KStaticDeleter< ::KoMacro::Manager >;
00078 private:
00079
00086 explicit Manager(KXMLGUIClient* const xmlguiclient);
00087
00091 virtual ~Manager();
00092
00093 public:
00094
00100 static void init(KXMLGUIClient* xmlguiclient);
00101
00107 static Manager* self();
00108
00113 KXMLGUIClient* guiClient() const;
00114
00119 bool hasMacro(const QString& macroname);
00120
00125 KSharedPtr<Macro> getMacro(const QString& macroname);
00126
00137 void addMacro(const QString& macroname, KSharedPtr<Macro> macro);
00138
00144 void removeMacro(const QString& macroname);
00145
00153 KSharedPtr<Macro> createMacro(const QString& macroname);
00154
00155 #if 0
00167 KSharedPtr<Action> createAction(const QDomElement& element);
00168 #endif
00169
00175 KSharedPtr<Action> action(const QString& name) const;
00176
00180 QMap<QString, KSharedPtr<Action> > actions() const;
00181
00185 QStringList actionNames() const;
00186
00191 void publishAction(KSharedPtr<Action> action);
00192
00197 void publishObject(const QString& name, QObject* object);
00198
00203 QGuardedPtr<QObject> object(const QString& name) const;
00204
00208 QMap<QString, QGuardedPtr<QObject> > objects() const;
00209
00210 private:
00212 class Private;
00214 Private* const d;
00215 };
00216
00217 }
00218
00219 #endif
|