source: molecuilder/src/Menu/MenuItem.hpp@ 3896fc

Last change on this file since 3896fc 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
RevLine 
[d20ed5]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
13using namespace std;
14
15class Menu;
16
[da09909]17/**
18 * Base class for all kinds of MenuItems
19 *
20 * This class takes care of checking the triggers and performing appropriate actions.
21 */
[d20ed5]22class MenuItem {
23private:
24 char trigger;
25 string *description;
[7cb300]26 bool added;
[d20ed5]27
28public:
29 MenuItem(char,const char*,Menu*);
30 virtual ~MenuItem();
31
32 virtual void doTrigger()=0;
[aa117c]33 virtual bool checkTrigger(char);
[d20ed5]34
35 virtual const string formatEntry();
36
37 virtual const string getDescription();
38 char getTrigger();
39
[7cb300]40 void add_to_menu(Menu*);
41 bool wasAdded();
42
[d20ed5]43protected:
44 void setDescription(string);
45};
46
47#endif /* MENUITEM_H_ */
Note: See TracBrowser for help on using the repository browser.