ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
view.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 GOT_VIEWS_VIEW_H
23 #define GOT_VIEWS_VIEW_H
24 
25 #include "got/events.h"
26 #include "got/gfx/gfx_chunks.h"
27 
28 namespace Got {
29 namespace Views {
30 
42 class View : public UIElement {
43 private:
44  UIElement *_focusedElement = nullptr;
45 
49  void checkFocusedControl(const Common::Point &mousePos);
50 
54  UIElement *getElementAtPos(const Common::Point &pos) const;
55 
56 protected:
57  void playSound(int index, bool priority_override);
58  void playSound(const Gfx::GraphicChunk &src);
59 
60  void musicPlay(int num, bool override);
61  void musicPlay(const char *name, bool override);
62  void musicPause();
63  void musicResume();
64  void musicStop();
65  bool musicIsOn() const;
66 
67  void fadeOut();
68  void fadeIn(const byte *pal = nullptr);
69 
70 public:
71  View(const Common::String &name, UIElement *uiParent) : UIElement(name, uiParent) {}
72  View(const Common::String &name) : UIElement(name) {}
73  virtual ~View() {}
74 
75  bool msgFocus(const FocusMessage &msg) override;
76  bool msgUnfocus(const UnfocusMessage &msg) override;
77  bool msgMouseMove(const MouseMoveMessage &msg) override;
78  bool msgMouseDown(const MouseDownMessage &msg) override;
79  bool msgMouseUp(const MouseUpMessage &msg) override;
80 };
81 
82 } // namespace Views
83 } // namespace Got
84 
85 #endif
bool msgMouseMove(const MouseMoveMessage &msg) override
Definition: str.h:59
Definition: messages.h:34
Definition: view.h:42
Definition: messages.h:49
Definition: events.h:77
Definition: messages.h:65
Definition: rect.h:45
Definition: messages.h:40
Definition: messages.h:60
Definition: gfx_chunks.h:38
Definition: console.h:28