ScummVM API documentation
dialogs.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GLOBAL_DIALOGS_H
23 #define GLOBAL_DIALOGS_H
24 
25 #include "gui/dialog.h"
26 #include "gui/options.h"
27 #include "gui/widget.h"
28 
29 class Engine;
30 
31 namespace GUI {
32 class ButtonWidget;
33 class CommandSender;
34 class GraphicsWidget;
35 class SaveLoadChooser;
36 }
37 
38 class MainMenuDialog : public GUI::Dialog {
39 public:
40  enum {
41  kSaveCmd = 'SAVE',
42  kLoadCmd = 'LOAD',
43  kPlayCmd = 'PLAY',
44  kOptionsCmd = 'OPTN',
45  kHelpCmd = 'HELP',
46  kMainHelpCmd = 'MHLP',
47  kAboutCmd = 'ABOU',
48  kQuitCmd = 'QUIT',
49  kLauncherCmd = 'LNCR',
50  kChooseCmd = 'CHOS'
51  };
52 
53 public:
54  MainMenuDialog(Engine *engine);
55  ~MainMenuDialog();
56 
57  virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
58 
59  virtual void reflowLayout() override;
60 
61 protected:
62  void save();
63  void load();
64 
65 protected:
66  Engine *_engine;
67 
68  GUI::GraphicsWidget *_logo;
69 
70  GUI::ButtonWidget *_returnToLauncherButton;
71  GUI::ButtonWidget *_helpButton;
72 
73  GUI::Dialog *_aboutDialog;
74 
75  GUI::SaveLoadChooser *_loadDialog;
76  GUI::SaveLoadChooser *_saveDialog;
77 };
78 
79 namespace GUI {
80 
81 class ConfigDialog : public OptionsDialog {
82 public:
83  ConfigDialog();
84  ~ConfigDialog() override;
85 
86  // OptionsDialog API
87  void build() override;
88  void apply() override;
89 
90 private:
91  OptionsContainerWidget *_engineOptions;
92 };
93 
95 public:
96  enum {
97  kClickGroupLeaderCmd = 'CGLC'
98  };
99 
100 public:
101  ExtraGuiOptionsWidget(GuiObject *widgetsBoss, const Common::String &name, const Common::String &domain, const ExtraGuiOptions &options);
102  ~ExtraGuiOptionsWidget() override;
103 
104  virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
105 
106  // OptionsContainerWidget API
107  void load() override;
108  bool save() override;
109 
110 protected:
111  void defineLayout(ThemeEval& layouts, const Common::String& layoutName, const Common::String& overlayedLayout) const override;
112 
113 private:
115 
116  ExtraGuiOptions _options;
117  CheckboxWidgetList _checkboxes;
118 };
119 
120 } // End of namespace GUI
121 
122 #endif
Definition: str.h:59
Definition: dialogs.h:94
Definition: widget.h:445
Definition: ThemeEval.h:37
Definition: printman.h:30
Definition: object.h:60
Definition: widget.h:533
Definition: saveload.h:32
Definition: dialogs.h:81
Definition: dialog.h:49
Definition: dialogs.h:38
Definition: widget.h:234
Definition: engine.h:144
Definition: object.h:40
Definition: options.h:61