Name

Command — The base class for the actions performed on the document.

Synopsis

class Command (RefCountedWrappedObjectSernaApi::RefCountedWrappedObject) :
  # construct/copy/destruct
  __init__()
  __init__(SernaApiBase *)
  __del__()

  # public member functions

  None execute() 
  None unexecute() 
  bool isExecuted() const
  SString info(unsigned int) const
  unsigned short getUdata() const
  None setUdata(unsigned) 
  GroveCommand asGroveCommand() const
  Command firstChild() const
  Command lastChild() const
  Command getChild(int) const
  int countChildren() const
  None appendChild(const Command &) 
  None removeAllChildren() 
  Command nextSibling() const
  Command prevSibling() const
  Command parent() const
  Command root() const
  None remove() 
  None insertBefore(const Command &) 
  None insertAfter(const Command &) 
  None removeGroup(const Command &) 
  int siblingIndex() const
  SString getTreelocString(const Command & = Command()) const
  Command getByTreelocString(const SString &) const
  None doExecute() 
  None doUnexecute() 

Description

Command construct/copy/destruct

  1. __init__()

    If constructed w/o args, then custom Command is created (user must redefine doExecute()/doUnexecute())


  2. __init__(SernaApiBase * )


  3. __del__()


Command public member functions

  1. None execute()

    Execute the command.


  2. None unexecute()

    Un-execute (undo) the command.


  3. bool isExecuted() const

    Returns TRUE if command is already executed.


  4. 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.


  5. unsigned short getUdata() const

    Get custom user data on the command.


  6. None setUdata(unsigned short)

    Set custom user data on the command.


  7. 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.


  8. Command firstChild() const


  9. Command lastChild() const


  10. Command getChild(int n) const


  11. int countChildren() const


  12. None appendChild(const Command & )


  13. None removeAllChildren()


  14. Command nextSibling() const


  15. Command prevSibling() const


  16. Command parent() const


  17. Command root() const


  18. None remove()


  19. None insertBefore(const Command & )


  20. None insertAfter(const Command & )


  21. None removeGroup(const Command & )


  22. int siblingIndex() const


  23. SString getTreelocString(const Command & = Command()) const


  24. Command getByTreelocString(const SString & ) const


  25. None doExecute()

    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.


  26. None doUnexecute()

    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.