8 #ifndef __VRV_CURSOR_H__
9 #define __VRV_CURSOR_H__
15 #include "elementpart.h"
38 std::string GetClassName()
const override {
return "cursor"; }
46 bool IsCursor()
const override {
return true; }
48 int GetDrawingX()
const override;
50 void SetCursorAlignment(
Alignment *alignment);
51 void ResetCursorAlignment();
53 void SetPosition(
LayerElement *position) { m_position = position; }
54 LayerElement *GetPosition()
const {
return m_position; }
55 bool HasPosition()
const {
return (m_position); }
57 void SetContainer(LayerElement *container) { m_container.push(container); }
58 LayerElement *GetContainer()
const {
return m_container.top(); }
59 bool HasContainer()
const {
return (!m_container.empty()); }
61 bool HasAccid()
const {
return m_accid.HasAccid(); }
62 data_ACCIDENTAL_WRITTEN GetAccid()
const {
return m_accid.GetAccid(); }
63 void SetAccid(data_ACCIDENTAL_WRITTEN accid);
64 bool IsAccidImplicit()
const {
return m_isAccidImplicit; }
65 void SetAccidImplicit(
bool isAccidImplicit);
66 void SetAccidValue(
const Accid *accid);
67 std::pair<data_ACCIDENTAL_WRITTEN, data_ACCIDENTAL_GESTURAL> GetAccidValue();
69 Accid *GetAccidElement() {
return &m_accid; }
71 bool IsRestMode()
const {
return m_restMode; }
72 void SetRestMode(
bool restMode);
74 enum ChordMode : int8_t { CHORD_NONE = 0, NEW, EDIT_NEW, EDIT_EXISTING };
76 ChordMode GetChordMode()
const {
return m_chordMode; }
77 void SetChordMode(ChordMode chordMode);
78 bool IsChordMode()
const {
return (m_chordMode != ChordMode::CHORD_NONE); }
79 bool IsChordEditMode()
const
81 return (m_chordMode == ChordMode::EDIT_NEW) || (m_chordMode == ChordMode::EDIT_EXISTING);
84 enum TieMode : int8_t { TIE_NONE = 0, TIE, COPY };
86 TieMode GetTieMode()
const {
return m_tieMode; }
87 void SetTieMode(TieMode tieMode);
88 bool IsTieMode()
const {
return (m_tieMode != TieMode::TIE_NONE); }
90 enum InputMode : int8_t { PITCH_FIRST = 0, DURATION_FIRST };
92 InputMode GetInputMode()
const {
return m_inputMode; }
93 void SetInputMode(InputMode inputMode);
95 int GetYRelPitchC()
const {
return m_yRelPitchC; }
96 void SetYRelPitchC(
int yRelPitchC) { m_yRelPitchC = yRelPitchC; }
98 bool Veto(
const std::string &attribute)
const;
99 void OnSet(
const std::string &attribute);
111 FunctorCode AcceptEnd(
Functor &functor)
override;
112 FunctorCode AcceptEnd(
ConstFunctor &functor)
const override;
125 bool m_isAccidImplicit;
129 ChordMode m_chordMode;
131 InputMode m_inputMode;
137 std::stack<LayerElement *> m_container;
This class models the MEI <accid> element.
Definition: accid.h:41
This class stores an alignment position elements will point to.
Definition: horizontalaligner.h:77
This abstract class is the base class for all const functors.
Definition: functor.h:126
This class implements a curor for the editor.
Definition: cursor.h:27
bool IsCursor() const override
Flag indicator if or Cursor instance.
Definition: cursor.h:46
void Reset() override
Virtual reset method.
FunctorCode Accept(Functor &functor) override
Interface for class functor visitation.
void CloneReset() override
Overriding CloneReset() method to be called after copy / assignment calls.
Object * Clone() const override
Method call for copying child classes.
Definition: cursor.h:36
This abstract class is the base class for all mutable functors.
Definition: functor.h:101
This class is a base class for the Layer (<layer>) content.
Definition: layerelement.h:51
This class models the MEI <note> element.
Definition: note.h:69
This class represents a basic object.
Definition: object.h:66