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