22 #ifndef TETRAEDGE_TE_TE_BUTTON_LAYOUT_H 23 #define TETRAEDGE_TE_TE_BUTTON_LAYOUT_H 25 #include "tetraedge/te/te_callback.h" 26 #include "tetraedge/te/te_layout.h" 27 #include "tetraedge/te/te_signal.h" 28 #include "tetraedge/te/te_timer.h" 30 #include "common/path.h" 46 BUTTON_STATE_DOWN = 1,
47 BUTTON_STATE_DISABLED = 2,
48 BUTTON_STATE_ROLLOVER = 3
51 uint64 doubleValidationProtectionTimeoutTime() {
return 500; }
52 uint64 frozenValidationTimeoutTime() {
return 500; }
54 virtual bool isMouseIn(
const TeVector2s32 &mouseloc)
override;
56 bool onMouseLeftDownMaxPriority(
const Common::Point &pt) {
return false; }
58 bool onMouseLeftUpMaxPriority(
const Common::Point &pt) {
return false; }
60 bool onMousePositionChangedMaxPriority(
const Common::Point &pt) {
61 _mousePositionChangedCatched =
false;
67 void resetTimeFromLastValidation();
68 uint64 timeFromLastValidation();
70 void setDisabledLayout(
TeLayout *disabledLayout);
71 void setHitZone(
TeLayout *hitZoneLayout);
72 void setDownLayout(
TeLayout *downLayout);
73 void setRollOverLayout(
TeLayout *rollOverLayout);
74 void setUpLayout(
TeLayout *upLayout);
76 void setDoubleValidationProtectionEnabled(
bool enable);
77 void setEnable(
bool enable);
78 virtual void setPosition(
const TeVector3f32 &pos)
override;
80 void setClickPassThrough(
bool val) {
81 _clickPassThrough = val;
84 _validationSound = val;
86 void setValidationSoundVolume(
float val) {
87 _validationSoundVolume = val;
90 void setState(State newState);
91 State state()
const {
return _currentState; };
93 TeSignal0Param &onMouseClickValidated() {
return _onMouseClickValidatedSignal; };
94 TeSignal0Param &onButtonChangedToStateUpSignal() {
return _onButtonChangedToStateUpSignal; };
95 TeSignal0Param &onButtonChangedToStateDownSignal() {
return _onButtonChangedToStateDownSignal; };
96 TeSignal0Param &onButtonChangedToStateRolloverSignal() {
return _onButtonChangedToStateRolloverSignal; };
98 TeLayout *upLayout() {
return _upLayout; }
99 TeLayout *downLayout() {
return _downLayout; }
100 void setIgnoreMouseEvents(
bool val) { _ignoreMouseEvents = val; }
106 static bool _mousePositionChangedCatched;
107 static TeTimer *getDoubleValidationProtectionTimer();
108 static TeTimer *_doubleValidationProtectionTimer;
110 bool _doubleValidationProtectionEnabled;
111 bool _ignoreMouseEvents;
114 bool _clickPassThrough;
117 float _validationSoundVolume;
141 #endif // TETRAEDGE_TE_TE_BUTTON_LAYOUT_H Definition: te_signal.h:40
Definition: detection.h:27
Definition: display_client.h:58
Definition: te_timer.h:33
Definition: algorithm.h:29
Definition: te_layout.h:35
Definition: te_vector2s32.h:31
Definition: te_vector3f32.h:33