Debian Codegraph @

code/controls/LightingPresets.h

raw
1 /*
2 Copyright (C) 2009-2011 wxLauncher Team
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (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, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #ifndef LIGHTINGPRESETS_H
20 #define LIGHTINGPRESETS_H
21
22 #include <wx/wx.h>
23
24 class Preset {
25 public:
26 Preset() { } // needed for wxHashMap, unfortunately
27 Preset(const wxString& name, const int buttonId, const wxString& preset);
28 const wxString& GetName() const { return this->name; }
29 const int GetButtonId() const { return this->buttonId; }
30 const wxString& GetFlagSet() const { return this->flagSet; }
31 void SetFlagSet(const wxString& flagSet);
32 private:
33 wxString name;
34 int buttonId;
35 wxString flagSet;
36 };
37
38 // from wxWidgets window IDs to Presets
39 WX_DECLARE_HASH_MAP(int, Preset, wxIntegerHash, wxIntegerEqual, PresetHashMap);
40
41 class LightingPresets: public wxPanel {
42 public:
43 LightingPresets(wxWindow* parent);
44
45 void OnSelectLightingPreset(wxCommandEvent &event);
46 void OnCopyLightingPreset(wxCommandEvent &event);
47 void OnActiveModChanged(wxCommandEvent &event);
48 void OnProxyFlagDataReady(wxCommandEvent &event);
49
50 static const wxString& PresetNameToPresetFlagSet(const wxString& presetName);
51
52 private:
53 void Initialize();
54 void Reset();
55
56 static void InitializePresets();
57 static int PresetNameToPresetButtonId(const wxString& presetName);
58 static const wxString& PresetButtonIdToPresetName(int buttonId);
59
60 static PresetHashMap presets;
61
62 DECLARE_EVENT_TABLE()
63 };
64
65 #endif