WebRadioApp  0.1
_WidgetSetHorizontalSlider.h
Go to the documentation of this file.
1 /*******************************************************************************
2 *
3 * E M B E D D E D W I Z A R D P R O J E C T
4 *
5 * Copyright (c) TARA Systems GmbH
6 * written by Paul Banach and Manfred Schweyer
7 *
8 ********************************************************************************
9 *
10 * This file was generated automatically by Embedded Wizard Studio.
11 *
12 * Please do not make any modifications of this file! The modifications are lost
13 * when the file is generated again by Embedded Wizard Studio!
14 *
15 * The template of this heading text can be found in the file 'head.ewt' in the
16 * directory 'Platforms' of your Embedded Wizard installation directory. If you
17 * wish to adapt this text, please copy the template file 'head.ewt' into your
18 * project directory and edit the copy only. Please avoid any modifications of
19 * the original template file!
20 *
21 * Version : 10.00
22 * Profile : STM32H747
23 * Platform : STM.STM32.RGB565
24 *
25 *******************************************************************************/
26 
27 #ifndef _WidgetSetHorizontalSlider_H
28 #define _WidgetSetHorizontalSlider_H
29 
30 #ifdef __cplusplus
31  extern "C"
32  {
33 #endif
34 
35 #include "ewrte.h"
36 #if EW_RTE_VERSION != 0x000A0000
37  #error Wrong version of Embedded Wizard Runtime Environment.
38 #endif
39 
40 #include "ewgfx.h"
41 #if EW_GFX_VERSION != 0x000A0000
42  #error Wrong version of Embedded Wizard Graphics Engine.
43 #endif
44 
45 #include "_CoreGroup.h"
46 #include "_CoreKeyPressHandler.h"
48 #include "_CoreTimer.h"
49 
50 /* Forward declaration of the class Core::DialogContext */
51 #ifndef _CoreDialogContext_
52  EW_DECLARE_CLASS( CoreDialogContext )
53 #define _CoreDialogContext_
54 #endif
55 
56 /* Forward declaration of the class Core::LayoutContext */
57 #ifndef _CoreLayoutContext_
58  EW_DECLARE_CLASS( CoreLayoutContext )
59 #define _CoreLayoutContext_
60 #endif
61 
62 /* Forward declaration of the class Core::TaskQueue */
63 #ifndef _CoreTaskQueue_
64  EW_DECLARE_CLASS( CoreTaskQueue )
65 #define _CoreTaskQueue_
66 #endif
67 
68 /* Forward declaration of the class Core::View */
69 #ifndef _CoreView_
70  EW_DECLARE_CLASS( CoreView )
71 #define _CoreView_
72 #endif
73 
74 /* Forward declaration of the class Effects::Fader */
75 #ifndef _EffectsFader_
77 #define _EffectsFader_
78 #endif
79 
80 /* Forward declaration of the class Graphics::Canvas */
81 #ifndef _GraphicsCanvas_
82  EW_DECLARE_CLASS( GraphicsCanvas )
83 #define _GraphicsCanvas_
84 #endif
85 
86 /* Forward declaration of the class Views::Frame */
87 #ifndef _ViewsFrame_
88  EW_DECLARE_CLASS( ViewsFrame )
89 #define _ViewsFrame_
90 #endif
91 
92 /* Forward declaration of the class Views::Image */
93 #ifndef _ViewsImage_
94  EW_DECLARE_CLASS( ViewsImage )
95 #define _ViewsImage_
96 #endif
97 
98 /* Forward declaration of the class WidgetSet::HorizontalSlider */
99 #ifndef _WidgetSetHorizontalSlider_
100  EW_DECLARE_CLASS( WidgetSetHorizontalSlider )
101 #define _WidgetSetHorizontalSlider_
102 #endif
103 
104 /* Forward declaration of the class WidgetSet::HorizontalSliderConfig */
105 #ifndef _WidgetSetHorizontalSliderConfig_
106  EW_DECLARE_CLASS( WidgetSetHorizontalSliderConfig )
107 #define _WidgetSetHorizontalSliderConfig_
108 #endif
109 
110 
111 /* This class implements a 'horizontal slider' widget. When the user touches the
112  slider's thumb and drags it horizontally, the slider's current value represented
113  by the int32 property @CurrentValue is changed and signal is sent to the slot
114  method stored in the property @OnChange. The valid range for @CurrentValue is
115  determined by the properties @MinValue and @MaxValue. By connecting further slot
116  methods to the properties @OnStart and @OnEnd you can react to other events triggered
117  while the user starts and ends the interaction with the slider.
118  Alternatively the property @Outlet can refer to any other 'int32' property the
119  slider widget should remain synchronized with. When the user drags the slider's
120  thumb, the affected property is automatically updated to reflect the slider's
121  current value. On the other hand, when the referred property is modified by another
122  one, the slider is automatically notified to remain in sync with the property.
123  This approach follows the Controller-View programming paradigm. Here the slider
124  represents the 'View' and the property referred via 'Outlet' can be seen as a
125  part of the 'Controller'.
126  During its lifetime the slider remains always in one of the four states: 'disabled',
127  'default', 'focused' and 'active'. The state 'disabled' is true for every not
128  available slider (the property @Enabled of the slider is 'false'). Such sliders
129  will ignore all user inputs. The state 'default' determines a slider, which is
130  ready to be touched by the user or ready to become focused. As soon as the slider
131  becomes focused, it switches in the state 'focused'. In this state the user can
132  control the slider by pressing keys on the keyboard. Finally, the state 'active'
133  is true, if the user actually interacts with the slider (the slider's thumb is
134  pressed).
135  The exact look and feel of the slider is determined by the 'Horizontal Slider
136  Configuration' object assigned to the property @Appearance. The configuration
137  object provides bitmaps, colors and other configuration parameters needed to
138  construct and display the slider. Usually, you will manage in your project your
139  own configuration objects and customize the sliders according to your design
140  expectations. Depending on the information provided in the associated configuration
141  object, the slider will be composed of following views:
142  - 'Face' is a bitmap frame view (Views::Frame) filling vertically centered the
143  entire width in the background of the slider. In the configuration object you
144  can individually specify for every slider state the desired bitmap, its opacity,
145  frame number (if the bitmap is multi-frame) and tint color (if the bitmap contains
146  Alpha8 information only). The slider can automatically play animated bitmaps.
147  - 'TrackLeft' is a bitmap frame view (Views::Frame) filling vertically centered
148  the background of the slider between its left edge and the actual position of
149  the thumb. In the configuration object you can individually specify for every
150  slider state the desired bitmap, its opacity, frame number (if the bitmap is
151  multi-frame) and tint color (if the bitmap contains Alpha8 information only).
152  The slider can automatically play animated bitmaps.
153  - 'TrackRight' is a bitmap frame view (Views::Frame) filling vertically centered
154  the background of the slider between the actual position of the thumb and the
155  right edge of the slider widget. In the configuration object you can individually
156  specify for every slider state the desired bitmap, its opacity, frame number
157  (if the bitmap is multi-frame) and tint color (if the bitmap contains Alpha8
158  information only). The slider can automatically play animated bitmaps.
159  - 'Thumb' is an image view (Views::Image) displayed vertically centered at the
160  thumb position according to current value of the slider (@CurrentValue). In the
161  configuration object you can individually specify for every slider state the
162  desired bitmap, its opacity, frame number (if the bitmap is multi-frame) and
163  tint color (if the bitmap contains Alpha8 information only). The slider can automatically
164  play animated bitmaps. If necessary, additional margins on the left and on the
165  right of the thumb can be specified.
166  - 'Cover' is a bitmap frame view (Views::Frame) filling vertically centered the
167  entire width of the slider and covering so eventually the thumb and track. In
168  the configuration object you can individually specify for every slider state
169  the desired bitmap, its opacity, frame number (if the bitmap is multi-frame)
170  and tint color (if the bitmap contains Alpha8 information only). The slider can
171  automatically play animated bitmaps.
172  In particular application cases you can instruct the slider to automatically
173  resign and retarget the actual touch interaction to another touch handler (e.g.
174  another widget) after the user has performed a vertical wipe gesture (@ResignAfterVerticalWipe).
175  Using this property several widgets can cooperate during an active user interaction
176  even if these handler overlap each other.
177  If the slider is actually focused, it can also be controlled by pressing the
178  keyboard keys Core::KeyCode.Left and Core::KeyCode.Right causing the slider's
179  thumb to be moved left or right. In the configuration object you can specify
180  another key codes, if desired. To prevent the slider from being able to be focused,
181  specify in the configuration object the Core::KeyCode.NoKey as codes to control
182  the slider. With the property @StepSize you can specify a raster in which the
183  slider changes the value when user interacts with it.
184  If there is no thumb bitmap provided for the slider, the entire slider area is
185  touchable permitting the user so to interact with and control the slider.
186  The slider widget provides an additional set of methods useful to query the actual
187  position of the thumb and its possible movement range (@GetThumbMaxPosition(),
188  @GetThumbMinPosition(), @GetThumbPosition()). These methods can be invoked from
189  a slot method assigned to the property @OnUpdate. In this manner you can automatically
190  arrange and updated additional decoration according to the actual state of the
191  slider widget. For example, you can arrange a Views::Text view to follow the
192  thumb and to display the actual value of the slider (@CurrentValue).
193  For more details regarding the customization of the slider see the description
194  of WidgetSet::HorizontalSliderConfig class. */
195 EW_DEFINE_FIELDS( WidgetSetHorizontalSlider, CoreGroup )
196  EW_VARIABLE( frameView4, ViewsFrame )
197  EW_VARIABLE( imageView, ViewsImage )
198  EW_VARIABLE( frameView3, ViewsFrame )
199  EW_VARIABLE( frameView2, ViewsFrame )
200  EW_VARIABLE( frameView1, ViewsFrame )
201  EW_PROPERTY( Appearance, WidgetSetHorizontalSliderConfig )
202  EW_PROPERTY( OnUpdate, XSlot )
203  EW_PROPERTY( OnChange, XSlot )
204  EW_PROPERTY( OnEnd, XSlot )
205  EW_PROPERTY( OnStart, XSlot )
206  EW_PROPERTY( Outlet, XRef )
207  EW_OBJECT ( RepetitionTimer, CoreTimer )
208  EW_OBJECT ( KeyHandlerLeft, CoreKeyPressHandler )
209  EW_OBJECT ( KeyHandlerRight, CoreKeyPressHandler )
210  EW_OBJECT ( TouchHandler, CoreSimpleTouchHandler )
211  EW_VARIABLE( touchStartValue, XInt32 )
212  EW_PROPERTY( StepSize, XInt32 )
213  EW_PROPERTY( MaxValue, XInt32 )
214  EW_PROPERTY( MinValue, XInt32 )
215  EW_PROPERTY( CurrentValue, XInt32 )
216  EW_VARIABLE( touchActive, XBool )
217 EW_END_OF_FIELDS( WidgetSetHorizontalSlider )
218 
219 /* Virtual Method Table (VMT) for the class : 'WidgetSet::HorizontalSlider' */
220 EW_DEFINE_METHODS( WidgetSetHorizontalSlider, CoreGroup )
221  EW_METHOD( initLayoutContext, void )( CoreRectView _this, XRect aBounds, CoreOutline
222  aOutline )
223  EW_METHOD( GetRoot, CoreRoot )( CoreView _this )
224  EW_METHOD( Draw, void )( CoreGroup _this, GraphicsCanvas aCanvas,
226  EW_METHOD( HandleEvent, XObject )( CoreView _this, CoreEvent aEvent )
227  EW_METHOD( CursorHitTest, CoreCursorHit )( CoreGroup _this, XRect aArea, XInt32
228  aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason )
229  EW_METHOD( ArrangeView, XPoint )( CoreRectView _this, XRect aBounds, XEnum
230  aFormation )
231  EW_METHOD( MoveView, void )( CoreRectView _this, XPoint aOffset, XBool
232  aFastMove )
233  EW_METHOD( GetExtent, XRect )( CoreRectView _this )
234  EW_METHOD( ChangeViewState, void )( CoreGroup _this, XSet aSetState, XSet aClearState )
235  EW_METHOD( OnSetBounds, void )( WidgetSetHorizontalSlider _this, XRect value )
236  EW_METHOD( drawContent, void )( CoreGroup _this, GraphicsCanvas aCanvas,
238  EW_METHOD( OnSetFocus, void )( CoreGroup _this, CoreView value )
239  EW_METHOD( OnSetBuffered, void )( CoreGroup _this, XBool value )
240  EW_METHOD( OnSetOpacity, void )( CoreGroup _this, XInt32 value )
241  EW_METHOD( IsDialog, XBool )( CoreGroup _this, XBool aRecursive )
242  EW_METHOD( DispatchEvent, XObject )( CoreGroup _this, CoreEvent aEvent )
243  EW_METHOD( BroadcastEvent, XObject )( CoreGroup _this, CoreEvent aEvent, XSet
244  aFilter )
245  EW_METHOD( UpdateLayout, void )( CoreGroup _this, XPoint aSize )
246  EW_METHOD( UpdateViewState, void )( WidgetSetHorizontalSlider _this, XSet aState )
247  EW_METHOD( InvalidateArea, void )( CoreGroup _this, XRect aArea )
248 EW_END_OF_METHODS( WidgetSetHorizontalSlider )
249 
250 /* 'C' function for method : 'WidgetSet::HorizontalSlider.OnSetBounds()' */
251 void WidgetSetHorizontalSlider_OnSetBounds( WidgetSetHorizontalSlider _this, XRect
252  value );
253 
254 /* The method UpdateViewState() is invoked automatically after the state of the
255  component has been changed. This method can be overridden and filled with logic
256  to ensure the visual aspect of the component does reflect its current state.
257  For example, the 'enabled' state of the component can affect its colors (disabled
258  components may appear pale). In this case the logic of the method should modify
259  the respective color properties accordingly to the current 'enabled' state.
260  The current state of the component is passed as a set in the parameter aState.
261  It reflects the very basic component state like its visibility or the ability
262  to react to user inputs. Beside this common state, the method can also involve
263  any other variables used in the component as long as they reflect its current
264  state. For example, the toggle switch component can take in account its toggle
265  state 'on' or 'off' and change accordingly the location of the slider, etc.
266  Usually, this method will be invoked automatically by the framework. Optionally
267  you can request its invocation by using the method @InvalidateViewState(). */
268 void WidgetSetHorizontalSlider_UpdateViewState( WidgetSetHorizontalSlider _this,
269  XSet aState );
270 
271 /* 'C' function for method : 'WidgetSet::HorizontalSlider.onConfigChanged()' */
272 void WidgetSetHorizontalSlider_onConfigChanged( WidgetSetHorizontalSlider _this,
273  XObject sender );
274 
275 /* 'C' function for method : 'WidgetSet::HorizontalSlider.onRepetitionTimer()' */
276 void WidgetSetHorizontalSlider_onRepetitionTimer( WidgetSetHorizontalSlider _this,
277  XObject sender );
278 
279 /* 'C' function for method : 'WidgetSet::HorizontalSlider.onReleaseKey()' */
280 void WidgetSetHorizontalSlider_onReleaseKey( WidgetSetHorizontalSlider _this, XObject
281  sender );
282 
283 /* 'C' function for method : 'WidgetSet::HorizontalSlider.onPressKey()' */
284 void WidgetSetHorizontalSlider_onPressKey( WidgetSetHorizontalSlider _this, XObject
285  sender );
286 
287 /* 'C' function for method : 'WidgetSet::HorizontalSlider.onDragTouch()' */
288 void WidgetSetHorizontalSlider_onDragTouch( WidgetSetHorizontalSlider _this, XObject
289  sender );
290 
291 /* 'C' function for method : 'WidgetSet::HorizontalSlider.onReleaseTouch()' */
292 void WidgetSetHorizontalSlider_onReleaseTouch( WidgetSetHorizontalSlider _this,
293  XObject sender );
294 
295 /* 'C' function for method : 'WidgetSet::HorizontalSlider.onPressTouch()' */
296 void WidgetSetHorizontalSlider_onPressTouch( WidgetSetHorizontalSlider _this, XObject
297  sender );
298 
299 /* 'C' function for method : 'WidgetSet::HorizontalSlider.OnSetMaxValue()' */
300 void WidgetSetHorizontalSlider_OnSetMaxValue( WidgetSetHorizontalSlider _this, XInt32
301  value );
302 
303 /* 'C' function for method : 'WidgetSet::HorizontalSlider.OnGetCurrentValue()' */
304 XInt32 WidgetSetHorizontalSlider_OnGetCurrentValue( WidgetSetHorizontalSlider _this );
305 
306 /* 'C' function for method : 'WidgetSet::HorizontalSlider.OnSetCurrentValue()' */
307 void WidgetSetHorizontalSlider_OnSetCurrentValue( WidgetSetHorizontalSlider _this,
308  XInt32 value );
309 
310 /* 'C' function for method : 'WidgetSet::HorizontalSlider.OnSetAppearance()' */
311 void WidgetSetHorizontalSlider_OnSetAppearance( WidgetSetHorizontalSlider _this,
312  WidgetSetHorizontalSliderConfig value );
313 
314 #ifdef __cplusplus
315  }
316 #endif
317 
318 #endif /* _WidgetSetHorizontalSlider_H */
319 
320 /* Embedded Wizard */
XRef
Definition: ewrte.h:2075
WidgetSetHorizontalSlider_onDragTouch
void WidgetSetHorizontalSlider_onDragTouch(WidgetSetHorizontalSlider _this, XObject sender)
ewrte.h
_CoreTimer.h
WidgetSetHorizontalSlider_UpdateViewState
void WidgetSetHorizontalSlider_UpdateViewState(WidgetSetHorizontalSlider _this, XSet aState)
WidgetSetHorizontalSlider_onPressTouch
void WidgetSetHorizontalSlider_onPressTouch(WidgetSetHorizontalSlider _this, XObject sender)
_CoreGroup.h
CoreCursorHit
XRect CoreOutline aOutline CoreCursorHit(CoreGroup _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason) EW_METHOD(ArrangeView
EW_END_OF_FIELDS
#define EW_END_OF_FIELDS(aClass)
Definition: ewrte.h:460
WidgetSetHorizontalSlider_OnSetAppearance
void WidgetSetHorizontalSlider_OnSetAppearance(WidgetSetHorizontalSlider _this, WidgetSetHorizontalSliderConfig value)
EW_DECLARE_CLASS
#define EW_DECLARE_CLASS(aClass)
Definition: ewrte.h:393
XSlot
Definition: ewrte.h:2114
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
ewgfx.h
WidgetSetHorizontalSlider_OnGetCurrentValue
XInt32 WidgetSetHorizontalSlider_OnGetCurrentValue(WidgetSetHorizontalSlider _this)
_obj_XObject
Definition: ewrte.h:281
aOutline
XRect CoreOutline aOutline XRect CoreOutline aOutline
Definition: _CoreQuadView.h:109
XInt32
signed long XInt32
Definition: ewrte.h:1586
_CoreSimpleTouchHandler.h
WidgetSetHorizontalSlider_onReleaseTouch
void WidgetSetHorizontalSlider_onReleaseTouch(WidgetSetHorizontalSlider _this, XObject sender)
EW_METHOD
EW_METHOD(initLayoutContext, void)(CoreRectView _this
XBool
char XBool
Definition: ewrte.h:1592
XEnum
unsigned long XEnum
Definition: ewrte.h:1593
WidgetSetHorizontalSlider_OnSetMaxValue
void WidgetSetHorizontalSlider_OnSetMaxValue(WidgetSetHorizontalSlider _this, XInt32 value)
EW_DEFINE_METHODS
#define EW_DEFINE_METHODS(aClass, aSuperClass)
Definition: ewrte.h:524
XRect
Definition: ewrte.h:1639
WidgetSetHorizontalSlider_onPressKey
void WidgetSetHorizontalSlider_onPressKey(WidgetSetHorizontalSlider _this, XObject sender)
EffectsFader
EffectsFader(EffectsShowHideTransition _this) EW_METHOD(CreateRestoreFader
XSet
unsigned long XSet
Definition: ewrte.h:1594
aOpacity
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 aOpacity
Definition: _CoreOutline.h:172
WidgetSetHorizontalSlider_OnSetCurrentValue
void WidgetSetHorizontalSlider_OnSetCurrentValue(WidgetSetHorizontalSlider _this, XInt32 value)
WidgetSetHorizontalSlider_onReleaseKey
void WidgetSetHorizontalSlider_onReleaseKey(WidgetSetHorizontalSlider _this, XObject sender)
_CoreKeyPressHandler.h
aClip
XRect CoreOutline aOutline GraphicsCanvas XRect aClip
Definition: _CoreOutline.h:171
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
XPoint
Definition: ewrte.h:1616
EW_PROPERTY
#define EW_PROPERTY(aName, aType)
Definition: ewrte.h:466
aOffset
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint aOffset
Definition: _CoreOutline.h:172
EW_OBJECT
#define EW_OBJECT(aName, aObjectClass)
Definition: ewrte.h:468
aCanvas
XRect CoreOutline aOutline GraphicsCanvas aCanvas
Definition: _CoreOutline.h:171
value
XRect CoreOutline aOutline XRect value
Definition: _WidgetSetHorizontalSlider.h:252
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
aBounds
XRect aBounds
Definition: _WidgetSetHorizontalSlider.h:221
WidgetSetHorizontalSlider_onRepetitionTimer
void WidgetSetHorizontalSlider_onRepetitionTimer(WidgetSetHorizontalSlider _this, XObject sender)
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
WidgetSetHorizontalSlider_onConfigChanged
void WidgetSetHorizontalSlider_onConfigChanged(WidgetSetHorizontalSlider _this, XObject sender)
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451