karbon

VCommand Class Referenceabstract

#include <vcommand.h>

Inheritance diagram for VCommand:
VVisitor VDeleteCmd VDistributeCmd VReplacingCmd VZOrderCmd

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()

VCommand::VCommand ( VDocument * doc,
const TQString & name,
const TQString & icon = "14_action" )
inline

Constructs a new command.

Parameters
docthe document the command should work on
namethe name of the command (appears in command history)
iconthe icon of the command (appears in command history)

Definition at line 51 of file vcommand.h.

◆ ~VCommand()

virtual VCommand::~VCommand ( )
inlinevirtual

Destroys the command.

Definition at line 60 of file vcommand.h.

Member Function Documentation

◆ changesSelection()

virtual bool VCommand::changesSelection ( ) const
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()

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.

◆ execute()

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 VDeleteCmd, VDistributeCmd, VReplacingCmd, and VZOrderCmd.

◆ icon()

TQString VCommand::icon ( ) const
inline

Returns the icon of the command.

Returns
the command icon

Definition at line 111 of file vcommand.h.

◆ name()

TQString VCommand::name ( ) const
inline

Returns the name of the command.

Returns
the command name

Definition at line 91 of file vcommand.h.

◆ setName()

void VCommand::setName ( const TQString & name)
inline

Sets the name of the command.

Parameters
namethe new command name

Definition at line 101 of file vcommand.h.

◆ unexecute()

virtual void VCommand::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: