source: src/UIElements/Menu/TextMenu/MenuItem.hpp@ 2d50a2

Last change on this file since 2d50a2 was 56f73b, checked in by Frederik Heber <heber@…>, 15 years ago

Added config.h also to all header files, code check test ascertain this in the future.

  • as we want to use config.h to pass stuff such as MEMDEBUG, NDEBUG, LOG_OBSERVER, we have to make sure that it is present in each and every file.
  • split up CodeChecks/testsuite.at: each test has its own .at file.
  • Property mode set to 100644
File size: 831 bytes
RevLine 
[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]18class 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]25class MenuItem {
26public:
[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
[f9352d]41 virtual bool isActive();
42
43private:
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.