diff options
Diffstat (limited to '')
-rw-r--r-- | src/GpgFrontendContext.h (renamed from src/type.h) | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/src/type.h b/src/GpgFrontendContext.h index 1b98b60f..54d2f0b8 100644 --- a/src/type.h +++ b/src/GpgFrontendContext.h @@ -28,8 +28,50 @@ #pragma once -struct InitArgs { +namespace GpgFrontend { + +struct GpgFrontendContext { int argc; - char **argv; + char** argv; spdlog::level::level_enum log_level; -};
\ No newline at end of file + + bool load_ui_env; + std::unique_ptr<QCoreApplication> app; + + /** + * @brief Create a Instance object + * + * @param argc + * @param argv + * @return std::weak_ptr<GpgFrontendContext> + */ + static auto CreateInstance(int argc, char** argv) + -> std::weak_ptr<GpgFrontendContext>; + + /** + * @brief Get the Instance object + * + * @return std::weak_ptr<GpgFrontendContext> + */ + static auto GetInstance() -> std::weak_ptr<GpgFrontendContext>; + + /** + * @brief + * + */ + void InitGUIApplication(); + + /** + * @brief + * + */ + void InitCoreApplication(); + + private: + static std::shared_ptr<GpgFrontendContext> global_context; +}; + +using GFCxtWPtr = std::weak_ptr<GpgFrontendContext>; +using GFCxtSPtr = std::shared_ptr<GpgFrontendContext>; + +} // namespace GpgFrontend
\ No newline at end of file |