TemporalIntervalView.hpp
1 #pragma once
2 #include <Process/TimeValue.hpp>
3 
4 #include <Scenario/Document/Interval/ExecutionState.hpp>
5 #include <Scenario/Document/Interval/IntervalView.hpp>
6 
7 #include <score/graphics/TextItem.hpp>
8 #include <score/model/ColorReference.hpp>
9 #include <score/widgets/MimeData.hpp>
10 
11 #include <QPainter>
12 #include <QRect>
13 
14 #include <verdigris>
15 namespace Process
16 {
17 class LayerPresenter;
18 }
19 namespace Scenario
20 {
21 class TemporalIntervalPresenter;
22 class IntervalDurations;
23 class SCORE_PLUGIN_SCENARIO_EXPORT TemporalIntervalView final : public IntervalView
24 {
25  W_OBJECT(TemporalIntervalView)
26 
27 public:
28  TemporalIntervalView(TemporalIntervalPresenter& presenter, QGraphicsItem* parent);
29  ~TemporalIntervalView() override;
30 
31  QRectF boundingRect() const override;
32 
33  const TemporalIntervalPresenter& presenter() const;
34  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
35  override;
36 
37  void setExecutionDuration(const TimeVal& progress);
38 
39  void updateOverlayPos();
40  void setSelected(bool selected);
41 
42 public:
43  void intervalHoverEnter() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, intervalHoverEnter)
44  void intervalHoverLeave() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, intervalHoverLeave)
45 
46 private:
47  void hoverEnterEvent(QGraphicsSceneHoverEvent* h) override;
48  void hoverLeaveEvent(QGraphicsSceneHoverEvent* h) override;
49 
50  void updatePaths() final override;
51  void updatePlayPaths() final override;
52  void drawDashedPath(QPainter& p, QRectF visibleRect, const Process::Style& skin);
53  void drawPlayDashedPath(QPainter& p, QRectF visibleRect, const Process::Style& skin);
54 };
55 }
Definition: IntervalView.hpp:34
Definition: TemporalIntervalPresenter.hpp:25
Definition: TemporalIntervalView.hpp:24
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:14
Definition: ScenarioStyle.hpp:13
Definition: TimeValue.hpp:21