ScummVM API documentation
menu.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 VCRUISE_MENU_H
23 #define VCRUISE_MENU_H
24 
25 #include "common/array.h"
26 #include "common/ptr.h"
27 
28 namespace Graphics {
29 
30 class Font;
31 struct Surface;
32 class ManagedSurface;
33 
34 } // End of namespace Graphics
35 
36 namespace Common {
37 
38 struct Rect;
39 
40 } // End of namespace Common
41 
42 namespace VCruise {
43 
44 struct OSEvent;
45 class MenuPage;
46 class Runtime;
47 
49 public:
50  virtual ~MenuInterface();
51 
52  virtual void commitRect(const Common::Rect &rect) const = 0;
53  virtual bool popOSEvent(OSEvent &evt) const = 0;
54  virtual Graphics::Surface *getUIGraphic(uint index) const = 0;
55  virtual Graphics::ManagedSurface *getMenuSurface() const = 0;
56  virtual bool hasDefaultSave() const = 0;
57  virtual bool hasAnySave() const = 0;
58  virtual bool isInGame() const = 0;
59  virtual Common::Point getMouseCoordinate() const = 0;
60  virtual void restartGame() const = 0;
61  virtual void goToCredits() const = 0;
62  virtual void changeMenu(MenuPage *newPage) const = 0;
63  virtual void quitGame() const = 0;
64  virtual void quitToMenu() const = 0;
65  virtual bool canSave() const = 0;
66  virtual bool reloadFromCheckpoint() const = 0;
67  virtual void setMusicMute(bool muted) const = 0;
68 
69  virtual void drawLabel(Graphics::ManagedSurface *surface, const Common::String &labelID, const Common::Rect &contentRect) const = 0;
70 };
71 
72 class MenuPage {
73 public:
74  MenuPage();
75  virtual ~MenuPage();
76 
77  void init(const MenuInterface *menuInterface);
78 
79  virtual void start();
80  virtual bool run();
81  virtual void onSettingsChanged();
82 
83 protected:
84  const MenuInterface *_menuInterface;
85 };
86 
87 MenuPage *createMenuMain(bool isSchizm);
88 MenuPage *createMenuHelp(bool isSchizm);
89 MenuPage *createMenuSound(bool isSchizm);
90 MenuPage *createMenuQuit(bool isSchizm);
91 MenuPage *createMenuPause(bool isSchizm);
92 
93 } // End of namespace VCruise
94 
95 #endif
Definition: managed_surface.h:51
Definition: str.h:59
Definition: surface.h:67
Definition: menu.h:72
Definition: rect.h:144
Definition: ad2044_items.h:27
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: runtime.h:582
Definition: menu.h:48