WebRadioApp  0.1
_ViewsText.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 _ViewsText_H
28 #define _ViewsText_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 "_CoreRectView.h"
46 
47 /* Forward declaration of the class Core::Group */
48 #ifndef _CoreGroup_
49  EW_DECLARE_CLASS( CoreGroup )
50 #define _CoreGroup_
51 #endif
52 
53 /* Forward declaration of the class Core::LayoutContext */
54 #ifndef _CoreLayoutContext_
55  EW_DECLARE_CLASS( CoreLayoutContext )
56 #define _CoreLayoutContext_
57 #endif
58 
59 /* Forward declaration of the class Core::View */
60 #ifndef _CoreView_
61  EW_DECLARE_CLASS( CoreView )
62 #define _CoreView_
63 #endif
64 
65 /* Forward declaration of the class Graphics::Canvas */
66 #ifndef _GraphicsCanvas_
67  EW_DECLARE_CLASS( GraphicsCanvas )
68 #define _GraphicsCanvas_
69 #endif
70 
71 /* Forward declaration of the class Resources::Font */
72 #ifndef _ResourcesFont_
73  EW_DECLARE_CLASS( ResourcesFont )
74 #define _ResourcesFont_
75 #endif
76 
77 /* Forward declaration of the class Views::Text */
78 #ifndef _ViewsText_
79  EW_DECLARE_CLASS( ViewsText )
80 #define _ViewsText_
81 #endif
82 
83 
84 /* The class Views::Text provides a kind of view specialized to print the text.
85  The text is stored in the property @String. It can consist of several rows separated
86  by the new-line sign '\\n'. Optionally an automatic text wrap ca be performed
87  if the property @WrapText is 'true'. The automatic text wrap takes place primarily
88  between words. More sophisticated text wrap can be controlled by following special
89  signs used within the text:
90  - The tilde sign '~' and the soft-hyphen sign '\x00AD' identify a potential text
91  wrap position. They are usually not displayed until the text wrap took place
92  at their position. Then the text row is terminated with a hyphen '-' sign.
93  - The circumflex accent '^' sign and '\x200B' zero-width non breakable space
94  identify potential text wrap positions without ever being visible.
95  In order to be able to output the special characters '^' and '~' and as regular
96  signs, the character '%' can be applied in front of the affected sign to convert
97  it to a regular sign. To show the '%' sign itself, use '%%' sequence.
98  Beside the automatic text wrap, an explicit linefeed is possible when the '\n'
99  sign has been found in the string.
100  The text output is performed with the font specified in the property @Font. The
101  position and the size of the area where the text is drawn is determined by the
102  property @Bounds. If the size of this area differs from the size of the text,
103  the text can be aligned. This is controlled by the property @Alignment. With
104  the property @Orientation the displayed content can be rotated. The color to
105  print the text is defined by the property @Color. Alternatively, the text can
106  be drawn with a color gradient specified by the properties @ColorTL, @ColorTR,
107  @ColorBL and @ColorBR. For each view's corner different color can be set.
108  The property @SlideHandler permits the text view to be connected together with
109  an interactive Core::SlideTouchHandler. In this manner the user can scroll the
110  displayed text by simply touching the slide handler on the screen. Alternatively,
111  the scroll position can be controlled by the value of the property @ScrollOffset.
112  The visibility of the text is controlled by the properties @Visible and @Embedded.
113  In particular the property @Embedded can determine whether the corresponding
114  view is limited (== embedded) to the boundary of a sibling Core::Outline view
115  or not. The embedding of views within a Core::Outline allows a kind of sub-groups
116  within the GUI component itself. Very useful for any kind of scrollable lists,
117  menus, etc.
118  With the property @EnableBidiText the view can be configured to treat the original
119  string @String as containing bi-directional text. In such case, the string is
120  processed by the Unicode Bidirectional Algorithm. If the text contains Arabic
121  characters, the algorithm performs the shaping and determines the obligatory
122  Arabic ligatures. With the method @IsBidiText(), @IsBaseDirectionRTL() and @IsCharDirectionRTL()
123  the resulting state of the processed text can be determined.
124  The text provides an additional set of methods useful to access the text rows
125  and glyphs, e.g. @GetNoOfRows(), @GetRowArea(), @RowCol2Position(), @RowCol2StringIndex(),
126  @StringIndex2RowCol(), etc. These methods can be invoked from a slot method assigned
127  to the property @OnUpdate. In this manner text position can be calculated or
128  additional decorations can be drawn. */
129 EW_DEFINE_FIELDS( ViewsText, CoreRectView )
130  EW_PROPERTY( Font, ResourcesFont )
131  EW_PROPERTY( OnUpdate, XSlot )
132  EW_VARIABLE( flowString, XString )
133  EW_PROPERTY( String, XString )
134  EW_VARIABLE( bidiContext, XHandle )
135  EW_VARIABLE( textSize, XPoint )
136  EW_PROPERTY( Padding, XInt32 )
137  EW_PROPERTY( RowDistance, XInt32 )
138  EW_PROPERTY( ColorBL, XColor )
139  EW_PROPERTY( ColorBR, XColor )
140  EW_PROPERTY( ColorTR, XColor )
141  EW_PROPERTY( ColorTL, XColor )
142  EW_PROPERTY( WrapWidth, XInt32 )
143  EW_PROPERTY( ScrollOffset, XPoint )
144  EW_PROPERTY( Alignment, XSet )
145  EW_PROPERTY( Opacity, XInt32 )
146  EW_PROPERTY( Orientation, XEnum )
147  EW_PROPERTY( WrapText, XBool )
148  EW_PROPERTY( AutoSize, XBool )
149  EW_PROPERTY( Ellipsis, XBool )
150  EW_PROPERTY( EnableBidiText, XBool )
151  EW_VARIABLE( reparsed, XBool )
152 EW_END_OF_FIELDS( ViewsText )
153 
154 /* Virtual Method Table (VMT) for the class : 'Views::Text' */
155 EW_DEFINE_METHODS( ViewsText, CoreRectView )
156  EW_METHOD( initLayoutContext, void )( CoreRectView _this, XRect aBounds, CoreOutline
157  aOutline )
158  EW_METHOD( GetRoot, CoreRoot )( CoreView _this )
159  EW_METHOD( Draw, void )( ViewsText _this, GraphicsCanvas aCanvas,
161  EW_METHOD( HandleEvent, XObject )( CoreView _this, CoreEvent aEvent )
162  EW_METHOD( CursorHitTest, CoreCursorHit )( CoreView _this, XRect aArea, XInt32
163  aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason )
164  EW_METHOD( ArrangeView, XPoint )( CoreRectView _this, XRect aBounds, XEnum
165  aFormation )
166  EW_METHOD( MoveView, void )( CoreRectView _this, XPoint aOffset, XBool
167  aFastMove )
168  EW_METHOD( GetExtent, XRect )( CoreRectView _this )
169  EW_METHOD( ChangeViewState, void )( CoreView _this, XSet aSetState, XSet aClearState )
170  EW_METHOD( OnSetBounds, void )( ViewsText _this, XRect value )
171 EW_END_OF_METHODS( ViewsText )
172 
173 /* 'C' function for method : 'Views::Text.Done()' */
174 void ViewsText_Done( ViewsText _this );
175 
176 /* The method Draw() is invoked automatically if parts of the view should be redrawn
177  on the screen. This can occur when e.g. the view has been moved or the appearance
178  of the view has changed before.
179  Draw() is invoked automatically by the framework, you never will need to invoke
180  this method directly. However you can request an invocation of this method by
181  calling the method InvalidateArea() of the views @Owner. Usually this is also
182  unnecessary unless you are developing your own view.
183  The passed parameters determine the drawing destination aCanvas and the area
184  to redraw aClip in the coordinate space of the canvas. The parameter aOffset
185  contains the displacement between the origin of the views owner and the origin
186  of the canvas. You will need it to convert views coordinates into these of the
187  canvas.
188  The parameter aOpacity contains the opacity descended from this view's @Owner.
189  It lies in range 0 .. 255. If the view implements its own 'Opacity', 'Color',
190  etc. properties, the Draw() method should calculate the resulting real opacity
191  by mixing the values of these properties with the one passed in aOpacity parameter.
192  The parameter aBlend contains the blending mode descended from this view's @Owner.
193  It determines, whether the view should be drawn with alpha-blending active or
194  not. If aBlend is false, the outputs of the view should overwrite the corresponding
195  pixel in the drawing destination aCanvas. If aBlend is true, the outputs should
196  be mixed with the pixel already stored in aCanvas. For this purpose all Graphics
197  Engine functions provide a parameter to specify the mode for the respective drawing
198  operation. If the view implements its own 'Blend' property, the Draw() method
199  should calculate the resulting real blend mode by using logical AND operation
200  of the value of the property and the one passed in aBlend parameter. */
201 void ViewsText_Draw( ViewsText _this, GraphicsCanvas aCanvas, XRect aClip, XPoint
203 
204 /* 'C' function for method : 'Views::Text.OnSetBounds()' */
205 void ViewsText_OnSetBounds( ViewsText _this, XRect value );
206 
207 /* 'C' function for method : 'Views::Text.freeBidi()' */
208 void ViewsText_freeBidi( ViewsText _this, XHandle aBidi );
209 
210 /* 'C' function for method : 'Views::Text.createBidi()' */
211 XHandle ViewsText_createBidi( ViewsText _this, XInt32 aSize );
212 
213 /* 'C' function for method : 'Views::Text.preOnUpdateSlot()' */
214 void ViewsText_preOnUpdateSlot( ViewsText _this, XObject sender );
215 
216 /* 'C' function for method : 'Views::Text.preReparseSlot()' */
217 void ViewsText_preReparseSlot( ViewsText _this, XObject sender );
218 
219 /* 'C' function for method : 'Views::Text.reparseSlot()' */
220 void ViewsText_reparseSlot( ViewsText _this, XObject sender );
221 
222 /* 'C' function for method : 'Views::Text.OnSetEnableBidiText()' */
223 void ViewsText_OnSetEnableBidiText( ViewsText _this, XBool value );
224 
225 /* The onset method for the property 'Ellipsis' changes the ellipsis mode and forces
226  an update. */
227 void ViewsText_OnSetEllipsis( ViewsText _this, XBool value );
228 
229 /* 'C' function for method : 'Views::Text.OnSetAutoSize()' */
230 void ViewsText_OnSetAutoSize( ViewsText _this, XBool value );
231 
232 /* 'C' function for method : 'Views::Text.OnSetWrapText()' */
233 void ViewsText_OnSetWrapText( ViewsText _this, XBool value );
234 
235 /* 'C' function for method : 'Views::Text.OnSetAlignment()' */
236 void ViewsText_OnSetAlignment( ViewsText _this, XSet value );
237 
238 /* 'C' function for method : 'Views::Text.OnSetString()' */
239 void ViewsText_OnSetString( ViewsText _this, XString value );
240 
241 /* 'C' function for method : 'Views::Text.OnSetFont()' */
242 void ViewsText_OnSetFont( ViewsText _this, ResourcesFont value );
243 
244 /* 'C' function for method : 'Views::Text.OnSetColor()' */
245 void ViewsText_OnSetColor( ViewsText _this, XColor value );
246 
247 /* 'C' function for method : 'Views::Text.OnSetOpacity()' */
248 void ViewsText_OnSetOpacity( ViewsText _this, XInt32 value );
249 
250 /* The method IsBaseDirectionRTL() returns 'true' if the text specified in @String
251  starts with an RTL (right-to-left) character. This implies the base direction
252  of the entire text paragraph. If the text starts with an LTR (left-to-right)
253  sign or the property @EnableBidiText is 'false', this method returns 'false'. */
254 XBool ViewsText_IsBaseDirectionRTL( ViewsText _this );
255 
256 /* The method IsBidiText() returns 'true' if the text specified in the property
257  @String contains any right-to-left contents or any other Bidi algorithm specific
258  control codes requiring the Bidi processing of this text. Please note, if the
259  property @EnableBidiText is false, the text is not processed by the Bidi algorithm
260  and this method returns 'false'. */
261 XBool ViewsText_IsBidiText( ViewsText _this );
262 
263 /* The method GetContentArea() returns the position and the size of an area where
264  the view will show the text. This area is expressed in coordinates relative to
265  the top-left corner of the view's @Owner. The method takes in account all properties
266  which do affect the position and the alignment of the text, e.g. @Alignment,
267  @Orientation, @ScrollOffset, @WrapText, etc. */
268 XRect ViewsText_GetContentArea( ViewsText _this );
269 
270 /* Default onget method for the property 'Opacity' */
271 XInt32 ViewsText_OnGetOpacity( ViewsText _this );
272 
273 #ifdef __cplusplus
274  }
275 #endif
276 
277 #endif /* _ViewsText_H */
278 
279 /* Embedded Wizard */
ewrte.h
ViewsText_Done
void ViewsText_Done(ViewsText _this)
Definition: Views.c:1123
XColor
Definition: ewrte.h:1700
ViewsText_OnSetColor
void ViewsText_OnSetColor(ViewsText _this, XColor value)
Definition: Views.c:1857
XHandle
unsigned long XHandle
Definition: ewrte.h:291
EW_END_OF_FIELDS
#define EW_END_OF_FIELDS(aClass)
Definition: ewrte.h:460
ViewsText_OnSetString
void ViewsText_OnSetString(ViewsText _this, XString value)
Definition: Views.c:1833
ViewsText_OnSetFont
void ViewsText_OnSetFont(ViewsText _this, ResourcesFont value)
Definition: Views.c:1845
ViewsText_OnSetEllipsis
void ViewsText_OnSetEllipsis(ViewsText _this, XBool value)
Definition: Views.c:1744
EW_DECLARE_CLASS
#define EW_DECLARE_CLASS(aClass)
Definition: ewrte.h:393
CoreCursorHit
XRect CoreOutline aOutline CoreCursorHit(CoreView _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason) EW_METHOD(ArrangeView
ViewsText_OnSetEnableBidiText
void ViewsText_OnSetEnableBidiText(ViewsText _this, XBool value)
Definition: Views.c:1731
ViewsText_preReparseSlot
void ViewsText_preReparseSlot(ViewsText _this, XObject sender)
Definition: Views.c:1386
XSlot
Definition: ewrte.h:2114
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
ewgfx.h
_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
value
XRect CoreOutline aOutline XPoint value
Definition: _ViewsWarpView.h:137
XBool
char XBool
Definition: ewrte.h:1592
XEnum
unsigned long XEnum
Definition: ewrte.h:1593
EW_DEFINE_METHODS
#define EW_DEFINE_METHODS(aClass, aSuperClass)
Definition: ewrte.h:524
aBounds
XRect aBounds
Definition: _ViewsText.h:156
XRect
Definition: ewrte.h:1639
EW_METHOD
EW_METHOD(initLayoutContext, void)(CoreRectView _this
ViewsText_IsBidiText
XBool ViewsText_IsBidiText(ViewsText _this)
Definition: Views.c:1918
_CoreRectView.h
ViewsText_OnSetOpacity
void ViewsText_OnSetOpacity(ViewsText _this, XInt32 value)
Definition: Views.c:1874
XSet
unsigned long XSet
Definition: ewrte.h:1594
aOpacity
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 aOpacity
Definition: _CoreOutline.h:172
ViewsText_createBidi
XHandle ViewsText_createBidi(ViewsText _this, XInt32 aSize)
Definition: Views.c:1364
ViewsText_GetContentArea
XRect ViewsText_GetContentArea(ViewsText _this)
Definition: Views.c:1940
aClip
XRect CoreOutline aOutline GraphicsCanvas XRect aClip
Definition: _CoreOutline.h:171
ViewsText_OnSetAlignment
void ViewsText_OnSetAlignment(ViewsText _this, XSet value)
Definition: Views.c:1810
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
ViewsText_IsBaseDirectionRTL
XBool ViewsText_IsBaseDirectionRTL(ViewsText _this)
Definition: Views.c:1896
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
ViewsText_reparseSlot
void ViewsText_reparseSlot(ViewsText _this, XObject sender)
Definition: Views.c:1395
aCanvas
XRect CoreOutline aOutline GraphicsCanvas aCanvas
Definition: _CoreOutline.h:171
XString
XChar * XString
Definition: ewrte.h:1656
ViewsText_preOnUpdateSlot
void ViewsText_preOnUpdateSlot(ViewsText _this, XObject sender)
Definition: Views.c:1377
ViewsText_OnSetBounds
void ViewsText_OnSetBounds(ViewsText _this, XRect value)
Definition: Views.c:1317
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
ViewsText_OnGetOpacity
XInt32 ViewsText_OnGetOpacity(ViewsText _this)
Definition: Views.c:2063
ViewsText_OnSetWrapText
void ViewsText_OnSetWrapText(ViewsText _this, XBool value)
Definition: Views.c:1789
ViewsText_OnSetAutoSize
void ViewsText_OnSetAutoSize(ViewsText _this, XBool value)
Definition: Views.c:1756
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
ViewsText_freeBidi
void ViewsText_freeBidi(ViewsText _this, XHandle aBidi)
Definition: Views.c:1352
ViewsText_Draw
void ViewsText_Draw(ViewsText _this, GraphicsCanvas aCanvas, XRect aClip, XPoint aOffset, XInt32 aOpacity, XBool aBlend)
Definition: Views.c:1157
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451