2314097e59902557d1ea08991b9050a4c8d84b18
[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   MenuStorage();
37   ~MenuStorage();
38
39   OptionsMenu* get_options_menu();
40   ProfileMenu* get_profile_menu();
41   KeyboardMenu* get_key_options_menu();
42   JoystickMenu* get_joystick_options_menu();
43
44 private:
45   std::unique_ptr<OptionsMenu>  m_options_menu;
46   std::unique_ptr<ProfileMenu>  m_profile_menu;
47   std::unique_ptr<KeyboardMenu> m_key_options_menu;
48   std::unique_ptr<JoystickMenu> m_joystick_options_menu;
49
50 private:
51   MenuStorage(const MenuStorage&);
52   MenuStorage& operator=(const MenuStorage&);
53 };
54
55 #endif
56
57 /* EOF */