31 #include "core/module/Event.h"
32 #include "core/thread/TaskRunner.h"
37 class GlobalModuleContext;
40 using ModuleIdentifier = QString;
41 using ModuleVersion = QString;
42 using ModuleMetaData = QMap<QString, QString>;
43 using ModulePtr = std::shared_ptr<Module>;
45 using TaskRunnerPtr = std::shared_ptr<Thread::TaskRunner>;
47 class GPGFRONTEND_CORE_EXPORT
Module :
public QObject {
50 Module(ModuleIdentifier, ModuleVersion,
const ModuleMetaData &);
52 explicit Module(QLibrary &module_library);
56 auto IsGood() -> bool;
58 virtual auto Register() -> int;
60 virtual auto Active() -> int;
62 virtual auto Exec(EventRefrernce) -> int;
64 virtual auto Deactive() -> int;
66 virtual auto UnRegister() -> int;
68 [[nodiscard]]
auto GetModuleIdentifier()
const -> ModuleIdentifier;
70 [[nodiscard]]
auto GetModuleVersion()
const -> ModuleVersion;
72 [[nodiscard]]
auto GetModuleMetaData()
const -> ModuleMetaData;
74 [[nodiscard]]
auto GetModulePath()
const -> QString;
76 [[nodiscard]]
auto GetModuleHash()
const -> QString;
78 [[nodiscard]]
auto GetModuleSDKVersion()
const -> QString;
80 [[nodiscard]]
auto GetModuleQtEnvVersion()
const -> QString;
85 auto getChannel() -> int;
87 auto getDefaultChannel() -> int;
89 auto getTaskRunner() -> TaskRunnerPtr;
91 auto listenEvent(EventIdentifier) -> bool;
95 SecureUniquePtr<Impl> p_;
Definition: GlobalModuleContext.h:54
Definition: Module.cpp:39