Name

GroveBatchCommand — The class for binding several commands into a single command.

Synopsis

class GroveBatchCommand : public GroveCommandSernaApi::GroveCommand {
public:
  // construct/copy/destruct
  GroveBatchCommand();
  ~GroveBatchCommand();

  // public member functions

  GrovePos pos() const;
  void setFlags(CommandFlags) ;
  CommandFlags flags() const;
  bool executeAndAdd(const Command &, bool = true) ;
  void setValidationContext(const GroveNode &) ;
  GroveNode validationContext() const;
  void setSuggestedPos(const GrovePos &) ;
  void setInfo(const SString &) ;
};

Description

Batch command allows to combine multiple commands returned by the GroveEditor so they will look as a single command in the Undo/Redo list. Use appendChild() function to add commands. Note that BatchCommands CANNOT be nested.

GroveBatchCommand construct/copy/destruct

  1. GroveBatchCommand();


  2. ~GroveBatchCommand();


GroveBatchCommand public member functions

  1. GrovePos pos() const;

    Returns suggested cursor position after command execution.


  2. void setFlags(CommandFlags f) ;

    Sets command flags as above.


  3. CommandFlags flags() const;

    Returns command flags.


  4. bool executeAndAdd(const Command & command, bool refuseNull = true) ;

    Executes command and adds to BatchCommand. If command execution fails, then FALSE is returned.


  5. void setValidationContext(const GroveNode & node) ;

    Explicitly sets new validation context. By default it uses context from the last child command.


  6. GroveNode validationContext() const;

    Returns validation context for this command (root of the subtree which should be re-validated after command execution)


  7. void setSuggestedPos(const GrovePos & pos) ;

    Explicitly sets cursor position after command execution.


  8. void setInfo(const SString & s) ;

    Set batch command info string.