supertux
menu_storage.hpp
1 // SuperTux
2 // Copyright (C) 2009 Ingo Ruhnke <grumbel@gmail.com>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_SUPERTUX_MENU_MENU_STORAGE_HPP
18 #define HEADER_SUPERTUX_SUPERTUX_MENU_MENU_STORAGE_HPP
19 
20 #include <memory>
21 
22 class JoystickMenu;
23 class KeyboardMenu;
24 class Menu;
25 class OptionsMenu;
26 class ProfileMenu;
27 
28 class MenuStorage final
29 {
30 private:
31  static MenuStorage* s_instance;
32 public:
33  static MenuStorage& instance();
34 
35 public:
36  enum MenuId {
37  NO_MENU,
38  MAIN_MENU,
39  OPTIONS_MENU,
40  INGAME_OPTIONS_MENU,
41  PROFILE_MENU,
42  WORLDSET_MENU,
43  CONTRIB_MENU,
44  CONTRIB_WORLD_MENU,
45  ADDON_MENU,
46  LANGPACK_MENU,
47  LANGPACK_AUTO_UPDATE_MENU,
48  LANGUAGE_MENU,
49  KEYBOARD_MENU,
50  JOYSTICK_MENU,
51  WORLDMAP_MENU,
52  WORLDMAP_CHEAT_MENU,
53  WORLDMAP_LEVEL_SELECT_MENU,
54  GAME_MENU,
55  CHEAT_MENU,
56  DEBUG_MENU,
57  EDITOR_LEVELSET_SELECT_MENU,
58  EDITOR_NEW_LEVELSET_MENU,
59  EDITOR_LEVEL_SELECT_MENU,
60  EDITOR_MENU,
61  EDITOR_TILEGROUP_MENU,
62  EDITOR_OBJECTGROUP_MENU,
63  EDITOR_SECTORS_MENU,
64  EDITOR_SECTOR_MENU,
65  EDITOR_LEVEL_MENU,
66  EDITOR_LEVELSET_MENU
67  };
68 
69 public:
70  MenuStorage();
71  ~MenuStorage();
72 
73  std::unique_ptr<Menu> create(MenuId menu_id);
74 
75 private:
76  MenuStorage(const MenuStorage&) = delete;
77  MenuStorage& operator=(const MenuStorage&) = delete;
78 };
79 
80 #endif
81 
82 /* EOF */
Definition: menu_storage.hpp:28
Definition: options_menu.hpp:23
Definition: menu.hpp:51
Definition: keyboard_menu.hpp:25
Definition: profile_menu.hpp:22
Definition: joystick_menu.hpp:24