Mercurial > hg > svcore
diff base/Command.h @ 17:2fb933f88604
* Update some copyright notice dates
* Add commands for basic editing operations in time-instants and time-value layers
author | Chris Cannam |
---|---|
date | Tue, 31 Jan 2006 15:57:25 +0000 |
parents | cc98d496d52b |
children | bac8b14ab355 |
line wrap: on
line diff
--- a/base/Command.h Mon Jan 30 17:51:56 2006 +0000 +++ b/base/Command.h Tue Jan 31 15:57:25 2006 +0000 @@ -10,12 +10,38 @@ #ifndef _COMMAND_H_ #define _COMMAND_H_ +#include <QString> +#include <vector> + class Command { public: + virtual ~Command() { } + virtual void execute() = 0; virtual void unexecute() = 0; - virtual QString name() const = 0; + virtual QString getName() const = 0; +}; + +class MacroCommand : public Command +{ +public: + MacroCommand(QString name); + virtual ~MacroCommand(); + + virtual void addCommand(Command *command); + virtual void deleteCommand(Command *command); + virtual bool haveCommands() const { return !m_commands.empty(); } + + virtual void execute(); + virtual void unexecute(); + + virtual QString getName() const { return m_name; } + virtual void setName(QString name) { m_name = name; } + +protected: + QString m_name; + std::vector<Command *> m_commands; }; #endif