#include <vcommand.h>
Public Member Functions | |
| VCommand (VDocument *doc, const TQString &name, const TQString &icon="14_action") | |
| virtual | ~VCommand () |
| virtual void | execute ()=0 |
| virtual void | unexecute () |
| virtual bool | changesSelection () const |
| TQString | name () const |
| void | setName (const TQString &name) |
| TQString | icon () const |
| VDocument * | document () const |
Public Member Functions inherited from VVisitor | |
| VVisitor () | |
| virtual bool | visit (VObject &object) |
| virtual void | visitVObject (VObject &object) |
| virtual void | visitVPath (VPath &composite) |
| virtual void | visitVDocument (VDocument &document) |
| virtual void | visitVGroup (VGroup &group) |
| virtual void | visitVLayer (VLayer &layer) |
| virtual void | visitVSubpath (VSubpath &path) |
| virtual void | visitVSelection (VSelection &selection) |
| virtual void | visitVText (VText &text) |
| virtual void | visitVImage (VImage &img) |
| bool | success () const |
Additional Inherited Members | |
Protected Member Functions inherited from VVisitor | |
| virtual | ~VVisitor () |
| void | setSuccess (bool success=true) |
Detailed Description
The base class for all karbon commands.
It basically defines the common interface that all commands should implement.
Definition at line 41 of file vcommand.h.
Constructor & Destructor Documentation
◆ VCommand()
|
inline |
Constructs a new command.
- Parameters
-
doc the document the command should work on name the name of the command (appears in command history) icon the icon of the command (appears in command history)
Definition at line 51 of file vcommand.h.
◆ ~VCommand()
|
inlinevirtual |
Destroys the command.
Definition at line 60 of file vcommand.h.
Member Function Documentation
◆ changesSelection()
|
inlinevirtual |
Returns if the command changes the actual document selection.
This flag is checked to determine if the document has to be redrawn.
- Returns
- true if the selection is changed, else false
Reimplemented in VDeleteCmd, and VDistributeCmd.
Definition at line 84 of file vcommand.h.
◆ document()
|
inline |
Returns the document the command works on.
- Returns
- the command's document
Definition at line 121 of file vcommand.h.
◆ execute()
|
pure virtual |
Executes the command.
All the changes to the document are done here. All commands have to implement this function.
Implemented in VDeleteCmd, VDistributeCmd, VReplacingCmd, and VZOrderCmd.
◆ icon()
|
inline |
◆ name()
|
inline |
◆ setName()
|
inline |
Sets the name of the command.
- Parameters
-
name the new command name
Definition at line 101 of file vcommand.h.
◆ unexecute()
|
inlinevirtual |
Unexecutes the command.
All changes to the document have to be undone here.
Reimplemented in VDeleteCmd, VDistributeCmd, VReplacingCmd, and VZOrderCmd.
Definition at line 75 of file vcommand.h.
The documentation for this class was generated from the following file:

Public Member Functions inherited from