kexi

context.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_CONTEXT_H
00021 #define KOMACRO_CONTEXT_H
00022 
00023 #include <qobject.h>
00024 #include <ksharedptr.h>
00025 
00026 #include "variable.h"
00027 
00028 namespace KoMacro {
00029 
00030     // Forward declaration.
00031     class Macro;
00032     class MacroItem;
00033     class Action;
00034     class Exception;
00035 
00041     class KOMACRO_EXPORT Context
00042         : public QObject
00043         , public KShared
00044     {
00045             Q_OBJECT
00046         public:
00047 
00053             explicit Context(KSharedPtr<Macro> macro);
00054 
00058             ~Context();
00059 
00064             bool hasVariable(const QString& name) const;
00065 
00070             KSharedPtr<Variable> variable(const QString& name) const;
00071 
00076             Variable::Map variables() const;
00077 
00082             void setVariable(const QString& name, KSharedPtr<Variable> variable);
00083 
00087             KSharedPtr<Macro> macro() const;
00088 
00093             KSharedPtr<MacroItem> macroItem() const;
00094 
00099             bool hadException() const;
00100 
00106             Exception* exception() const;
00107 
00108         private slots:
00109 
00116             virtual void activate(QValueList<KSharedPtr <MacroItem> >::ConstIterator it);
00117 
00118         public slots:
00119 
00125             virtual void activate(KSharedPtr<Context> context);
00126 
00130             virtual void activateNext();
00131 
00132         private:
00134             class Private;
00136             Private* const d;
00137     };
00138 
00139 }
00140 
00141 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys