TimeSyncPresenter.hpp
1 #pragma once
2 
3 #include <Scenario/Document/VerticalExtent.hpp>
4 
5 #include <score/graphics/GraphicsItem.hpp>
6 #include <score/model/Identifier.hpp>
7 
8 #include <QObject>
9 #include <QPoint>
10 
11 #include <sys/types.h>
12 
13 #include <score_plugin_scenario_export.h>
14 
15 #include <verdigris>
16 
17 class QGraphicsItem;
18 class QMimeData;
19 
20 namespace Scenario
21 {
22 class EventModel;
23 class EventPresenter;
24 class TimeSyncModel;
25 class TimeSyncView;
26 class TriggerView;
27 
28 class SCORE_PLUGIN_SCENARIO_EXPORT TimeSyncPresenter final : public QObject
29 {
30  W_OBJECT(TimeSyncPresenter)
31 public:
33  const TimeSyncModel& model, QGraphicsItem* parentview, QObject* parent);
35 
36  const Id<TimeSyncModel>& id() const;
37  int32_t id_val() const { return id().val(); }
38 
39  const TimeSyncModel& model() const;
40  TimeSyncView* view() const;
41 
42  TriggerView& trigger() const noexcept;
43  void handleDrop(const QPointF& pos, const QMimeData& mime);
44 
45  void addEvent(EventPresenter* ev);
46  void removeEvent(EventPresenter* ev);
47 
48  const VerticalExtent& extent() const noexcept;
49  void setExtent(const VerticalExtent& extent);
50 
51  void extentChanged(const Scenario::VerticalExtent& arg_1)
52  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, extentChanged, arg_1)
53 
54  const std::vector<EventPresenter*>& events() const noexcept { return m_events; }
55 
56 public:
57  void pressed(const QPointF& arg_1)
58  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, pressed, arg_1)
59  void moved(const QPointF& arg_1) E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, moved, arg_1)
60  void released(const QPointF& arg_1)
61  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, released, arg_1)
62 
63 private:
64  const TimeSyncModel& m_model;
65  std::vector<EventPresenter*> m_events;
67  TriggerView* m_triggerView{};
68  VerticalExtent m_extent;
69 };
70 }
Definition: EventPresenter.hpp:24
Definition: TimeSyncModel.hpp:34
Definition: TimeSyncPresenter.hpp:29
Definition: TimeSyncView.hpp:20
Definition: TriggerView.hpp:21
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