diff options
author | saturneric <[email protected]> | 2024-04-21 19:49:04 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-04-21 19:49:04 +0000 |
commit | 571a2906063739067e40a02aadd8c265082359de (patch) | |
tree | 5ac57f777ec38f6a5f328da4e3df6ad6cc010aff /src/core/module/Module.h | |
parent | fix: could not determine the path to the executable based on the desktop file (diff) | |
parent | feat: adapt linux appimage of modules loading (diff) | |
download | GpgFrontend-571a2906063739067e40a02aadd8c265082359de.tar.gz GpgFrontend-571a2906063739067e40a02aadd8c265082359de.zip |
Merge branch 'dev/2.1.2/module' into develop
Diffstat (limited to 'src/core/module/Module.h')
-rw-r--r-- | src/core/module/Module.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/core/module/Module.h b/src/core/module/Module.h index 2a5b54e7..615d09b9 100644 --- a/src/core/module/Module.h +++ b/src/core/module/Module.h @@ -39,7 +39,7 @@ class ModuleManager; using ModuleIdentifier = QString; using ModuleVersion = QString; -using ModuleMetaData = std::map<QString, QString>; +using ModuleMetaData = QMap<QString, QString>; using ModulePtr = std::shared_ptr<Module>; using TaskRunnerPtr = std::shared_ptr<Thread::TaskRunner>; @@ -47,21 +47,39 @@ using TaskRunnerPtr = std::shared_ptr<Thread::TaskRunner>; class GPGFRONTEND_CORE_EXPORT Module : public QObject { Q_OBJECT public: - Module(ModuleIdentifier, ModuleVersion, const ModuleMetaData&); + Module(ModuleIdentifier, ModuleVersion, const ModuleMetaData &); + + explicit Module(QLibrary &module_library); ~Module(); - virtual auto Register() -> bool = 0; + auto IsGood() -> bool; + + virtual auto Register() -> int; + + virtual auto Active() -> int; - virtual auto Active() -> bool = 0; + virtual auto Exec(EventRefrernce) -> int; - virtual auto Exec(EventRefrernce) -> int = 0; + virtual auto Deactive() -> int; - virtual auto Deactive() -> bool = 0; + virtual auto UnRegister() -> int; [[nodiscard]] auto GetModuleIdentifier() const -> ModuleIdentifier; - void SetGPC(GlobalModuleContext*); + [[nodiscard]] auto GetModuleVersion() const -> ModuleVersion; + + [[nodiscard]] auto GetModuleMetaData() const -> ModuleMetaData; + + [[nodiscard]] auto GetModulePath() const -> QString; + + [[nodiscard]] auto GetModuleHash() const -> QString; + + [[nodiscard]] auto GetModuleSDKVersion() const -> QString; + + [[nodiscard]] auto GetModuleQtEnvVersion() const -> QString; + + void SetGPC(GlobalModuleContext *); protected: auto getChannel() -> int; |