ScummVM API documentation
te_checkbox_layout.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 TETRAEDGE_TE_TE_CHECKBOX_LAYOUT_H
23 #define TETRAEDGE_TE_TE_CHECKBOX_LAYOUT_H
24 
25 #include "tetraedge/te/te_layout.h"
26 #include "tetraedge/te/te_vector2s32.h"
27 
28 namespace Tetraedge {
29 
30 class TeCheckboxLayout : public TeLayout {
31 public:
33  virtual ~TeCheckboxLayout();
34 
35  enum State {
36  CheckboxStateActive,
37  CheckboxStateUnactive,
38  CheckboxStateActiveDisabled,
39  CheckboxStateUnactiveDisabled,
40  CheckboxStateActiveRollover,
41  CheckboxStateUnactiveRollover,
42  CheckboxState6
43  };
44 
45  void setActiveLayout(TeLayout *layout);
46  void setUnactiveLayout(TeLayout *layout);
47  void setActiveDisabledLayout(TeLayout *layout);
48  void setUnactiveDisabledLayout(TeLayout *layout);
49  void setActiveRollOverLayout(TeLayout *layout);
50  void setUnactiveRollOverLayout(TeLayout *layout);
51  void setHitZone(TeLayout *layout);
52  void setClickPassThrough(bool val);
53  void setActivationSound(const Common::String &sound);
54  void setUnactivationSound(const Common::String &sound);
55  bool isMouseIn(const TeVector2s32 &pt) override;
56  void setState(State state);
57 
58  TeSignal1Param<State> &onStateChangedSignal() { return _onStateChangedSignal; }
59 
60  bool onMouseLeftUp(const Common::Point &pt);
61  bool onMouseLeftUpMaxPriority(const Common::Point &pt);
62  bool onMouseLeftDown(const Common::Point &pt);
63  bool onMousePositionChanged(const Common::Point &pt);
64 
65 private:
66  TeLayout *_activeLayout;
67  TeLayout *_unactiveLayout;
68  TeLayout *_activeDisabledLayout;
69  TeLayout *_unactiveDisabledLayout;
70  TeLayout *_activeRollOverLayout;
71  TeLayout *_unactiveRollOverLayout;
72  TeLayout *_hitZone;
73 
74  bool _clickPassThrough;
75  Common::String _activationSound;
76  Common::String _unactivationSound;
77  State _state;
78  TeSignal1Param<State> _onStateChangedSignal;
79 
80  TeICallback1ParamPtr<const Common::Point &> _onMouseLeftUpCallback;
81  TeICallback1ParamPtr<const Common::Point &> _onMouseLeftUpMaxPriorityCallback;
82  TeICallback1ParamPtr<const Common::Point &> _onMouseLeftDownCallback;
83  TeICallback1ParamPtr<const Common::Point &> _onMousePositionChangedCallback;
84 
85 };
86 
87 } // end namespace Tetraedge
88 
89 #endif // TETRAEDGE_TE_TE_CHECKBOX_LAYOUT_H
Definition: str.h:59
Definition: detection.h:27
Definition: te_layout.h:35
Definition: rect.h:45
Definition: te_vector2s32.h:31
Definition: ptr.h:159
Definition: te_checkbox_layout.h:30