Command — The base class for the actions performed on the document.
class Command : : public RefCountedWrappedObjectSernaApi::RefCountedWrappedObject { public: // construct/copy/destruct Command(); Command(SernaApiBase *); ~Command(); // public member functions void execute() ; void unexecute() ; bool isExecuted() const; SString info(unsigned int) const; unsigned short getUdata() const; void setUdata(unsigned) ; GroveCommand asGroveCommand() const; Command firstChild() const; Command lastChild() const; Command getChild(int) const; int countChildren() const; void appendChild(const Command &) ; void removeAllChildren() ; Command nextSibling() const; Command prevSibling() const; Command parent() const; Command root() const; void remove() ; void insertBefore(const Command &) ; void insertAfter(const Command &) ; void removeGroup(const Command &) ; int siblingIndex() const; SString getTreelocString(const Command & = Command()) const; Command getByTreelocString(const SString &) const; void doExecute() ; void doUnexecute() ; };
Command
public member functionsExecute the command.
Un-execute (undo) the command.
Returns TRUE if command is already executed.
SString info(unsigned int argIndex) const;
Additional command info, as seen in undo/redo list. For null value of argIndex the info string itself is returned; non-zero values are used to access optional arguments. When there is no argument for any given index, null string is returned.
Get custom user data on the command.
Set custom user data on the command.
GroveCommand asGroveCommand() const;
If the current command was created by the GroveEditor, it may be of GroveCommand type. GroveCommands contain some additional information such as current position, etc.
Command firstChild() const;
Command lastChild() const;
Command getChild(int n) const;
Command nextSibling() const;
Command prevSibling() const;
Command parent() const;
Command root() const;
SString getTreelocString(const Command & = Command()) const;
Command getByTreelocString(const SString & ) const;
Allows to redefine behaviour of original command. Used only when Command was constructed w/o arguments. THESE FUNCTIONS SHOULD NEVER BE CALLED DIRECTLY. USE execute() AND unexecute() INSTEAD.
Allows to redefine behaviour of original command. Used only when Command was constructed w/o arguments. THESE FUNCTIONS SHOULD NEVER BE CALLED DIRECTLY. USE execute() AND unexecute() INSTEAD.