#ifndef APPLICATION_H #define APPLICATION_H #include #include "DialogView.h" #include "MessageListener.h" #include "MessageIndexingFinished.h" #include "MessageActivateWindow.h" #include "MessageLoadProject.h" #include "MessageRefresh.h" #include "MessageRefreshUI.h" #include "MessageSwitchColorScheme.h" #include "MessageWindowFocus.h" #include "Project.h" #include "TimeStamp.h" class Bookmark; 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 const int EULA_VERSION = 5; 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(); bool isProjectLoaded() const; bool hasGUI(); int handleDialog(const std::string& message); int handleDialog(const std::string& message, const std::vector& options); int handleDialog(const std::wstring& message); int handleDialog(const std::wstring& message, const std::vector& options); std::shared_ptr getDialogView(DialogView::UseCase useCase); void updateHistoryMenu(std::shared_ptr message); void updateBookmarks(const std::vector>& bookmarks); private: static std::shared_ptr s_instance; static std::string s_uuid; Application(bool withGUI = true); void handleMessage(MessageActivateWindow* message) override; void handleMessage(MessageIndexingFinished* message) override; void handleMessage(MessageLoadProject* message) override; void handleMessage(MessageRefresh* message) override; void handleMessage(MessageRefreshUI* message) override; void handleMessage(MessageSwitchColorScheme* message) override; void handleMessage(MessageWindowFocus* message) override; FilePath migrateProjectSettings(const FilePath& projectSettingsFilePath) const; void startMessagingAndScheduling(); void loadWindow(bool showStartWindow); void refreshProject(RefreshMode refreshMode); void updateRecentProjects(const FilePath& projectSettingsFilePath); void logStorageStats() const; void updateTitle(); bool checkSharedMemory(); const bool m_hasGUI; bool m_loadedWindow = false; std::shared_ptr m_project; std::shared_ptr m_storageCache; std::shared_ptr m_mainView; std::shared_ptr m_ideCommunicationController; std::shared_ptr m_updateChecker; TimeStamp m_lastLicenseCheck; }; #endif // APPLICATION_H