Command to add or remove a series of events to or from an editable, with undo. More...

#include <EventCommands.h>

Inheritance diagram for ChangeEventsCommand:
Inheritance graph
Collaboration diagram for ChangeEventsCommand:
Collaboration graph

Public Member Functions

 ChangeEventsCommand (int editableId, QString name)
 
void add (Event e)
 
void remove (Event e)
 
void addCommand (Command *command) override
 Stack an arbitrary other command in the same sequence. More...
 
ChangeEventsCommandfinish ()
 If any points have been added or deleted, return this command (so the caller can add it to the command history). More...
 
virtual void deleteCommand (Command *command)
 
virtual bool haveCommands () const
 
void execute () override
 
void unexecute () override
 
QString getName () const override
 
virtual void setName (QString name)
 

Protected Member Functions

virtual void addCommand (Command *command, bool executeFirst)
 

Protected Attributes

int m_editableId
 
QString m_name
 
std::vector< Command * > m_commands
 

Detailed Description

Command to add or remove a series of events to or from an editable, with undo.

Creates and immediately executes a sub-command for each add/remove requested. Consecutive add/remove pairs for the same point are collapsed. The id must be that of a type that can be retrieved from the AnyById store and dynamic_cast to EventEditable.

Definition at line 115 of file EventCommands.h.

Constructor & Destructor Documentation

ChangeEventsCommand::ChangeEventsCommand ( int  editableId,
QString  name 
)
inline

Definition at line 118 of file EventCommands.h.

Member Function Documentation

void ChangeEventsCommand::add ( Event  e)
inline

Definition at line 121 of file EventCommands.h.

void ChangeEventsCommand::remove ( Event  e)
inline

Definition at line 124 of file EventCommands.h.

void ChangeEventsCommand::addCommand ( Command command)
inlineoverridevirtual

Stack an arbitrary other command in the same sequence.

Reimplemented from MacroCommand.

Definition at line 131 of file EventCommands.h.

References addCommand().

Referenced by addCommand().

ChangeEventsCommand* ChangeEventsCommand::finish ( )
inline

If any points have been added or deleted, return this command (so the caller can add it to the command history).

Otherwise delete the command and return NULL.

Definition at line 138 of file EventCommands.h.

virtual void ChangeEventsCommand::addCommand ( Command command,
bool  executeFirst 
)
inlineprotectedvirtual
void MacroCommand::deleteCommand ( Command command)
virtualinherited

Definition at line 38 of file Command.cpp.

References MacroCommand::m_commands.

bool MacroCommand::haveCommands ( ) const
virtualinherited

Definition at line 52 of file Command.cpp.

References MacroCommand::m_commands.

void MacroCommand::execute ( )
overridevirtualinherited

Implements Command.

Definition at line 58 of file Command.cpp.

References MacroCommand::m_commands.

void MacroCommand::unexecute ( )
overridevirtualinherited

Implements Command.

Definition at line 66 of file Command.cpp.

References MacroCommand::m_commands.

QString MacroCommand::getName ( ) const
overridevirtualinherited

Implements Command.

Reimplemented in BundleCommand.

Definition at line 74 of file Command.cpp.

References MacroCommand::m_name.

void MacroCommand::setName ( QString  name)
virtualinherited

Definition at line 80 of file Command.cpp.

References MacroCommand::m_name.

Member Data Documentation

int ChangeEventsCommand::m_editableId
protected

Definition at line 171 of file EventCommands.h.

QString MacroCommand::m_name
protectedinherited

Definition at line 103 of file Command.h.

Referenced by MacroCommand::getName(), BundleCommand::getName(), and MacroCommand::setName().


The documentation for this class was generated from the following file: