ScummVM API documentation
animatedbutton.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_ANIMATEDBUTTON_H
23 #define NANCY_UI_ANIMATEDBUTTON_H
24 
25 #include "engines/nancy/renderobject.h"
26 
27 namespace Nancy {
28 
29 struct NancyInput;
30 
31 namespace UI {
32 
33 class AnimatedButton : public RenderObject {
34 public:
35  AnimatedButton(uint zOrder);
36  virtual ~AnimatedButton() = default;
37 
38  void init() override;
39  void updateGraphics() override;
40  void handleInput(NancyInput &input);
41 
42  void setOpen(bool open) { _isOpen = open; }
43  void setFrame(int frame);
44  int getCurrentFrame() const { return _currentFrame; }
45  bool isPlaying() const;
46  virtual void onClick() = 0;
47  virtual void onTrigger() = 0;
48 
49 protected:
51  Common::Array<Common::Rect> _destRects;
52  Common::Rect _highlightSrcRect;
53  Common::Rect _highlightDestRect;
54 
55  uint32 _frameTime;
56  bool _alwaysHighlightCursor;
57 
58  int _currentFrame;
59  uint32 _nextFrameTime;
60  bool _isOpen;
61  Common::Rect _hotspot;
62 };
63 
64 } // End of namespace UI
65 } // End of namespace Nancy
66 
67 #endif // NANCY_UI_ANIMATEDBUTTON_H
Definition: animatedbutton.h:33
Definition: rect.h:144
Definition: input.h:41
Definition: soundequalizerpuzzle.h:27
Definition: renderobject.h:36
Definition: actionmanager.h:32