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 MOHAWK_DIALOGS_H
23 #define MOHAWK_DIALOGS_H
24 
25 #include "mohawk/mohawk.h"
26 
27 #include "common/events.h"
28 #include "common/str.h"
29 #include "common/ustr.h"
30 
31 #include "engines/dialogs.h"
32 
33 #include "gui/dialog.h"
34 #include "gui/widget.h"
35 
36 namespace GUI {
37 class SaveLoadChooser;
38 class ButtonWidget;
39 class CheckboxWidget;
40 class CommandSender;
41 class PopUpWidget;
42 class StaticTextWidget;
43 }
44 
45 namespace Mohawk {
46 
47 class MohawkEngine;
48 
49 class InfoDialog : public GUI::Dialog {
50 protected:
51  MohawkEngine *_vm;
52  Common::U32String _message;
53  GUI::StaticTextWidget *_text;
54 
55 public:
56  InfoDialog(MohawkEngine *vm, const Common::U32String &message);
57 
58  void setInfoText(const Common::U32String &message);
59 
60  void handleMouseDown(int x, int y, int button, int clickCount) override {
61  setResult(0);
62  close();
63  }
64 
65  void handleKeyDown(Common::KeyState state) override {
66  setResult(state.ascii);
67  close();
68  }
69 
70  void reflowLayout() override;
71 };
72 
73 class PauseDialog : public InfoDialog {
74 public:
75  PauseDialog(MohawkEngine* vm, const Common::U32String &message);
76  void handleKeyDown(Common::KeyState state) override;
77 };
78 
79 #ifdef ENABLE_MYST
80 
81 class MystOptionsWidget : public GUI::OptionsContainerWidget {
82 public:
83  MystOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
84  ~MystOptionsWidget() override;
85 
86  // Widget API
87  void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
88 
89  // OptionsContainerWidget API
90  void load() override;
91  bool save() override;
92 
93 private:
94  // OptionsContainerWidget API
95  void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
96 
97  bool isInGame() const;
98 
99  GUI::CheckboxWidget *_zipModeCheckbox;
100  GUI::CheckboxWidget *_transitionsCheckbox;
101  GUI::CheckboxWidget *_mystFlyByCheckbox;
102  GUI::CheckboxWidget *_spaceshipFuzzyLogicCheckbox;
103  GUI::CheckboxWidget *_addCdromDelayCheckbox;
104 
105  GUI::PopUpWidget *_languagePopUp;
106 
107  GUI::ButtonWidget *_dropPageButton;
108  GUI::ButtonWidget *_showMapButton;
109  GUI::ButtonWidget *_returnToMenuButton;
110 };
111 
112 class MystMenuDialog : public MainMenuDialog {
113 public:
114  MystMenuDialog(Engine *engine);
115  ~MystMenuDialog() override;
116 
117  // MainMenuDialog API
118  void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
119 };
120 
121 #endif
122 
123 #ifdef ENABLE_RIVEN
124 
125 class RivenOptionsWidget : public GUI::OptionsContainerWidget {
126 public:
127  explicit RivenOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
128  ~RivenOptionsWidget() override;
129 
130  // OptionsContainerWidget API
131  void load() override;
132  bool save() override;
133 
134 private:
135  // OptionsContainerWidget API
136  void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
137 
138  GUI::CheckboxWidget *_zipModeCheckbox;
139  GUI::CheckboxWidget *_waterEffectCheckbox;
140  GUI::PopUpWidget *_transitionModePopUp;
141  GUI::PopUpWidget *_languagePopUp;
142 };
143 
144 #endif
145 
146 } // End of namespace Mohawk
147 
148 #endif
Definition: dialogs.h:73
Definition: str.h:59
Definition: widget.h:329
Definition: widget.h:205
Definition: dialogs.h:49
Definition: ThemeEval.h:37
Definition: system.h:46
Definition: widget.h:532
Definition: ustr.h:57
Definition: mohawk.h:54
Definition: dialog.h:49
Definition: keyboard.h:294
uint16 ascii
Definition: keyboard.h:310
Definition: dialogs.h:38
Definition: widget.h:233
Definition: popup.h:39
Definition: engine.h:144
Definition: object.h:40
Definition: bitmap.h:32