src: refactored lib/utility
* removed unused utilityMath * removed some unused functions from utility * moved time related utility functions to TimeStamp * moved path objects from utility to app/paths * moved objects in lib to lib/app * removed duplicate confirm methods in DialogView * moved utilityFile to utility/file * removed uint typedef and replaced with size_t everywhere * removed boost header in utilityUuid
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#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<MessageActivateWindow>
|
||||
, public MessageListener<MessageIndexingFinished>
|
||||
, public MessageListener<MessageLoadProject>
|
||||
, public MessageListener<MessageRefresh>
|
||||
, public MessageListener<MessageRefreshUI>
|
||||
, public MessageListener<MessageSwitchColorScheme>
|
||||
, public MessageListener<MessageWindowFocus>
|
||||
{
|
||||
public:
|
||||
static const int EULA_VERSION = 5;
|
||||
static bool EULA_ACCEPT_REQUIRED;
|
||||
|
||||
static void createInstance(const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory);
|
||||
static std::shared_ptr<Application> getInstance();
|
||||
static void destroyInstance();
|
||||
|
||||
static std::string getUUID();
|
||||
|
||||
static void loadSettings();
|
||||
static void loadStyle(const FilePath& colorSchemePath);
|
||||
|
||||
~Application();
|
||||
|
||||
const std::shared_ptr<Project> getCurrentProject();
|
||||
bool isProjectLoaded() const;
|
||||
|
||||
bool hasGUI();
|
||||
|
||||
int handleDialog(const std::wstring& message);
|
||||
int handleDialog(const std::wstring& message, const std::vector<std::wstring>& options);
|
||||
std::shared_ptr<DialogView> getDialogView(DialogView::UseCase useCase);
|
||||
|
||||
void updateHistoryMenu(std::shared_ptr<MessageBase> message);
|
||||
void updateBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
|
||||
|
||||
private:
|
||||
static std::shared_ptr<Application> 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<Project> m_project;
|
||||
std::shared_ptr<StorageCache> m_storageCache;
|
||||
|
||||
std::shared_ptr<MainView> m_mainView;
|
||||
|
||||
std::shared_ptr<IDECommunicationController> m_ideCommunicationController;
|
||||
std::shared_ptr<UpdateChecker> m_updateChecker;
|
||||
|
||||
TimeStamp m_lastLicenseCheck;
|
||||
};
|
||||
|
||||
#endif // APPLICATION_H
|
||||
Reference in New Issue
Block a user