macro.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_MACRO_H
21#define KOMACRO_MACRO_H
22
23#include <tqobject.h>
24#include <ksharedptr.h>
25
26#include "action.h"
27#include "xmlhandler.h"
28
29namespace KoMacro {
30
31 // Forward declarations.
32 class Manager;
33 class MacroItem;
34 class Context;
35
41 class KOMACRO_EXPORT Macro
42 : public TQObject // TQt functionality like signals and slots
43 , public TDEShared // shared reference-counting
44 , public XMLHandler // to (un-)serialize from/to XML
45 {
46 TQ_OBJECT
47
48
49 public:
50
56 typedef TQMap<TQString, TDESharedPtr<Macro > > Map;
57
64 explicit Macro(const TQString& name);
65
69 virtual ~Macro();
70
74 const TQString name() const;
75
79 void setName(const TQString& name);
80
84 virtual const TQString toString() const;
85
90 TQValueList< TDESharedPtr<MacroItem> >& items() const;
91
96 void addItem(TDESharedPtr<MacroItem> item);
97
101 void clearItems();
102
110 //void connectSignal(const TQObject* sender, const char* signal);
111
112 public slots:
113
120 virtual TDESharedPtr<Context> execute(TQObject* sender);
121
122 private:
124 class Private;
126 Private* const d;
127 };
128
129}
130
131#endif
The Macro class implements all the action-handling.
Definition macro.h:45
TQMap< TQString, TDESharedPtr< Macro > > Map
A TQMap of Macro instances accessible by there unique name.
Definition macro.h:56
The XMLHandler class manages the (un-)serialization of a Macro instance to/from XML.
Definition xmlhandler.h:38