diff options
Diffstat (limited to 'framework/actions/actionhandler.h')
-rw-r--r-- | framework/actions/actionhandler.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/framework/actions/actionhandler.h b/framework/actions/actionhandler.h index 1820bfd4..c8c10dc7 100644 --- a/framework/actions/actionhandler.h +++ b/framework/actions/actionhandler.h | |||
@@ -21,6 +21,9 @@ | |||
21 | #include <QObject> | 21 | #include <QObject> |
22 | #include <QMultiMap> | 22 | #include <QMultiMap> |
23 | #include <functional> | 23 | #include <functional> |
24 | #include <Async/Async> | ||
25 | |||
26 | #include "actionresult.h" | ||
24 | 27 | ||
25 | namespace Kube { | 28 | namespace Kube { |
26 | class Context; | 29 | class Context; |
@@ -36,7 +39,7 @@ public: | |||
36 | virtual bool isActionReady(Context *context); | 39 | virtual bool isActionReady(Context *context); |
37 | 40 | ||
38 | // void pre(Context *context); | 41 | // void pre(Context *context); |
39 | virtual void execute(Context *context); | 42 | virtual ActionResult execute(Context *context); |
40 | // void post(Context *context); | 43 | // void post(Context *context); |
41 | 44 | ||
42 | void setActionId(const QByteArray &); | 45 | void setActionId(const QByteArray &); |
@@ -52,14 +55,17 @@ class ActionHandlerHelper : public ActionHandler | |||
52 | public: | 55 | public: |
53 | typedef std::function<bool(Context*)> IsReadyFunction; | 56 | typedef std::function<bool(Context*)> IsReadyFunction; |
54 | typedef std::function<void(Context*)> Handler; | 57 | typedef std::function<void(Context*)> Handler; |
58 | typedef std::function<KAsync::Job<void>(Context*)> JobHandler; | ||
55 | 59 | ||
56 | ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &, const Handler &); | 60 | ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &, const Handler &); |
61 | ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &, const JobHandler &); | ||
57 | 62 | ||
58 | bool isActionReady(Context *context) Q_DECL_OVERRIDE; | 63 | bool isActionReady(Context *context) Q_DECL_OVERRIDE; |
59 | void execute(Context *context) Q_DECL_OVERRIDE; | 64 | ActionResult execute(Context *context) Q_DECL_OVERRIDE; |
60 | private: | 65 | private: |
61 | const std::function<bool(Context*)> isReadyFunction; | 66 | const IsReadyFunction isReadyFunction; |
62 | const std::function<void(Context*)> handlerFunction; | 67 | const Handler handlerFunction; |
68 | const JobHandler jobHandlerFunction; | ||
63 | }; | 69 | }; |
64 | 70 | ||
65 | } | 71 | } |