Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
16:cc98d496d52b | 17:2fb933f88604 |
---|---|
8 */ | 8 */ |
9 | 9 |
10 #ifndef _COMMAND_H_ | 10 #ifndef _COMMAND_H_ |
11 #define _COMMAND_H_ | 11 #define _COMMAND_H_ |
12 | 12 |
13 #include <QString> | |
14 #include <vector> | |
15 | |
13 class Command | 16 class Command |
14 { | 17 { |
15 public: | 18 public: |
19 virtual ~Command() { } | |
20 | |
16 virtual void execute() = 0; | 21 virtual void execute() = 0; |
17 virtual void unexecute() = 0; | 22 virtual void unexecute() = 0; |
18 virtual QString name() const = 0; | 23 virtual QString getName() const = 0; |
24 }; | |
25 | |
26 class MacroCommand : public Command | |
27 { | |
28 public: | |
29 MacroCommand(QString name); | |
30 virtual ~MacroCommand(); | |
31 | |
32 virtual void addCommand(Command *command); | |
33 virtual void deleteCommand(Command *command); | |
34 virtual bool haveCommands() const { return !m_commands.empty(); } | |
35 | |
36 virtual void execute(); | |
37 virtual void unexecute(); | |
38 | |
39 virtual QString getName() const { return m_name; } | |
40 virtual void setName(QString name) { m_name = name; } | |
41 | |
42 protected: | |
43 QString m_name; | |
44 std::vector<Command *> m_commands; | |
19 }; | 45 }; |
20 | 46 |
21 #endif | 47 #endif |
22 | 48 |