1
#ifndef KEXIUSERACTION_H
2
#define KEXIUSERACTION_H
6
#include "kexiuseractionmethod.h"
12
class KActionCollection;
14
/*! action that can be defined by a user for a special scope e.g. main, form ...
15
the actions can have some predefined \ref Methods which are described in \ref KexiUserActionMethod
16
e.g. OpenObject, ExecuteScript ... those methods take different arguments also described in \ref KexiUserActionMethod
18
class KEXICORE_EXPORT KexiUserAction : public KAction
23
typedef QVector<QVariant> Arguments;
25
/*! bytecode of available methods */
34
LastMethod = 6 //use the last integer here... so we can stop iteration
46
/*! constructs an action
47
\note methods are associated using setMethod()
49
KexiUserAction(KActionCollection *parent, const QString &name, const QString &text,
50
const QString &pixmap);
53
/*! sets execution information associated with this action this will mostly look like
55
KexiUserAction *action = new KexiUserAction(...);
57
arg.append(QVariant("kexi/form"));
58
arg.append(QVariant("main"));
59
action->setMethod(KexiUserAction::OpenAction, arg);
62
void setMethod(int method, Arguments args);
64
/*! creates a KexiUserAction from current record in \a c
65
mostly needed for creation from kexi__useractions table */
66
static KexiUserAction *fromCurrentRecord(
67
KActionCollection *parent, KexiDB::Cursor *c);
70
/*! actually executes the associated method
71
\note KexiUserAction automatically connects KAction::activated() to KexiUserAction::execute()