CurveEditionSettings.hpp
1 #pragma once
2 
3 #include <QObject>
4 
5 #include <score_plugin_curve_export.h>
6 
7 #include <verdigris>
8 
9 namespace Curve
10 {
11 enum class Tool
12 {
13  Disabled,
14  Select,
15  Create,
16  SetSegment,
17  CreatePen,
18  RemovePen,
19  Playing
20 };
21 enum class AddPointBehaviour
22 {
23  LinearBefore,
24  LinearAfter,
25  DuplicateSegment
26 };
27 enum class RemovePointBehaviour
28 {
29  Remove,
30  RemoveAndAddSegment
31 };
32 
33 class SCORE_PLUGIN_CURVE_EXPORT EditionSettings : public QObject
34 {
35  W_OBJECT(EditionSettings)
36 
37  bool m_lockBetweenPoints{true};
38  bool m_suppressOnOverlap{true};
39  bool m_stretchBothBounds{false};
40  Curve::AddPointBehaviour m_addPointBehaviour{AddPointBehaviour::DuplicateSegment};
41  Curve::RemovePointBehaviour m_removePointBehaviour{
42  RemovePointBehaviour::RemoveAndAddSegment};
43  Curve::Tool m_tool{Curve::Tool::Disabled};
44 
45 public:
46  bool lockBetweenPoints() const;
47  bool suppressOnOverlap() const;
48  bool stretchBothBounds() const;
49  Curve::AddPointBehaviour addPointBehaviour() const;
50  Curve::RemovePointBehaviour removePointBehaviour() const;
51  Curve::Tool tool() const;
52 
53  void setLockBetweenPoints(bool);
54  void setSuppressOnOverlap(bool);
55  void setStretchBothBounds(bool);
56  void setAddPointBehaviour(Curve::AddPointBehaviour);
57  void setRemovePointBehaviour(Curve::RemovePointBehaviour removePointBehaviour);
58  void setTool(Curve::Tool tool);
59 
60 public:
61  void lockBetweenPointsChanged(bool arg_1)
62  E_SIGNAL(SCORE_PLUGIN_CURVE_EXPORT, lockBetweenPointsChanged, arg_1)
63  void suppressOnOverlapChanged(bool arg_1)
64  E_SIGNAL(SCORE_PLUGIN_CURVE_EXPORT, suppressOnOverlapChanged, arg_1)
65  void stretchBothBoundsChanged(bool arg_1)
66  E_SIGNAL(SCORE_PLUGIN_CURVE_EXPORT, stretchBothBoundsChanged, arg_1)
67  void addPointBehaviourChanged(Curve::AddPointBehaviour arg_1)
68  E_SIGNAL(SCORE_PLUGIN_CURVE_EXPORT, addPointBehaviourChanged, arg_1)
69  void removePointBehaviourChanged(Curve::RemovePointBehaviour removePointBehaviour)
70  E_SIGNAL(
71  SCORE_PLUGIN_CURVE_EXPORT, removePointBehaviourChanged, removePointBehaviour)
72  void toolChanged(Curve::Tool tool)
73  E_SIGNAL(SCORE_PLUGIN_CURVE_EXPORT, toolChanged, tool)
74 
75  W_PROPERTY(Curve::Tool, tool READ tool WRITE setTool NOTIFY toolChanged)
76 
77  W_PROPERTY(
78  Curve::RemovePointBehaviour,
79  removePointBehaviour READ removePointBehaviour WRITE setRemovePointBehaviour NOTIFY
80  removePointBehaviourChanged)
81 
82  W_PROPERTY(
83  Curve::AddPointBehaviour, addPointBehaviour READ addPointBehaviour WRITE
84  setAddPointBehaviour NOTIFY addPointBehaviourChanged)
85 
86  W_PROPERTY(
87  bool, stretchBothBounds READ stretchBothBounds WRITE setStretchBothBounds NOTIFY
88  stretchBothBoundsChanged)
89 
90  W_PROPERTY(
91  bool, suppressOnOverlap READ suppressOnOverlap WRITE setSuppressOnOverlap NOTIFY
92  suppressOnOverlapChanged)
93 
94  W_PROPERTY(
95  bool, lockBetweenPoints READ lockBetweenPoints WRITE setLockBetweenPoints NOTIFY
96  lockBetweenPointsChanged)
97 };
98 }
99 
100 Q_DECLARE_METATYPE(Curve::Tool)
101 W_REGISTER_ARGTYPE(Curve::Tool)
102 W_REGISTER_ARGTYPE(Curve::AddPointBehaviour)
103 W_REGISTER_ARGTYPE(Curve::RemovePointBehaviour)
Definition: CurveEditionSettings.hpp:34
Utilities and base classes for 1D curves.
Definition: FocusDispatcher.hpp:12