Loading...
Searching...
No Matches
lib/core/presenter/Presenter.hpp
1#pragma once
2#include <score/actions/ActionManager.hpp>
3#include <score/actions/MenuManager.hpp>
4#include <score/actions/ToolbarManager.hpp>
5#include <score/application/ApplicationComponents.hpp>
6#include <score/application/GUIApplicationContext.hpp>
7
8#include <core/presenter/DocumentManager.hpp>
9#include <core/settings/Settings.hpp>
10
11#include <QMenuBar>
12
13#include <score_lib_base_export.h>
14
15#include <vector>
16#include <verdigris>
17class QObject;
18
19namespace score
20{
21
22class CoreApplicationPlugin;
23class View;
24class Settings;
25
35class SCORE_LIB_BASE_EXPORT Presenter final : public QObject
36{
37 W_OBJECT(Presenter)
39
40public:
43 score::ProjectSettings& pset, score::View* view, QObject* parent);
44 ~Presenter();
45 // Exit score
46 bool exit();
48 bool exiting() const noexcept { return m_exiting; }
49
50 View* view() const;
51
52 auto& menuManager() { return m_menus; }
53 auto& toolbarManager() { return m_toolbars; }
54 auto& actionManager() { return m_actions; }
55
56 // Called after all the classes
57 // have been loaded from plug-ins.
58 void setupGUI();
59
60 auto& documentManager() { return m_docManager; }
61 const ApplicationComponents& applicationComponents() { return m_components_readonly; }
62 const GUIApplicationContext& applicationContext() { return m_context; }
63
64 auto& components() { return m_components; }
65 auto& settings() { return m_settings; }
66
67 void optimize();
68
69private:
70 bool m_exiting{};
71 void setupMenus();
72 View* m_view{};
73 Settings& m_settings;
74 ProjectSettings& m_projectSettings;
75
76 DocumentManager m_docManager;
77 ApplicationComponentsData m_components;
78 ApplicationComponents m_components_readonly;
79
80 QMenuBar* m_menubar{};
81 GUIApplicationContext m_context;
82
83 MenuManager m_menus;
84 ToolbarManager m_toolbars;
85 ActionManager m_actions;
86};
87}
Base actions for the score software.
Definition CoreApplicationPlugin.hpp:16
The Presenter class.
Definition lib/core/presenter/Presenter.hpp:36
bool exiting() const noexcept
True while exit() closes the documents.
Definition lib/core/presenter/Presenter.hpp:48
Definition lib/core/settings/Settings.hpp:81
Application-wide user settings registering and handling.
Definition lib/core/settings/Settings.hpp:42
The main display of the application.
Definition lib/core/view/Window.hpp:41
Base toolkit upon which the software is built.
Definition Application.cpp:83
Load-time settings.
Definition ApplicationSettings.hpp:26