Verovio
Source code documentation
vrv::EditorToolkitShared Class Reference
Inheritance diagram for vrv::EditorToolkitShared:
vrv::EditorToolkit vrv::EditorToolkitCMN vrv::EditorToolkitMensural

Classes

struct  State
 

Public Member Functions

 EditorToolkitShared (Doc *doc, View *view)
 
bool ParseEditorAction (const std::string &json_editorAction) override
 In child classes, this parses the provided editor action and then performs the correct action.
 
bool ParseEditorAction (const std::string &json_editorAction, bool commitOnly=false)
 
- Public Member Functions inherited from vrv::EditorToolkit
 EditorToolkit (Doc *doc, View *view)
 
virtual std::string EditStatus ()
 Get status of the editor (undo, selection, etc.)
 
virtual std::string EditResponse ()
 Get response on the last editor function used.
 
void OptionsChanged ()
 Increase the option change count.
 

Protected Types

enum  SelectCustom : int8_t { SELECT_NONE = 0 , SELECT_NOTE , SELECT_TEXT_PARENT }
 
enum  DeleteNavigation : int8_t { DELETE_NO_NAVIGATON = 0 , DELETE_BACKSPACE , DELETE_FORWARD }
 

Protected Member Functions

void SetEditStatus ()
 
void ReloadEditStatus (const std::string &statusStr, bool insertMode)
 
void PrepareUndo (bool ignoreInsertMode=false)
 
std::string GetCurrentState ()
 
bool ReloadState (const State &state)
 
void TrimUndoMemory ()
 
bool CanUndo () const
 
bool CanRedo () const
 
bool Undo ()
 
bool Redo ()
 
void ClearContext ()
 
bool ContextForElement (std::string &elementId)
 
bool ContextForScores (bool updateResponse)
 
bool ContextForSections (bool updateResponse)
 
bool GetScoreDef ()
 
bool SetScoreDef (const std::string scoreDef)
 
void ContextForObject (const Object *object, jsonxx::Object &element, bool recursive=false)
 
void ContextForObjects (const ArrayOfConstObjects &objects, jsonxx::Array &siblings)
 
void ContextForReferences (const ListOfObjectAttNamePairs &objects, jsonxx::Array &links)
 
ArrayOfConstObjects GetScoreBasedChildrenFor (const Object *object)
 
void CollectReferringObjects (const Object *element, std::set< std::string > &toDelete, std::set< const Object * > &visited)
 
void PostProcessDeleteObjects (const Object *element, std::set< std::string > &toPostProcess)
 
void PostProcessDelete (const std::string &elementId)
 
void PostEditRestriction (Object *element)
 
void MoveCursor (LayerElement *element, bool maintainChordMode=false)
 
data_ACCIDENTAL_WRITTEN GetAccidBefore (const LayerElement *element, data_PITCHNAME pname, int oct)
 
std::pair< data_ACCIDENTAL_WRITTEN, bool > GetActualAccid (Object *element, data_ACCIDENTAL_WRITTEN accid)
 
const MeasureGetPreviousMeasure (const Measure *measure)
 
const StaffGetPreviousStaff (const Staff *staff)
 
const LayerGetPreviousLayer (const Layer *layer)
 
const MeasureGetNextMeasure (const Measure *measure)
 
const StaffGetNextStaff (const Staff *staff)
 
const LayerGetNextLayer (const Layer *layer)
 
bool Chain (const jsonxx::Array &actions)
 Parse JSON instructions for experimental editor functions.
 
bool ParseContextAction (const jsonxx::Object &param, std::string &elementId, bool &scores, bool &sections)
 
bool ParseDeleteAction (const jsonxx::Object &param, std::string &elementId, DeleteNavigation &navigation)
 
bool ParseDragAction (const jsonxx::Object &param, std::string &elementId, int &x, int &y)
 
bool ParseKeyDownAction (const jsonxx::Object &param, std::string &elementid, int &key, bool &shiftKey, bool &ctrlKey)
 
bool ParseInsertAction (const jsonxx::Object &param, std::string &elementName, std::string &elementId, std::string &insertMode)
 
bool ParseInsertControlAction (const jsonxx::Object &param, std::string &elementName, std::string &startId, std::string &endId)
 
bool ParseNavigate (const jsonxx::Object &param, std::string &elementId, int &direction)
 
bool ParsePropertiesAction (const jsonxx::Object &param, std::string &scoreDef)
 
bool ParseResetCursorAction (const jsonxx::Object &param, bool &maintainChordMode)
 
bool ParseSelectAction (const jsonxx::Object &param, std::string &elementId, bool &secondary, SelectCustom &custom)
 
bool ParseSetAction (const jsonxx::Object &param, std::string &elementId, std::string &attribute, std::string &value)
 
bool ParseSetCursorAction (const jsonxx::Object &param, std::string &elementId, Cursor::InputMode &inputMode, bool &chordMode)
 
bool ParseUpdateCursorAction (const jsonxx::Object &param, bool &restMode, bool &chordMode, Cursor::TieMode &tieMode)
 
bool ParseUpdatePitchAction (const jsonxx::Object &param, std::string &elementId, data_PITCHNAME &pname, int &oct, data_ACCIDENTAL_WRITTEN &accid, int &midi)
 
bool SetCursor (std::string &elementId, Cursor::InputMode inputMode, bool chordMode)
 Experimental editor functions.
 
bool UpdateCursor (bool restMode, bool chordMode, Cursor::TieMode tieMode)
 
bool ResetCursor (bool maintainChordMode)
 
bool Delete (std::string &elementId, DeleteNavigation navigation)
 
bool Drag (std::string &elementId, int x, int y)
 
bool InsertControl (std::string &elementName, std::string &startId, std::string &endId)
 
bool KeyDown (std::string &elementId, int key, bool shiftKey, bool ctrlKey)
 
bool Navigate (std::string &elementId, const int &direction)
 
bool Select (std::string &elementId, bool secondary, SelectCustom custom)
 
bool Set (std::string &elementId, const std::string &attribute, const std::string &value)
 
bool UpdatePitch (std::string &elementId, data_PITCHNAME pname, int oct, data_ACCIDENTAL_WRITTEN accid, int midi)
 
- Protected Member Functions inherited from vrv::EditorToolkit
void ResetSelect ()
 
bool AppendChild (std::string &elementId, const std::string &elementName, bool unique)
 
bool InsertBefore (std::string &elementId, const std::string &elementName)
 
bool InsertAfter (std::string &elementId, const std::string &elementName)
 
ObjectGetElement (const std::string &elementId)
 
ObjectPrepareInsertion (Object *parent, const std::string &elementName)
 
ObjectResolveElement (std::string &elementId, bool chain=true)
 
bool InsertMode () const
 

Protected Attributes

bool m_undoPrepared
 
std::deque< Statem_undoStack
 
std::deque< Statem_redoStack
 
size_t m_undoMemoryUsage = 0
 
EditorTreeObjectm_scoreContext
 
EditorTreeObjectm_sectionContext
 
EditorTreeObjectm_currentContext
 
- Protected Attributes inherited from vrv::EditorToolkit
std::string m_chainedId
 
std::string m_selectionId
 
ClassId m_selectionClassId
 
std::string m_selectionSecondaryId
 
Cursorm_cursor
 
Docm_doc
 
Viewm_view
 
jsonxx::Object m_editStatus
 
jsonxx::Object m_editResponse
 
int m_options
 Record option changes

 

The documentation for this class was generated from the following file: