Debian Codegraph @

src/ui/menu.h

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 // menu.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 MENU_H
8 #define MENU_H
9
10 #include <vector>
11
12 #include "guichan/guichan.hpp"
13
14 class MenuSystem;
15 class MenuEntry;
16 class MenuAction;
17
18 class Menu
19 {
20 public:
21 enum Id
22 {
23 NONE, MAIN, SINGLEPLAYER, MULTIPLAYER, OPTIONS, AUDIO_OPTIONS, VIDEO_OPTIONS,
24 CONTROL_OPTIONS
25 };
26
27 private:
28
29 Id parentMenuId;
30
31 gcn::Container *container;
32
33 int selected;
34
35 gcn::Label *title;
36
37 std::vector < MenuEntry * > *entries;
38
39 MenuSystem *menuSystem;
40
41 int locx;
42
43 public:
44 Menu(Id, std::string, int = 0);
45
46 ~Menu();
47
48 void addEntry(MenuEntry *);
49
50 void addAction(std::string, MenuAction *);
51
52 void addLink(std::string, Menu::Id);
53
54 void addBackLink();
55
56 void registered(MenuSystem *);
57
58 /** Unconditionally make this menu visible.
59 */
60 void enter();
61
62 /** Unconditionally make this menu invisible.
63 */
64 void leave();
65
66 gcn::Container *getContainer() const;
67
68 void resize(int, int);
69
70 void up();
71
72 void down();
73
74 /** Cancels the operation of the currently selected widget. If there
75 * was no operation activate the parent menu.
76 */
77 void cancel();
78
79 void invoke();
80
81 void next();
82
83 void previous();
84
85 void reset();
86
87 };
88
89 #endif