Loading...
Searching...
No Matches
ScenarioApplicationPlugin.hpp
1#pragma once
2#include <Process/Layer/LayerContextMenu.hpp>
3
4#include <Scenario/Application/Menus/ObjectMenuActions.hpp>
5#include <Scenario/Application/Menus/ToolMenuActions.hpp>
6#include <Scenario/Application/Menus/TransportActions.hpp>
7#include <Scenario/Application/ScenarioEditionSettings.hpp>
8#include <Scenario/Execution/ScenarioExecution.hpp>
9#include <Scenario/Palette/ScenarioPoint.hpp>
10
11#include <score/plugins/application/GUIApplicationPlugin.hpp>
12
13#include <score_plugin_scenario_export.h>
14
15#include <vector>
16#include <verdigris>
17
18namespace Process
19{
20class LayerPresenter;
21class ProcessFocusManager;
22}
23namespace score
24{
25class Document;
26} // namespace score
27
28class QAction;
29namespace Scenario
30{
31class ObjectMenuActions;
32class ScenarioActions;
33class ScenarioPresenter;
34class ToolMenuActions;
35class ProcessModel;
36class ScenarioInterface;
37class StateModel;
38
39class SCORE_PLUGIN_SCENARIO_EXPORT ScenarioApplicationPlugin final
40 : public QObject
42{
44 friend class ScenarioContextMenuManager;
45
46public:
49
50 void initialize() override;
51 GUIElements makeGUIElements() override;
52
53 ScenarioPresenter* focusedPresenter() const;
54
55 void reinit_tools();
56
57 Scenario::EditionSettings& editionSettings() { return m_editionSettings; }
58
59 Process::ProcessFocusManager* processFocusManager() const;
60 Process::LayerContextMenuManager& layerContextMenuRegistrar()
61 {
62 return m_layerCtxMenuManager;
63 }
64 const Process::LayerContextMenuManager& layerContextMenuRegistrar() const
65 {
66 return m_layerCtxMenuManager;
67 }
68
69 Scenario::ScenarioExecution& execution() { return m_execution; }
70
71 TransportActions& transportActions() { return m_transportActions; };
72
73public:
74 void keyPressed(int arg_1) E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, keyPressed, arg_1)
75 void keyReleased(int arg_1) E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, keyReleased, arg_1)
76
77private:
78 void prepareNewDocument() override;
79 void on_initDocument(score::Document& doc) override;
80 void on_createdDocument(score::Document& doc) override;
81
82 void on_documentChanged(score::Document* olddoc, score::Document* newdoc) override;
83
84 void on_activeWindowChanged() override;
85
86 void on_presenterFocused(Process::LayerPresenter* lm);
87 void on_presenterDefocused(Process::LayerPresenter* lm);
88
89 QMetaObject::Connection m_focusConnection, m_defocusConnection,
90 m_contextMenuConnection, m_keyPressConnection, m_keyReleaseConnection;
91
92 Scenario::EditionSettings m_editionSettings;
93 Process::LayerContextMenuManager m_layerCtxMenuManager;
94 ScenarioExecution m_execution;
95
96 ObjectMenuActions m_objectActions{this};
97 ToolMenuActions m_toolActions{this};
98 TransportActions m_transportActions{context};
99 QAction* m_showCables{};
100 QAction* m_autoScroll{};
101 QAction* m_foldIntervals{};
102 QAction* m_unfoldIntervals{};
103 QAction* m_levelUp{};
104};
105}
Definition LayerContextMenu.hpp:38
Definition LayerPresenter.hpp:34
Definition ProcessFocusManager.hpp:33
Definition ScenarioEditionSettings.hpp:14
Definition ObjectMenuActions.hpp:19
Definition ScenarioApplicationPlugin.hpp:42
Definition ScenarioContextMenuManager.hpp:27
API for the various elements that we can execute.
Definition Execution/ScenarioExecution.hpp:25
Definition ScenarioPresenter.hpp:29
Definition ToolMenuActions.hpp:22
Definition TransportActions.hpp:18
The Document class is the central part of the software.
Definition Document.hpp:51
Used to extend the software with application-wide data.
Definition GUIApplicationPlugin.hpp:89
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Base toolkit upon which the software is built.
Definition Application.cpp:90
Specializes ApplicationContext with the QMainWindow.
Definition GUIApplicationContext.hpp:15
Definition GUIApplicationPlugin.hpp:24