Index: src/ch/ch.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -rb556d023b748dfea230575959b6513acf29fd7b3 --- src/ch/ch.h (.../ch.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/ch/ch.h (.../ch.h) (revision b556d023b748dfea230575959b6513acf29fd7b3) @@ -24,12 +24,10 @@ #include "../libchcore/TConfig.h" #include "TShellExtensionClient.h" #include "TCommandLineParser.h" +#include "../liblogger/TLogger.h" +#include "../libchcore/TCoreEngine.h" +#include "TShellExtensionConfig.h" -///////////////////////////////////////////////////////////////////////////// -// CCopyHandlerApp: -// See CopyHandler.cpp for the implementation of this class -// - class CCopyHandlerApp : public CWinApp, public CAppHelper { public: @@ -45,10 +43,14 @@ friend int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); - friend CCopyHandlerApp& GetApp(); - friend ictranslate::CResourceManager& GetResManager(); - friend chcore::TConfig& GetConfig(); + friend CCopyHandlerApp& GetApplication(); + static ictranslate::CResourceManager& GetResManager(); + static chcore::TConfig& GetConfig(); + logger::TLogFileDataPtr GetLogFileData() const; + logger::TMultiLoggerConfigPtr GetEngineLoggerConfig() const; + TShellExtensionConfigPtr GetShellExtensionConfig() const; + void RegisterShellExtension(); void UnregisterShellExtension(); @@ -65,12 +67,50 @@ bool ParseCommandLine(); protected: - TShellExtensionClient m_tShellExtClient; + logger::TMultiLoggerConfigPtr m_spAppLoggerConfig; + logger::TMultiLoggerConfigPtr m_spEngineLoggerConfig; + + logger::TLoggerPtr m_spLog; + TCommandLineParser m_cmdLineParser; + chcore::TCoreEngine m_chEngine; + + TShellExtensionConfigPtr m_shellExtConfig; + TShellExtensionClient m_tShellExtClient; + CWnd *m_pMainWindow; + bool m_bComInitialized = false; DECLARE_MESSAGE_MAP() + +private: + void InitLoggers(); }; +inline CCopyHandlerApp& GetApp() +{ + return GetApplication(); +} + +inline logger::TLogFileDataPtr GetLogFileData() +{ + return GetApp().GetLogFileData(); +} + +inline ictranslate::CResourceManager& GetResManager() +{ + return CCopyHandlerApp::GetResManager(); +} + +inline chcore::TConfig& GetConfig() +{ + return CCopyHandlerApp::GetConfig(); +} + +inline TShellExtensionConfigPtr GetShellExtensionConfig() +{ + return GetApp().GetShellExtensionConfig(); +} + #endif