EventPresenter.hpp
1 #pragma once
2 #include <Scenario/Document/VerticalExtent.hpp>
3 
4 #include <score/command/Dispatchers/MacroCommandDispatcher.hpp>
5 #include <score/graphics/GraphicsItem.hpp>
6 
7 #include <QPoint>
8 
9 #include <score_plugin_scenario_export.h>
10 
11 #include <verdigris>
12 class QGraphicsItem;
13 class QMimeData;
14 class QObject;
15 #include <score/model/Identifier.hpp>
16 
17 namespace Scenario
18 {
19 class EventModel;
20 class EventView;
21 class StatePresenter;
22 
23 class SCORE_PLUGIN_SCENARIO_EXPORT EventPresenter final : public QObject
24 {
25  W_OBJECT(EventPresenter)
26 
27 public:
28  EventPresenter(const EventModel& model, QGraphicsItem* parentview, QObject* parent);
29  virtual ~EventPresenter();
30 
31  const Id<EventModel>& id() const;
32 
33  EventView* view() const;
34  const EventModel& model() const;
35 
36  bool isSelected() const;
37  void handleDrop(const QPointF& pos, const QMimeData& mime);
38 
39  void addState(StatePresenter* ev);
40  void removeState(StatePresenter* ev);
41  const std::vector<StatePresenter*>& states() const noexcept { return m_states; }
42 
43  VerticalExtent extent() const noexcept;
44  void setExtent(const Scenario::VerticalExtent& extent);
45 
46  void extentChanged(const Scenario::VerticalExtent& extent)
47  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, extentChanged, extent)
48 
49  void pressed(const QPointF& arg_1)
50  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, pressed, arg_1)
51  void moved(const QPointF& arg_1) E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, moved, arg_1)
52  void released(const QPointF& arg_1)
53  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, released, arg_1)
54 
55  void eventHoverEnter() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, eventHoverEnter)
56  void eventHoverLeave() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, eventHoverLeave)
57 
58 private:
59  const EventModel& m_model;
60  std::vector<StatePresenter*> m_states;
61  VerticalExtent m_extent;
63 };
64 }
Definition: EventModel.hpp:36
Definition: EventPresenter.hpp:24
Definition: EventView.hpp:35
Definition: StatePresenter.hpp:23
The id_base_t class.
Definition: Identifier.hpp:57
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
The VerticalExtent struct.
Definition: VerticalExtent.hpp:20
Definition: GraphicsItem.hpp:41