kexi

macroitem.h

00001 /***************************************************************************
00002  * This file is part of the KDE project
00003  * copyright (C) 2006 by Sebastian Sauer (mail@dipe.org)
00004  * copyright (C) 2006 by Sascha Kupper (kusato@kfnv.de)
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_MACROITEM_H
00021 #define KOMACRO_MACROITEM_H
00022 
00023 #include <qobject.h>
00024 
00025 #include <ksharedptr.h>
00026 
00027 // Forward declarations.
00028 class QDomElement;
00029 
00030 #include "action.h"
00031 #include "context.h"
00032 
00033 namespace KoMacro {
00034 
00035     // Forward-declarations.
00036     //class Action;
00037 
00046     class KOMACRO_EXPORT MacroItem : public KShared
00047     {
00048 
00049         public:
00050 
00054             typedef QValueList<KSharedPtr<MacroItem > > List;
00055 
00059             explicit MacroItem();
00060 
00064             ~MacroItem();
00065 
00070             QString comment() const;
00071 
00076             void setComment(const QString& comment);
00077 
00084             KSharedPtr<Action> action() const;
00085 
00089             void setAction(KSharedPtr<Action> action);
00090 
00101             QVariant variant(const QString& name, bool checkaction = false) const;
00102 
00113             KSharedPtr<Variable> variable(const QString& name, bool checkaction = false) const;
00114 
00118             QMap<QString, KSharedPtr<Variable> > variables() const;
00119 
00125             bool setVariant(const QString& name, const QVariant& variant);
00126 
00131             KSharedPtr<Variable> addVariable(const QString& name, const QVariant& variant);
00132 
00133         private:
00135             class Private;
00137             Private* const d;
00138     };
00139 
00140 }
00141 
00142 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys