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);
43 #ifndef NO_EDIT_SUPPORT
48 bool Chain(jsonxx::Array actions);
49 bool ParseContextAction(jsonxx::Object param, std::string &elementId,
bool &scores,
bool §ions);
50 bool ParseDeleteAction(jsonxx::Object param, std::string &elementId);
51 bool ParseDragAction(jsonxx::Object param, std::string &elementId,
int &x,
int &y);
52 bool ParseKeyDownAction(jsonxx::Object param, std::string &elementid,
int &key,
bool &shiftKey,
bool &ctrlKey);
53 bool ParseInsertAction(
54 jsonxx::Object param, std::string &elementName, std::string &elementId, std::string &insertMode);
55 bool ParseInsertControlAction(
56 jsonxx::Object param, std::string &elementName, std::string &startId, std::string &endId);
57 bool ParseNavigate(jsonxx::Object param, std::string &elementId,
int &direction);
58 bool ParsePropertiesAction(jsonxx::Object param, std::string &scoreDef);
59 bool ParseSetAction(jsonxx::Object param, std::string &elementId, std::string &attribute, std::string &value);
64 std::string GetCurrentState();
65 bool ReloadState(
const std::string &data);
66 void TrimUndoMemory();
77 bool Drag(std::string &elementId,
int x,
int y);
78 bool InsertControl(
const std::string &elementName,
const std::string startId,
const std::string endId);
79 bool KeyDown(std::string &elementId,
int key,
bool shiftKey,
bool ctrlKey);
80 bool Navigate(std::string &elementId,
const int &direction);
81 bool Set(std::string &elementId, std::string
const &attribute, std::string
const &value);
85 bool ContextForElement(std::string &elementId);
86 bool ContextForScores(
bool editInfo);
87 bool ContextForSections(
bool editInfo);
90 bool SetScoreDef(
const std::string scoreDef);
92 void ContextForObject(
const Object *
object, jsonxx::Object &element,
bool recursive =
false);
93 void ContextForObjects(
const ArrayOfConstObjects &objects, jsonxx::Array &siblings);
94 void ContextForReferences(
const ListOfObjectAttNamePairs &objects, jsonxx::Array &links);
96 ArrayOfConstObjects GetScoreBasedChildrenFor(
const Object *
object);
98 void CollectReferringObjects(
99 const Object *element, std::set<std::string> &toDelete, std::set<const Object *> &visited);
105 std::deque<std::string> m_undoStack;
106 std::deque<std::string> m_redoStack;
107 size_t m_undoMemoryUsage = 0;
131 void Reset()
override;
132 std::string GetClassName()
const override {
return m_className; }
148 return vrv_cast<VisibilityDrawingInterface *>(
this);
150 const VisibilityDrawingInterface *GetVisibilityDrawingInterface()
const override
152 return vrv_cast<const VisibilityDrawingInterface *>(
this);
156 ArrayOfConstObjects GetChildObjects()
const;
161 std::string m_className;
162 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:121
bool IsSupportedChild(ClassId classId) override
Base method for checking if a child can be added.
Definition: editortoolkit_shared.h:139
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