karbon
VCommand Class Reference
#include <vcommand.h>
Inheritance diagram for VCommand:

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.
Public Member Functions | |
VCommand (VDocument *doc, const QString &name, const QString &icon="14_action") | |
virtual | ~VCommand () |
virtual void | execute ()=0 |
virtual void | unexecute () |
virtual bool | changesSelection () const |
QString | name () const |
void | setName (const QString &name) |
QString | icon () const |
VDocument * | document () const |
Constructor & Destructor Documentation
VCommand::VCommand | ( | VDocument * | doc, | |
const QString & | name, | |||
const QString & | icon = "14_action" | |||
) | [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.
virtual VCommand::~VCommand | ( | ) | [inline, virtual] |
Member Function Documentation
virtual void VCommand::execute | ( | ) | [pure virtual] |
Executes the command.
All the changes to the document are done here. All commands have to implement this function.
Implemented in VAlignCmd, VBooleanCmd, VCleanUpCmd, VClipartCmd, VDeleteCmd, VDeleteNodeCmd, VDistributeCmd, VFillCmd, VGroupCmd, VInsertCmd, VLayerCmd, VReplacingCmd, VShapeCmd, VStrokeCmd, VTransformCmd, VTranslateBezierCmd, VTranslatePointCmd, VUnGroupCmd, VZOrderCmd, VImageTool::VInsertImageCmd, and VCreateShadowCmd.
virtual void VCommand::unexecute | ( | ) | [inline, virtual] |
Unexecutes the command.
All changes to the document have to be undone here.
Reimplemented in VAlignCmd, VBooleanCmd, VCleanUpCmd, VClipartCmd, VDeleteCmd, VDeleteNodeCmd, VDistributeCmd, VFillCmd, VGroupCmd, VInsertCmd, VLayerCmd, VReplacingCmd, VShapeCmd, VStrokeCmd, VTransformCmd, VTranslateBezierCmd, VTranslatePointCmd, VUnGroupCmd, VZOrderCmd, VImageTool::VInsertImageCmd, and VCreateShadowCmd.
Definition at line 75 of file vcommand.h.
virtual bool VCommand::changesSelection | ( | ) | const [inline, virtual] |
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 VClipartCmd, VDeleteCmd, VDistributeCmd, VFillCmd, VShapeCmd, VStrokeCmd, VImageTool::VInsertImageCmd, VCreateShadowCmd, and VWhirlPinchCmd.
Definition at line 84 of file vcommand.h.
QString VCommand::name | ( | ) | const [inline] |
void VCommand::setName | ( | const QString & | name | ) | [inline] |
Sets the name of the command.
- Parameters:
-
name the new command name
Definition at line 101 of file vcommand.h.
QString VCommand::icon | ( | ) | const [inline] |
Returns the icon of the command.
- Returns:
- the command icon
Definition at line 111 of file vcommand.h.
VDocument* VCommand::document | ( | ) | const [inline] |
Returns the document the command works on.
- Returns:
- the command's document
Definition at line 121 of file vcommand.h.
The documentation for this class was generated from the following file: