ScummVM API documentation
button.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 NANCY_UI_BUTTON_H
23 #define NANCY_UI_BUTTON_H
24 
25 #include "engines/nancy/renderobject.h"
26 
27 namespace Nancy {
28 
29 struct NancyInput;
30 
31 namespace UI {
32 
33 class Button : public RenderObject {
34 public:
35  Button(uint16 zOrder, Graphics::ManagedSurface &surface,
36  const Common::Rect &clickSrcBounds,
37  const Common::Rect &destBounds,
38  const Common::Rect &hoverSrcBounds = Common::Rect(),
39  const Common::Rect &disabledSrcBounds = Common::Rect(),
40  const Common::Rect &baseSrcBounds = Common::Rect());
41  virtual ~Button() = default;
42 
43  void handleInput(NancyInput &input);
44 
45  void setDisabled(bool disabled);
46 
48  Common::Rect _clickSrc;
49  Common::Rect _hoverSrc;
50  Common::Rect _disabledSrc;
51  Common::Rect _baseSrc;
52 
53  bool _isClicked;
54  bool _isDisabled;
55 };
56 
57 class Toggle : public RenderObject {
58 public:
59  Toggle(uint16 zOrder, Graphics::ManagedSurface &surface, const Common::Rect &srcRect, const Common::Rect &destRect);
60  virtual ~Toggle() = default;
61 
62  void handleInput(NancyInput &input);
63  void setState(bool toggleState);
64 
66  Common::Rect _clickSrc;
67 
68  bool _stateChanged;
69  bool _toggleState;
70 };
71 
72 } // End of namespace UI
73 } // End of namespace Nancy
74 
75 #endif // NANCY_UI_BUTTON_H
Definition: managed_surface.h:51
Definition: button.h:57
Definition: rect.h:524
Definition: input.h:41
Definition: soundequalizerpuzzle.h:27
Definition: renderobject.h:36
Definition: button.h:33
Definition: actionmanager.h:32