aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/module/Event.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-02-28 16:32:43 +0000
committersaturneric <[email protected]>2024-02-28 16:32:43 +0000
commit12d70e1792a5b1ff08d4b58fb49fb9e58d6551a8 (patch)
tree1b747d6a3a034814104df6f531077de9c03ecd53 /src/core/module/Event.h
parentfeat: add user agent header when doing http request (diff)
downloadGpgFrontend-12d70e1792a5b1ff08d4b58fb49fb9e58d6551a8.tar.gz
GpgFrontend-12d70e1792a5b1ff08d4b58fb49fb9e58d6551a8.zip
feat: upgrade module system
1. load module and resolve symbols at runtime 2. restrict sdk functions and structures to c style 3. add some core api to support it
Diffstat (limited to 'src/core/module/Event.h')
-rw-r--r--src/core/module/Event.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/module/Event.h b/src/core/module/Event.h
index 92268216..d7c35314 100644
--- a/src/core/module/Event.h
+++ b/src/core/module/Event.h
@@ -34,6 +34,7 @@
#include "core/GpgFrontendCore.h"
#include "core/model/DataObject.h"
+#include "module/sdk/Module.h"
namespace GpgFrontend::Module {
@@ -41,6 +42,7 @@ class Event;
using EventRefrernce = std::shared_ptr<Event>;
using EventIdentifier = QString;
+using EventTriggerIdentifier = QString;
using Evnets = std::vector<Event>;
class GPGFRONTEND_CORE_EXPORT Event {
@@ -52,7 +54,7 @@ class GPGFRONTEND_CORE_EXPORT Event {
std::function<void(EventIdentifier, ListenerIdentifier, DataObjectPtr)>;
struct ParameterInitializer {
QString key;
- ParameterValue value;
+ QString value;
};
explicit Event(const QString&,
@@ -75,10 +77,14 @@ class GPGFRONTEND_CORE_EXPORT Event {
auto GetIdentifier() -> EventIdentifier;
- void AddParameter(const QString& key, const ParameterValue& value);
+ auto GetTriggerIdentifier() -> EventTriggerIdentifier;
+
+ void AddParameter(const QString& key, const QString& value);
void ExecuteCallback(ListenerIdentifier, DataObjectPtr);
+ auto ToModuleEvent() -> ModuleEvent*;
+
private:
class Impl;
SecureUniquePtr<Impl> p_;