kexi

context.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_CONTEXT_H
21#define KOMACRO_CONTEXT_H
22
23#include <tqobject.h>
24#include <ksharedptr.h>
25
26#include "variable.h"
27
28namespace KoMacro {
29
30 // Forward declaration.
31 class Macro;
32 class MacroItem;
33 class Action;
34 class Exception;
35
41 class KOMACRO_EXPORT Context
42 : public TQObject
43 , public TDEShared
44 {
45 TQ_OBJECT
46
47 public:
48
54 explicit Context(TDESharedPtr<Macro> macro);
55
59 ~Context();
60
65 bool hasVariable(const TQString& name) const;
66
71 TDESharedPtr<Variable> variable(const TQString& name) const;
72
78
83 void setVariable(const TQString& name, TDESharedPtr<Variable> variable);
84
88 TDESharedPtr<Macro> macro() const;
89
94 TDESharedPtr<MacroItem> macroItem() const;
95
100 bool hadException() const;
101
107 Exception* exception() const;
108
109 private slots:
110
117 virtual void activate(TQValueList<TDESharedPtr <MacroItem> >::ConstIterator it);
118
119 public slots:
120
126 virtual void activate(TDESharedPtr<Context> context);
127
131 virtual void activateNext();
132
133 private:
135 class Private;
137 Private* const d;
138 };
139
140}
141
142#endif
The Action class extendes TDEAction to implement some additional functionality TDEAction doesn't prov...
Definition action.h:41
Variable::Map variables() const
Definition context.cpp:126
TDESharedPtr< Variable > variable(const TQString &name) const
Definition context.cpp:107
virtual void activateNext()
This slot continues execution.
Definition context.cpp:244
bool hadException() const
Definition context.cpp:153
TDESharedPtr< Macro > macro() const
Definition context.cpp:141
Exception * exception() const
Definition context.cpp:159
bool hasVariable(const TQString &name) const
Definition context.cpp:100
TDESharedPtr< MacroItem > macroItem() const
Definition context.cpp:147
Context(TDESharedPtr< Macro > macro)
Constructor.
Definition context.cpp:87
void setVariable(const TQString &name, TDESharedPtr< Variable > variable)
Set the variable variable defined with name name .
Definition context.cpp:132
Base Exception class.
Definition exception.h:35
The MacroItem class is an item in a Macro and represents one single execution step.
Definition macroitem.h:47
The Macro class implements all the action-handling.
Definition macro.h:45
TQMap< TQString, TDESharedPtr< Variable > > Map
A map of variables.
Definition variable.h:66