#ifndef APPLICATION_H #define APPLICATION_H #include #include "component/ComponentManager.h" #include "project/Project.h" #include "utility/messaging/MessageListener.h" #include "utility/messaging/type/MessageActivateWindow.h" #include "utility/messaging/type/MessageEnteredLicense.h" #include "utility/messaging/type/MessageFinishedParsing.h" #include "utility/messaging/type/MessageLoadProject.h" #include "utility/messaging/type/MessageRefresh.h" #include "utility/messaging/type/MessageSwitchColorScheme.h" #include "utility/messaging/type/MessageWindowFocus.h" class Bookmark; class DialogView; class IDECommunicationController; class MainView; class NetworkFactory; class StorageCache; class UpdateChecker; class Version; class ViewFactory; class Application : public MessageListener , public MessageListener , public MessageListener , public MessageListener , public MessageListener , public MessageListener , public MessageListener { public: static void createInstance(const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory); static std::shared_ptr getInstance(); static void destroyInstance(); static std::string getUUID(); static void loadSettings(); static void loadStyle(const FilePath& colorSchemePath); ~Application(); const std::shared_ptr getCurrentProject(); void createAndLoadProject(const FilePath& projectSettingsFilePath); void refreshProject(bool force); bool hasGUI(); int handleDialog(const std::string& message); int handleDialog(const std::string& message, const std::vector& options); std::shared_ptr getDialogView(); void updateHistory(const std::vector& history); void updateBookmarks(const std::vector>& bookmarks); private: static std::shared_ptr s_instance; static std::string s_uuid; Application(bool withGUI=true); virtual void handleMessage(MessageActivateWindow* message); virtual void handleMessage(MessageEnteredLicense* message); virtual void handleMessage(MessageFinishedParsing* message); virtual void handleMessage(MessageLoadProject* message); virtual void handleMessage(MessageRefresh* message); virtual void handleMessage(MessageSwitchColorScheme* message); virtual void handleMessage(MessageWindowFocus* message); void startMessagingAndScheduling(); void updateRecentProjects(const FilePath& projectSettingsFilePath); void logStorageStats() const; void updateTitle(); bool checkSharedMemory(); const bool m_hasGUI; std::shared_ptr m_project; std::shared_ptr m_storageCache; std::shared_ptr m_mainView; std::shared_ptr m_componentManager; std::shared_ptr m_ideCommunicationController; std::shared_ptr m_updateChecker; MessageEnteredLicense::LicenseType m_licenseType; TimeStamp m_lastLicenseCheck; }; #endif // APPLICATION_H