source:
src/UIElements/Menu/TextMenu/MenuItem.hpp@
ef8667
| Last change on this file since ef8667 was 94232b, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 837 bytes | |
| Rev | Line | |
|---|---|---|
| [65b6e0] | 1 | /* |
| [56f73b] | 2 | * MenuItem.hpp |
| [65b6e0] | 3 | * |
| 4 | * Created on: Dec 10, 2009 | |
| 5 | * Author: crueger | |
| 6 | */ | |
| 7 | ||
| [56f73b] | 8 | #ifndef MENUITEM_HPP_ |
| 9 | #define MENUITEM_HPP_ | |
| 10 | ||
| 11 | // include config.h | |
| 12 | #ifdef HAVE_CONFIG_H | |
| 13 | #include <config.h> | |
| 14 | #endif | |
| [65b6e0] | 15 | |
| 16 | #include <string> | |
| 17 | ||
| [b59da6] | 18 | class TxMenu; |
| [65b6e0] | 19 | |
| [ef81b0] | 20 | /** |
| 21 | * Base class for all kinds of MenuItems | |
| 22 | * | |
| 23 | * This class takes care of checking the triggers and performing appropriate actions. | |
| 24 | */ | |
| [65b6e0] | 25 | class MenuItem { |
| 26 | public: | |
| [b59da6] | 27 | MenuItem(char,const std::string &,TxMenu* const); |
| [65b6e0] | 28 | virtual ~MenuItem(); |
| 29 | ||
| 30 | virtual void doTrigger()=0; | |
| [8f113e] | 31 | virtual bool checkTrigger(char); |
| [65b6e0] | 32 | |
| [b59da6] | 33 | virtual const std::string formatEntry(); |
| [65b6e0] | 34 | |
| [b59da6] | 35 | virtual const std::string getDescription(); |
| [65b6e0] | 36 | char getTrigger(); |
| 37 | ||
| [b59da6] | 38 | void add_to_menu(TxMenu* const); |
| [5b9bba] | 39 | bool wasAdded(); |
| 40 | ||
| [94232b] | 41 | virtual bool isActive() const; |
| [f9352d] | 42 | |
| 43 | private: | |
| 44 | char trigger; | |
| [b59da6] | 45 | const std::string description; |
| [f9352d] | 46 | bool added; |
| [65b6e0] | 47 | }; |
| 48 | ||
| [56f73b] | 49 | #endif /* MENUITEM_HPP_ */ |
Note:
See TracBrowser
for help on using the repository browser.
