Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
// menuentry.h |
| 2 |
// |
| 3 |
// (c) Robert Schuster, 2007 |
| 4 |
// |
| 5 |
// Licensed under GNU GPL version 2 or, at your option, any later version. |
| 6 |
|
| 7 |
#ifndef MENUENTRY_H |
| 8 |
#define MENUENTRY_H |
| 9 |
|
| 10 |
#include "guichan/guichan.hpp" |
| 11 |
|
| 12 |
class MenuSystem; |
| 13 |
|
| 14 |
class MenuEntry |
| 15 |
{ |
| 16 |
protected: |
| 17 |
gcn::Widget *widget; |
| 18 |
|
| 19 |
MenuSystem *menuSystem; |
| 20 |
|
| 21 |
MenuEntry(gcn::Widget *); |
| 22 |
|
| 23 |
public: |
| 24 |
virtual ~MenuEntry(); |
| 25 |
|
| 26 |
void registered(MenuSystem *); |
| 27 |
|
| 28 |
gcn::Widget *getWidget() const { return widget; } |
| 29 |
|
| 30 |
virtual void invoke() = 0; |
| 31 |
|
| 32 |
virtual void next() { }; |
| 33 |
|
| 34 |
virtual void previous() { }; |
| 35 |
|
| 36 |
/** Returns true if some operation was cancelled or false if not. |
| 37 |
* |
| 38 |
* This is neccessary for the menu to know whether it should go |
| 39 |
* on level up or not. |
| 40 |
*/ |
| 41 |
virtual bool cancel() { return false; } |
| 42 |
|
| 43 |
/** |
| 44 |
* Puts the underlying attribute to its default value. |
| 45 |
* |
| 46 |
* Needs only be implemented by entries that support this. |
| 47 |
*/ |
| 48 |
virtual void reset() { }; |
| 49 |
|
| 50 |
}; |
| 51 |
|
| 52 |
#endif |