kexi

macro.h

00001 /***************************************************************************
00002  * This file is part of the KDE project
00003  * copyright (C) 2005 by Sebastian Sauer (mail@dipe.org)
00004  * copyright (C) 2005 by Tobi Krebs (tobi.krebs@gmail.com)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this program; see the file COPYING.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 
00020 #ifndef KOMACRO_MACRO_H
00021 #define KOMACRO_MACRO_H
00022 
00023 #include <qobject.h>
00024 #include <ksharedptr.h>
00025 
00026 #include "action.h"
00027 #include "xmlhandler.h"
00028 
00029 namespace KoMacro {
00030 
00031     // Forward declarations.
00032     class Manager;
00033     class MacroItem;
00034     class Context;
00035 
00041     class KOMACRO_EXPORT Macro
00042         : public QObject // Qt functionality like signals and slots
00043         , public KShared // shared reference-counting
00044         , public XMLHandler // to (un-)serialize from/to XML
00045     {
00046             Q_OBJECT
00047 
00048         public:
00049 
00055             typedef QMap<QString, KSharedPtr<Macro > > Map;
00056 
00063             explicit Macro(const QString& name);
00064 
00068             virtual ~Macro();
00069 
00073             const QString name() const;
00074             
00078             void setName(const QString& name);
00079 
00083             virtual const QString toString() const;
00084 
00089             QValueList< KSharedPtr<MacroItem> >& items() const;
00090 
00095             void addItem(KSharedPtr<MacroItem> item);
00096 
00100             void clearItems();
00101 
00109             //void connectSignal(const QObject* sender, const char* signal);
00110 
00111         public slots:
00112 
00119             virtual KSharedPtr<Context> execute(QObject* sender);
00120 
00121         private:
00123             class Private;
00125             Private* const d;
00126     };
00127 
00128 }
00129 
00130 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys