8 #ifndef __VRV_EDITOR_TOOLKIT_CMN_H__
9 #define __VRV_EDITOR_TOOLKIT_CMN_H__
19 #include "editortoolkit.h"
26 class EditorTreeObject;
40 bool ParseEditorAction(
const std::string &json_editorAction,
bool commitOnly =
false);
44 #ifndef NO_EDIT_SUPPORT
49 bool Chain(jsonxx::Array actions);
50 bool ParseContextAction(jsonxx::Object param, std::string &elementId,
bool &scores,
bool §ions);
51 bool ParseDeleteAction(jsonxx::Object param, std::string &elementId);
52 bool ParseDragAction(jsonxx::Object param, std::string &elementId,
int &x,
int &y);
53 bool ParseKeyDownAction(jsonxx::Object param, std::string &elementid,
int &key,
bool &shiftKey,
bool &ctrlKey);
54 bool ParseInsertAction(jsonxx::Object param, std::string &elementType, std::string &startid, std::string &endid);
55 bool ParseSetAction(jsonxx::Object param, std::string &elementId, std::string &attribute, std::string &value);
59 std::string GetCurrentState();
60 bool ReloadState(
const std::string &data);
61 void TrimUndoMemory();
72 bool Drag(std::string &elementId,
int x,
int y);
73 bool KeyDown(std::string &elementId,
int key,
bool shiftKey,
bool ctrlKey);
74 bool Insert(std::string &elementType, std::string
const &startid, std::string
const &endid);
75 bool Insert(std::string &elementType, std::string
const &startid);
76 bool Set(std::string &elementId, std::string
const &attribute, std::string
const &value);
79 bool InsertNote(
Object *
object);
81 bool DeleteNote(
Note *note);
84 bool ContextForElement(std::string &elementId);
85 bool ContextForScores(
bool editInfo);
86 bool ContextForSections(
bool editInfo);
88 Object *GetElement(std::string &elementId);
90 void ContextForObject(
const Object *
object, jsonxx::Object &element,
bool recursive =
false);
91 void ContextForObjects(
const ArrayOfConstObjects &objects, jsonxx::Array &siblings);
92 void ContextForReferences(
const ListOfObjectAttNamePairs &objects, jsonxx::Array &links);
94 ArrayOfConstObjects GetScoreBasedChildrenFor(
const Object *
object);
99 std::string m_chainedId;
102 std::deque<std::string> m_undoStack;
103 std::deque<std::string> m_redoStack;
104 size_t m_undoMemoryUsage = 0;
128 void Reset()
override;
129 std::string GetClassName()
const override {
return m_className; }
145 return vrv_cast<VisibilityDrawingInterface *>(
this);
147 const VisibilityDrawingInterface *GetVisibilityDrawingInterface()
const override
149 return vrv_cast<const VisibilityDrawingInterface *>(
this);
153 ArrayOfConstObjects GetChildObjects()
const;
158 std::string m_className;
159 const Object *m_object;
This class is a hold the data and corresponds to the model of a MVC design pattern.
Definition: doc.h:41
This class stores an alignment position elements will point to.
Definition: editortoolkit_cmn.h:118
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
Definition: editortoolkit_cmn.h:136
This class models the MEI <note> element.
Definition: note.h:67
This class represents a basic object.
Definition: object.h:62
This class is a drawing context and corresponds to the view of a MVC design pattern.
Definition: view.h:106
This class is an interface for MEI element that can be hidden during drawing.
Definition: drawinginterface.h:422