Index: src/ch/ch.h =================================================================== diff -u -ra08ca9e12d93e9a036a5cf739348ff3ef2a58be8 -rf102f95617e81f56adbed6403e42602ea8c509b5 --- src/ch/ch.h (.../ch.h) (revision a08ca9e12d93e9a036a5cf739348ff3ef2a58be8) +++ src/ch/ch.h (.../ch.h) (revision f102f95617e81f56adbed6403e42602ea8c509b5) @@ -21,38 +21,40 @@ #include "AppHelper.h" #include "../libictranslate/ResourceManager.h" -#include "../libchcore/TConfig.h" #include "TShellExtensionClient.h" #include "TCommandLineParser.h" #include "../liblogger/TLogger.h" -#include "../libchcore/TCoreEngine.h" +#include "TShellExtensionConfig.h" +#include "../libchengine/TConfig.h" +#include "../libchengine/TCoreEngine.h" class CCopyHandlerApp : public CWinApp, public CAppHelper { public: CCopyHandlerApp(); ~CCopyHandlerApp(); - virtual BOOL InitInstance() override; - virtual int ExitInstance() override; + BOOL InitInstance() override; + int ExitInstance() override; - virtual void HtmlHelp(DWORD_PTR dwData, UINT nCmd) override; + void HtmlHelp(DWORD_PTR dwData, UINT nCmd) override; - PCTSTR GetHelpPath() const { return m_pszHelpFilePath; }; + PCTSTR GetHelpPath() const { return m_pszHelpFilePath; } - friend int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); + static int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); friend CCopyHandlerApp& GetApplication(); static ictranslate::CResourceManager& GetResManager(); - static chcore::TConfig& GetConfig(); + static chengine::TConfig& GetConfig(); logger::TLogFileDataPtr GetLogFileData() const; logger::TMultiLoggerConfigPtr GetEngineLoggerConfig() const; + TShellExtensionConfigPtr GetShellExtensionConfig() const; void RegisterShellExtension(); void UnregisterShellExtension(); - void OnConfigNotify(const chcore::TStringSet& setPropNames); + void OnConfigNotify(const string::TStringSet& setPropNames); void OnResManNotify(UINT uiType); const TCommandLineParser& GetCommandLine() const { return m_cmdLineParser; } @@ -65,23 +67,29 @@ bool ParseCommandLine(); protected: - TShellExtensionClient m_tShellExtClient; - TCommandLineParser m_cmdLineParser; + logger::TMultiLoggerConfigPtr m_spAppLoggerConfig; + logger::TMultiLoggerConfigPtr m_spEngineLoggerConfig; - chcore::TCoreEngine m_chEngine; logger::TLoggerPtr m_spLog; - logger::TMultiLoggerConfigPtr m_spAppLoggerConfig; - logger::TMultiLoggerConfigPtr m_spEngineLoggerConfig; + TCommandLineParser m_cmdLineParser; + chengine::TCoreEngine m_chEngine; + + TShellExtensionConfigPtr m_shellExtConfig; + TShellExtensionClient m_tShellExtClient; + CWnd *m_pMainWindow; + bool m_bComInitialized = false; DECLARE_MESSAGE_MAP() private: void InitLoggers(); }; +CCopyHandlerApp& GetApplication(); + inline CCopyHandlerApp& GetApp() { return GetApplication(); @@ -97,9 +105,19 @@ return CCopyHandlerApp::GetResManager(); } -inline chcore::TConfig& GetConfig() +inline chengine::TConfig& GetConfig() { return CCopyHandlerApp::GetConfig(); } +inline TShellExtensionConfigPtr GetShellExtensionConfig() +{ + return GetApp().GetShellExtensionConfig(); +} + +inline int MsgBox(UINT uiID, UINT nType = MB_OK, UINT nIDHelp = 0) +{ + return GetApp().MsgBox(uiID, nType, nIDHelp); +} + #endif