Loading...
Searching...
No Matches
IntervalHeader.hpp
1#pragma once
2#include <Scenario/Document/ScenarioDocument/ScenarioDocumentViewConstants.hpp>
3
4#include <QGraphicsItem>
5
6#include <score_plugin_scenario_export.h>
7
8class QGraphicsSceneMouseEvent;
9
10namespace Scenario
11{
12class IntervalView;
13class SCORE_PLUGIN_SCENARIO_TEST_EXPORT IntervalHeader
14 : public QObject
15 , public QGraphicsItem
16{
17public:
18 enum class State
19 {
20 Hidden, // No rack, we show nothing
21 RackHidden, // There is at least a hidden rack in the interval
22 RackShown // There is a rack currently shown
23 };
24
25 explicit IntervalHeader(QGraphicsItem* parent = nullptr);
26
27 static const constexpr int Type = ItemType::IntervalHeader;
28 int type() const final override { return Type; }
29
30 void setIntervalView(IntervalView* view) { m_view = view; }
31 IntervalView* intervalView() const noexcept { return m_view; }
32 static constexpr double headerHeight() { return IntervalHeaderHeight; }
33
34 void setWidth(double width);
35 virtual void setState(State s) = 0;
36 State state() const noexcept { return m_state; }
37
38 virtual void on_textChanged() { }
39
40protected:
41 void mousePressEvent(QGraphicsSceneMouseEvent* event) final override;
42 void mouseMoveEvent(QGraphicsSceneMouseEvent* event) final override;
43 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) final override;
44
45protected:
46 IntervalView* m_view{};
47 State m_state{};
48 double m_width{};
49};
50}
Definition IntervalHeader.hpp:16
Definition IntervalView.hpp:34
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Utilities for OSSIA data structures.
Definition DeviceInterface.hpp:35