kexi

manager.h
1/***************************************************************************
2 * This file is part of the KDE project
3 * copyright (C) 2005 by Sebastian Sauer (mail@dipe.org)
4 * copyright (C) 2005 by Tobi Krebs (tobi.krebs@gmail.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 ***************************************************************************/
19
20#ifndef KOMACRO_MANAGER_H
21#define KOMACRO_MANAGER_H
22
23#include <tqmap.h>
24#include <tqguardedptr.h>
25#include <ksharedptr.h>
26#include <kxmlguiclient.h>
27#include <kstaticdeleter.h>
28
29#include "komacro_export.h"
30
31class TQObject;
32class TQDomElement;
33
34namespace KoMacro {
35
36 // Forward declarations.
37 class Action;
38 class Macro;
39
75 class KOMACRO_EXPORT Manager
76 {
77 friend class KStaticDeleter< ::KoMacro::Manager >;
78 private:
79
86 explicit Manager(KXMLGUIClient* const xmlguiclient);
87
91 virtual ~Manager();
92
93 public:
94
100 static void init(KXMLGUIClient* xmlguiclient);
101
107 static Manager* self();
108
113 KXMLGUIClient* guiClient() const;
114
119 bool hasMacro(const TQString& macroname);
120
125 TDESharedPtr<Macro> getMacro(const TQString& macroname);
126
137 void addMacro(const TQString& macroname, TDESharedPtr<Macro> macro);
138
144 void removeMacro(const TQString& macroname);
145
153 TDESharedPtr<Macro> createMacro(const TQString& macroname);
154
155#if 0
167 TDESharedPtr<Action> createAction(const TQDomElement& element);
168#endif
169
175 TDESharedPtr<Action> action(const TQString& name) const;
176
180 TQMap<TQString, TDESharedPtr<Action> > actions() const;
181
185 TQStringList actionNames() const;
186
191 void publishAction(TDESharedPtr<Action> action);
192
197 void publishObject(const TQString& name, TQObject* object);
198
203 TQGuardedPtr<TQObject> object(const TQString& name) const;
204
208 TQMap<TQString, TQGuardedPtr<TQObject> > objects() const;
209
210 private:
212 class Private;
214 Private* const d;
215 };
216
217}
218
219#endif
The Action class extendes TDEAction to implement some additional functionality TDEAction doesn't prov...
Definition action.h:41
The Macro class implements all the action-handling.
Definition macro.h:45
The Manager class acts as window-wide manager for macros.
Definition manager.h:76
TQGuardedPtr< TQObject > object(const TQString &name) const
Definition manager.cpp:162
TQMap< TQString, TQGuardedPtr< TQObject > > objects() const
Definition manager.cpp:167
TDESharedPtr< Macro > createMacro(const TQString &macroname)
Factory function to create a new Macro instances.
Definition manager.cpp:126
void publishObject(const TQString &name, TQObject *object)
Publish the passed TQObject object.
Definition manager.cpp:156
bool hasMacro(const TQString &macroname)
Definition manager.cpp:106
static void init(KXMLGUIClient *xmlguiclient)
Initialize this Manager singleton.
Definition manager.cpp:65
static Manager * self()
Definition manager.cpp:76
TDESharedPtr< Action > action(const TQString &name) const
Definition manager.cpp:132
KXMLGUIClient * guiClient() const
Definition manager.cpp:101
void addMacro(const TQString &macroname, TDESharedPtr< Macro > macro)
Add a new Macro to the list of known macros.
Definition manager.cpp:116
TQMap< TQString, TDESharedPtr< Action > > actions() const
Definition manager.cpp:137
void publishAction(TDESharedPtr< Action > action)
Publish the Action action .
Definition manager.cpp:147
void removeMacro(const TQString &macroname)
Remove the Macro defined with macroname .
Definition manager.cpp:121
TQStringList actionNames() const
Definition manager.cpp:142
TDESharedPtr< Macro > getMacro(const TQString &macroname)
Definition manager.cpp:111