summaryrefslogtreecommitdiffstats
path: root/framework/actions/actionhandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'framework/actions/actionhandler.h')
-rw-r--r--framework/actions/actionhandler.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/framework/actions/actionhandler.h b/framework/actions/actionhandler.h
index cfcfddd7..1820bfd4 100644
--- a/framework/actions/actionhandler.h
+++ b/framework/actions/actionhandler.h
@@ -20,6 +20,7 @@
20 20
21#include <QObject> 21#include <QObject>
22#include <QMultiMap> 22#include <QMultiMap>
23#include <functional>
23 24
24namespace Kube { 25namespace Kube {
25class Context; 26class Context;
@@ -45,4 +46,20 @@ private:
45 QByteArray mActionId; 46 QByteArray mActionId;
46}; 47};
47 48
49class ActionHandlerHelper : public ActionHandler
50{
51 Q_OBJECT
52public:
53 typedef std::function<bool(Context*)> IsReadyFunction;
54 typedef std::function<void(Context*)> Handler;
55
56 ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &, const Handler &);
57
58 bool isActionReady(Context *context) Q_DECL_OVERRIDE;
59 void execute(Context *context) Q_DECL_OVERRIDE;
60private:
61 const std::function<bool(Context*)> isReadyFunction;
62 const std::function<void(Context*)> handlerFunction;
63};
64
48} 65}