Last change
on this file since cbc639 was aa117c, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
Added possibility to add default Items to textMenus
|
-
Property mode
set to
100644
|
File size:
745 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * MenuItem.h
|
---|
3 | *
|
---|
4 | * Created on: Dec 10, 2009
|
---|
5 | * Author: crueger
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef MENUITEM_H_
|
---|
9 | #define MENUITEM_H_
|
---|
10 |
|
---|
11 | #include <string>
|
---|
12 |
|
---|
13 | using namespace std;
|
---|
14 |
|
---|
15 | class Menu;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Base class for all kinds of MenuItems
|
---|
19 | *
|
---|
20 | * This class takes care of checking the triggers and performing appropriate actions.
|
---|
21 | */
|
---|
22 | class MenuItem {
|
---|
23 | private:
|
---|
24 | char trigger;
|
---|
25 | string *description;
|
---|
26 | bool added;
|
---|
27 |
|
---|
28 | public:
|
---|
29 | MenuItem(char,const char*,Menu*);
|
---|
30 | virtual ~MenuItem();
|
---|
31 |
|
---|
32 | virtual void doTrigger()=0;
|
---|
33 | virtual bool checkTrigger(char);
|
---|
34 |
|
---|
35 | virtual const string formatEntry();
|
---|
36 |
|
---|
37 | virtual const string getDescription();
|
---|
38 | char getTrigger();
|
---|
39 |
|
---|
40 | void add_to_menu(Menu*);
|
---|
41 | bool wasAdded();
|
---|
42 |
|
---|
43 | protected:
|
---|
44 | void setDescription(string);
|
---|
45 | };
|
---|
46 |
|
---|
47 | #endif /* MENUITEM_H_ */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.