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 STARK_UI_BUTTON_H
23 #define STARK_UI_BUTTON_H
24 
25 #include "engines/stark/services/staticprovider.h"
26 
27 #include "common/scummsys.h"
28 #include "common/rect.h"
29 #include "common/str.h"
30 
31 namespace Stark {
32 
33 class VisualExplodingImage;
34 class VisualFlashingImage;
35 class VisualImageXMG;
36 class VisualText;
37 
38 namespace Resources {
39 class Anim;
40 }
41 
42 class Button {
43 public:
44  enum HintAlign { kAlignLeft, kAlignRight };
45 
46  Button(const Common::String &text, StaticProvider::UIElement stockElement, const Common::Point &pos, HintAlign align, const Common::Point &hintPos);
47  ~Button();
48 
49  void setPosition(const Common::Point &pos) { _position = pos; }
50  void setUIElement(const StaticProvider::UIElement &stockElement) { _stockElement = stockElement; }
51 
53  void showButtonHint();
54  void render();
55  bool containsPoint(const Common::Point &point);
56 
58  void resetHintVisual();
59 
61  void goToAnimStatement(int animScriptItemIndex);
62 
64  void startImageExplosion(VisualImageXMG *image);
65 
67  void stopImageExplosion();
68 
70  void startImageFlashing(VisualImageXMG *image);
71 
73  void stopImageFlashing();
74 
75 private:
76  StaticProvider::UIElement _stockElement;
77  Common::Point _position;
78  Common::Point _hintPosition;
79  Common::String _text;
80  VisualText *_mouseText;
81  VisualExplodingImage *_explodingImageAnimation;
82  VisualFlashingImage *_flashingImageAnimation;
83  const HintAlign _align;
84  bool _renderHint;
85 };
86 
87 } // End of namespace Stark
88 
89 #endif // STARK_UI_BUTTON_H
Definition: str.h:59
Definition: button.h:42
Definition: text.h:44
Definition: console.h:27
Definition: rect.h:45
Definition: explodingimage.h:51
Definition: image.h:45
Definition: flashingimage.h:51