8 #ifndef __VRV_EDITOR_TOOLKIT_SHARED_H__
9 #define __VRV_EDITOR_TOOLKIT_SHARED_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(
55 jsonxx::Object param, std::string &elementName, std::string &elementId, std::string &insertMode);
56 bool ParseSetAction(jsonxx::Object param, std::string &elementId, std::string &attribute, std::string &value);
61 std::string GetCurrentState();
62 bool ReloadState(
const std::string &data);
63 void TrimUndoMemory();
74 bool Drag(std::string &elementId,
int x,
int y);
75 bool KeyDown(std::string &elementId,
int key,
bool shiftKey,
bool ctrlKey);
76 bool Set(std::string &elementId, std::string
const &attribute, std::string
const &value);
80 bool ContextForElement(std::string &elementId);
81 bool ContextForScores(
bool editInfo);
82 bool ContextForSections(
bool editInfo);
84 Object *GetChainedElement(std::string &elementId);
86 void ContextForObject(
const Object *
object, jsonxx::Object &element,
bool recursive =
false);
87 void ContextForObjects(
const ArrayOfConstObjects &objects, jsonxx::Array &siblings);
88 void ContextForReferences(
const ListOfObjectAttNamePairs &objects, jsonxx::Array &links);
90 ArrayOfConstObjects GetScoreBasedChildrenFor(
const Object *
object);
95 std::string m_chainedId;
98 std::deque<std::string> m_undoStack;
99 std::deque<std::string> m_redoStack;
100 size_t m_undoMemoryUsage = 0;
124 void Reset()
override;
125 std::string GetClassName()
const override {
return m_className; }
141 return vrv_cast<VisibilityDrawingInterface *>(
this);
143 const VisibilityDrawingInterface *GetVisibilityDrawingInterface()
const override
145 return vrv_cast<const VisibilityDrawingInterface *>(
this);
149 ArrayOfConstObjects GetChildObjects()
const;
154 std::string m_className;
155 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_shared.h:114
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
Definition: editortoolkit_shared.h:132
This class represents a basic object.
Definition: object.h:64
This class is a drawing context and corresponds to the view of a MVC design pattern.
Definition: view.h:107
This class is an interface for MEI element that can be hidden during drawing.
Definition: drawinginterface.h:448