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  kAboutCmd = 'ABOU',
47  kQuitCmd = 'QUIT',
48  kLauncherCmd = 'LNCR',
49  kChooseCmd = 'CHOS'
50  };
51 
52 public:
53  MainMenuDialog(Engine *engine);
54  ~MainMenuDialog();
55 
56  virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
57 
58  virtual void reflowLayout() override;
59 
60 protected:
61  void save();
62  void load();
63 
64 protected:
65  Engine *_engine;
66 
67  GUI::GraphicsWidget *_logo;
68 
69  GUI::ButtonWidget *_returnToLauncherButton;
70  GUI::ButtonWidget *_helpButton;
71 
72  GUI::Dialog *_aboutDialog;
73 
74  GUI::SaveLoadChooser *_loadDialog;
75  GUI::SaveLoadChooser *_saveDialog;
76 };
77 
78 namespace GUI {
79 
80 class ConfigDialog : public OptionsDialog {
81 public:
82  ConfigDialog();
83  ~ConfigDialog() override;
84 
85  // OptionsDialog API
86  void build() override;
87  void apply() override;
88 
89 private:
90  OptionsContainerWidget *_engineOptions;
91 };
92 
94 public:
95  enum {
96  kClickGroupLeaderCmd = 'CGLC'
97  };
98 
99 public:
100  ExtraGuiOptionsWidget(GuiObject *widgetsBoss, const Common::String &name, const Common::String &domain, const ExtraGuiOptions &options);
101  ~ExtraGuiOptionsWidget() override;
102 
103  virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
104 
105  // OptionsContainerWidget API
106  void load() override;
107  bool save() override;
108 
109 protected:
110  void defineLayout(ThemeEval& layouts, const Common::String& layoutName, const Common::String& overlayedLayout) const override;
111 
112 private:
114 
115  ExtraGuiOptions _options;
116  CheckboxWidgetList _checkboxes;
117 };
118 
119 } // End of namespace GUI
120 
121 #endif
Definition: str.h:59
Definition: dialogs.h:93
Definition: widget.h:444
Definition: ThemeEval.h:37
Definition: system.h:46
Definition: object.h:60
Definition: widget.h:532
Definition: saveload.h:32
Definition: dialogs.h:80
Definition: dialog.h:49
Definition: dialogs.h:38
Definition: widget.h:233
Definition: engine.h:144
Definition: object.h:40
Definition: options.h:61