Cleaned up MenuManager some more, some ownership issues remain, so things will crash...
[supertux.git] / src / supertux / menu / menu_storage.hpp
1 //  SuperTux
2 //  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
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
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     PROFILE_MENU,
41     CONTRIB_MENU,
42     CONTRIB_WORLD_MENU,
43     ADDON_MENU,
44     LANGUAGE_MENU,
45     KEYBOARD_MENU,
46     JOYSTICK_MENU,
47     WORLDMAP_MENU,
48     GAME_MENU
49   };
50
51 public:
52   MenuStorage();
53   ~MenuStorage();
54   
55   std::unique_ptr<Menu> create(MenuId menu_id);
56   
57   // FIXME
58   JoystickMenu* get_joystick_options_menu();
59   KeyboardMenu* get_key_options_menu();
60
61 private:
62   MenuStorage(const MenuStorage&);
63   MenuStorage& operator=(const MenuStorage&);
64 };
65
66 #endif
67
68 /* EOF */