kexi
action.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KOMACRO_ACTION_H
00022 #define KOMACRO_ACTION_H
00023
00024 #include "manager.h"
00025 #include "context.h"
00026 #include "variable.h"
00027
00028 #include <qobject.h>
00029 #include <ksharedptr.h>
00030 #include <qstringlist.h>
00031
00032 namespace KoMacro {
00033
00038 class KOMACRO_EXPORT Action
00039 : public QObject
00040 , public KShared
00041 {
00042 Q_OBJECT
00043
00045 Q_PROPERTY(QString name READ name WRITE setName)
00046
00047
00048 Q_PROPERTY(QString text READ text WRITE setText)
00049
00051 Q_PROPERTY(QString comment READ comment WRITE setComment)
00052
00053 public:
00054
00058 typedef QMap<QString, KSharedPtr<Action> > Map;
00059
00066 explicit Action(const QString& name, const QString& text = QString::null);
00067
00071 virtual ~Action();
00072
00077 virtual const QString toString() const;
00078
00082 const QString name() const;
00083
00087 void setName(const QString& name);
00088
00092 const QString text() const;
00093
00097 void setText(const QString& text);
00098
00102 const QString comment() const;
00103
00107 void setComment(const QString& comment);
00108
00113 bool hasVariable(const QString& name) const;
00114
00120 KSharedPtr<Variable> variable(const QString& name) const;
00121
00125 Variable::Map variables() const;
00126
00130 QStringList variableNames() const;
00131
00136 void setVariable(KSharedPtr<Variable> variable);
00137
00145 void setVariable(const QString& name, const QString& text, const QVariant& variant);
00146
00151 void removeVariable(const QString& name);
00152
00164 virtual bool notifyUpdated(const KSharedPtr<MacroItem> ¯oitem, const QString& name) {
00165 Q_UNUSED(macroitem);
00166 Q_UNUSED(name);
00167 return true;
00168 }
00169
00170 public slots:
00171
00176 virtual void activate(KSharedPtr<Context> context) = 0;
00177
00178 private:
00180 class Private;
00182 Private* const d;
00183 };
00184
00185 }
00186
00187 #endif
|