[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / visual-model-impl.h
1 #ifndef DALI_TOOLKIT_TEXT_VISUAL_MODEL_IMPL_H
2 #define DALI_TOOLKIT_TEXT_VISUAL_MODEL_IMPL_H
3
4 /*
5  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23 #include <dali/public-api/common/intrusive-ptr.h>
24 #include <dali/public-api/math/vector2.h>
25 #include <dali/public-api/math/vector4.h>
26 #include <dali/public-api/object/ref-object.h>
27
28 // INTERNAL INCLUDES
29 #include <dali-toolkit/internal/text/character-spacing-glyph-run.h>
30 #include <dali-toolkit/internal/text/color-run.h>
31 #include <dali-toolkit/internal/text/line-run.h>
32 #include <dali-toolkit/internal/text/strikethrough-glyph-run.h>
33 #include <dali-toolkit/internal/text/underlined-glyph-run.h>
34 #include <dali-toolkit/public-api/text/text-enumerations.h>
35
36 // DEVEL INCLUDES
37 #include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
38
39 namespace Dali
40 {
41 namespace Toolkit
42 {
43 namespace Text
44 {
45 struct HyphenInfo
46 {
47   Vector<GlyphInfo> glyph;
48   Vector<Vector2>   position;
49   Vector<Length>    index;
50 };
51
52 class VisualModel;
53 typedef IntrusivePtr<VisualModel> VisualModelPtr;
54
55 /**
56  * @brief A visual text model contains layout specific information.
57  *
58  * This includes:
59  * - A series of glyphs in visual order i.e. after the bidirectional reordering.
60  * - The position of each glyph within a 2D bounding box.
61  */
62 class VisualModel : public RefObject
63 {
64 public:
65   /**
66    * @brief Create a new instance of a VisualModel.
67    *
68    * @return A pointer to a new VisualModel.
69    */
70   static VisualModelPtr New();
71
72   // Glyph interface.
73
74   /**
75    * @brief Creates the character to glyph conversion table.
76    *
77    * @pre The glyphs per character table needs to be created first.
78    *
79    * @param[in] startIndex The character from where the conversion table is created.
80    * @param[in] startGlyphIndex The glyph from where the conversion table is created.
81    * @param[in] numberOfCharacters The number of characters.
82    */
83   void CreateCharacterToGlyphTable(CharacterIndex startIndex,
84                                    GlyphIndex     startGlyphIndex,
85                                    Length         numberOfCharacters);
86
87   /**
88    * @brief Creates an array containing the number of glyphs per character.
89    *
90    * @param[in] startIndex The character from where the table is created.
91    * @param[in] startGlyphIndex The glyph from where the conversion table is created.
92    * @param[in] numberOfCharacters The number of characters.
93    */
94   void CreateGlyphsPerCharacterTable(CharacterIndex startIndex,
95                                      GlyphIndex     startGlyphIndex,
96                                      Length         numberOfCharacters);
97
98   /**
99    * @brief Retrieves glyphs in the given buffer.
100    *
101    * The size of the @p glyphs buffer needs to be big enough to copy the @p numberOfGlyphs.
102    * @param[out] glyphs Pointer to a buffer where the glyphs are copied.
103    * @param[in] glyphIndex Index to the first glyph.
104    * @param[in] numberOfGlyphs Number of glyphs to be copied.
105    */
106   void GetGlyphs(GlyphInfo* glyphs,
107                  GlyphIndex glyphIndex,
108                  Length     numberOfGlyphs) const;
109
110   // Position interface
111
112   /**
113    * @brief Retrieves the glyph positions.
114    *
115    * @pre The size of the @p positions buffer needs to be big enough to copy the @p numberOfGlyphs positions.
116    * @param[out] glyphPositions Pointer to a buffer where the glyph positions are copied.
117    * @param[in] glyphIndex Index to the first glyph position.
118    * @param[in] numberOfGlyphs The number of positions to be copied.
119    */
120   void GetGlyphPositions(Vector2*   glyphPositions,
121                          GlyphIndex glyphIndex,
122                          Length     numberOfGlyphs) const;
123
124   // Line interface.
125
126   /**
127    * @brief Retrieves the total number of lines.
128    *
129    * @return The number of lines.
130    */
131   Length GetTotalNumberOfLines() const;
132
133   /**
134    * @brief Retrieves the number of lines and the index to the first line where the given range of glyphs is laid out.
135    *
136    * @param[in] glyphIndex Index to the first glyph.
137    * @param[in] numberOfGlyphs The number of glyph.
138    * @param[out] firstLine Index to the line containing the glyph index.
139    * @param[out] numberOfLines The number of lines.
140    */
141   void GetNumberOfLines(GlyphIndex glyphIndex,
142                         Length     numberOfGlyphs,
143                         LineIndex& firstLine,
144                         Length&    numberOfLines) const;
145
146   /**
147    * @brief Retrieves the line index where the glyph is laid-out.
148    *
149    * @param[in] glyphIndex The glyph's index.
150    *
151    * @return The line index.
152    */
153   LineIndex GetLineOfGlyph(GlyphIndex glyphIndex);
154
155   /**
156    * @brief Retrieves the lines where the given range of glyphs is laid out.
157    *
158    * The size of the @p lines buffer needs to be big enough to copy the @p numberOfLines.
159    *
160    * @param[out] lines Pointer to a buffer where the lines are copied.
161    * @param[in] glyphIndex Index to the first glyphs of the range.
162    * @param[in] numberOfGlyphs Number of glyphs in the range.
163    */
164   void GetLinesOfGlyphRange(LineRun*   lines,
165                             GlyphIndex glyphIndex,
166                             Length     numberOfGlyphs) const;
167
168   /**
169    * @brief Retrieves the line index where the character is laid-out.
170    *
171    * @param[in] characterIndex The character's index.
172    *
173    * @return The line index.
174    */
175   LineIndex GetLineOfCharacter(CharacterIndex characterIndex);
176
177   // Underline runs
178
179   /**
180    * @brief Retrieves the underline runs.
181    *
182    * @param[out] underlineRuns Pointer to a buffer where the underline runs are copied.
183    * @param[in] index Index of the first underline run to be copied.
184    * @param[in] numberOfRuns Number of underline runs to be copied.
185    */
186   void GetUnderlineRuns(UnderlinedGlyphRun* underlineRuns,
187                         UnderlineRunIndex   index,
188                         Length              numberOfRuns) const;
189
190   // Size interface
191
192   /**
193    * @brief Sets the natural size.
194    *
195    * @param[in] size The text's natural size.
196    */
197   void SetNaturalSize(const Vector2& size);
198
199   /**
200    * @brief Retrieves the natural size.
201    *
202    * @return The text's natural size.
203    */
204   const Vector2& GetNaturalSize() const;
205
206   /**
207    * @brief Sets the text's layout size.
208    *
209    * @param[in] size The text's size.
210    */
211   void SetLayoutSize(const Vector2& size);
212
213   /**
214    * @brief Retrieves the text's layout size.
215    *
216    * @return The text's size.
217    */
218   const Vector2& GetLayoutSize() const;
219
220   /**
221    * @brief Sets the size of height for width.
222    *
223    * @param[in] size The text's height for width size.
224    */
225   void SetHeightForWidth(const Vector2& size);
226
227   /**
228    * @brief Retrieves the height for width size.
229    *
230    * @return The text's height for width size.
231    */
232   const Vector2& GetHeightForWidth() const;
233
234   /**
235    * @brief Set the text's color
236    *
237    * @param[in] textColor The text's color
238    */
239   void SetTextColor(const Vector4& textColor);
240
241   /**
242    * @brief Retrieve the text's color
243    *
244    * @return The text's color
245    */
246   const Vector4& GetTextColor() const;
247
248   /**
249    * @brief Sets the text's shadow offset.
250    *
251    * @param[in] shadowOffset The shadow offset, 0,0 indicates no shadow.
252    */
253   void SetShadowOffset(const Vector2& shadowOffset);
254
255   /**
256    * @brief Retrieves the text's shadow offset.
257    *
258    * @return The text's shadow offset, 0,0 indicates no shadow.
259    */
260   const Vector2& GetShadowOffset() const;
261
262   /**
263    * @brief Sets the text's shadow color.
264    *
265    * @param[in] shadowColor The shadow color.
266    */
267   void SetShadowColor(const Vector4& shadowColor);
268
269   /**
270    * @brief Retrieves the text's shadow color.
271    *
272    * @return The text's shadow color.
273    */
274   const Vector4& GetShadowColor() const;
275
276   /**
277    * @brief Set the shadow blur radius.
278    *
279    * @param[in] shadowBlurRadius The shadow blur radius, 0,0 indicates no blur.
280    */
281   void SetShadowBlurRadius(const float& shadowBlurRadius);
282
283   /**
284    * @brief Retrieve the shadow blur radius.
285    *
286    * @return The shadow blur radius.
287    */
288   const float& GetShadowBlurRadius() const;
289
290   /**
291    * @brief Sets the text's underline color.
292    *
293    * @param[in] color The text's underline color.
294    */
295   void SetUnderlineColor(const Vector4& color);
296
297   /**
298    * @brief Retrieves the text's underline color.
299    *
300    * @return The text's underline color.
301    */
302   const Vector4& GetUnderlineColor() const;
303
304   /**
305    * @brief Sets the text underline flag.
306    *
307    * @param[in] enabled true if underlined.
308    */
309   void SetUnderlineEnabled(bool enabled);
310
311   /**
312    * @brief Returns whether the text is underlined or not.
313    *
314    * @return underline state.
315    */
316   bool IsUnderlineEnabled() const;
317
318   /**
319    * @brief Clear the caches.
320    */
321   void ClearCaches();
322
323   /**
324    * @brief Set the override used for underline height, 0 indicates height will be come from font metrics
325    *
326    * @param[in] height The height in pixels of the underline
327    */
328   void SetUnderlineHeight(float height);
329
330   /**
331    * @brief Set the override used for underline type.
332    *
333    * @param[in] underlineType The type of the underline.
334    */
335   void SetUnderlineType(Text::Underline::Type type);
336
337   /**
338    * @brief Set the override used for the width of the dashes of the dashed underline.
339    *
340    * @param[in] width width of the dashes.
341    */
342   void SetDashedUnderlineWidth(float width);
343
344   /**
345    * @brief Set the override used for the gap between the dashes of the dashed underline.
346    *
347    * @param[in] gap gap between the dashes.
348    */
349   void SetDashedUnderlineGap(float gap);
350
351   /**
352    * @brief Retrieves the underline height override
353    *
354    * @return Returns the override height for an underline, 0 indicates that font metrics will determine the height
355    */
356   float GetUnderlineHeight() const;
357
358   /**
359    * @brief Retrieves the underline type override.
360    *
361    * @return Returns the override type for the underline.
362    */
363   Text::Underline::Type GetUnderlineType() const;
364
365   /**
366    * @brief Retrieves the dashed underline width.
367    *
368    * @return Returns the override width for the dashed underline.
369    */
370   float GetDashedUnderlineWidth() const;
371
372   /**
373    * @brief Retrieves the dashed underline gap.
374    *
375    * @return Returns the override gap for the dashed underline.
376    */
377   float GetDashedUnderlineGap() const;
378
379   /**
380    * @brief Retrieves the number of underline runs.
381    *
382    * @return The number of underline runs.
383    */
384   Length GetNumberOfUnderlineRuns() const;
385
386   /**
387    * @brief Sets the text's outline offset.
388    *
389    * @param[in] outlineOffset The outline offset.
390    */
391   void SetOutlineOffset(const Vector2& outlineOffset);
392
393   /**
394    * @brief Set the outline color.
395    *
396    * @param[in] color color of outline.
397    */
398   void SetOutlineColor(const Vector4& color);
399
400   /**
401    * @brief Retrieves the text's outline offset.
402    *
403    * @return The text's outline offset.
404    */
405   const Vector2& GetOutlineOffset() const;
406
407   /**
408    * @brief Retrieve the outline color.
409    *
410    * @return The outline color.
411    */
412   const Vector4& GetOutlineColor() const;
413
414   /**
415    * @brief Set the outline width
416    *
417    * @param[in] width The width in pixels of the outline, 0 indicates no outline
418    */
419   void SetOutlineWidth(uint16_t width);
420
421   /**
422    * @brief Retrieves the width of an outline
423    *
424    * @return The width of the outline.
425    */
426   uint16_t GetOutlineWidth() const;
427
428   /**
429    * @brief Set the outline blur radius.
430    *
431    * @param[in] outlineBlurRadius The outline blur radius, 0,0 indicates no blur.
432    */
433   void SetOutlineBlurRadius(const float& outlineBlurRadius);
434
435   /**
436    * @brief Retrieve the outline blur radius.
437    *
438    * @return The outline blur radius.
439    */
440   const float& GetOutlineBlurRadius() const;
441
442   /**
443    * @brief Sets the text's background color.
444    *
445    * @param[in] color The text's background color.
446    */
447   void SetBackgroundColor(const Vector4& color);
448
449   /**
450    * @brief Retrieves the text's background color.
451    *
452    * @return The text's background color.
453    */
454   const Vector4& GetBackgroundColor() const;
455
456   /**
457    * @brief Sets whether the text has a background or not.
458    *
459    * @param[in] enabled true if the text has a background.
460    */
461   void SetBackgroundEnabled(bool enabled);
462
463   /**
464    * @brief Returns whether the text has a background or not.
465    *
466    * @return whether the text has a background or not.
467    */
468   bool IsBackgroundEnabled() const;
469
470   /**
471    * @brief Sets whether the text has a markup-processor or not.
472    *
473    * @param[in] enabled true if the text has a markup-processor.
474    */
475   void SetMarkupProcessorEnabled(bool enabled);
476
477   /**
478    * @brief Returns whether the text has a markup-processor or not.
479    *
480    * @return whether the text has a markup-processor or not.
481    */
482   bool IsMarkupProcessorEnabled() const;
483
484   /**
485    * @brief Sets ellipsis position
486    * @param[in] ellipsisPosition The ellipsis position for the text
487    */
488   void SetEllipsisPosition(Toolkit::DevelText::EllipsisPosition::Type ellipsisPosition);
489
490   /**
491    * @brief Retrieves ellipsis position for text.
492    *
493    * @return The ellipsis position.
494    */
495   Toolkit::DevelText::EllipsisPosition::Type GetEllipsisPosition() const;
496
497   /**
498    * @brief Enable or disable the text elide.
499    *
500    * @param[in] enabled Whether to enable the text elide.
501    */
502   void SetTextElideEnabled(bool enabled);
503
504   /**
505    * @brief Whether the text elide property is enabled.
506    *
507    * @return @e true if the text elide property is enabled, @e false otherwise.
508    */
509   bool IsTextElideEnabled() const;
510
511   /**
512    * @brief Sets the start index of laid-out glyphs.
513    *
514    * @param[in] startIndexOfElidedGlyphs The start index of laid-out glyphs.
515    */
516   void SetStartIndexOfElidedGlyphs(GlyphIndex startIndexOfElidedGlyphs);
517
518   /**
519    * @brief Sets the end index of elided glyphs.
520    *
521    * @param[in] endIndexOfElidedGlyphs The end index of elided glyphs.
522    */
523   void SetEndIndexOfElidedGlyphs(GlyphIndex endIndexOfElidedGlyphs);
524
525   /**
526    * @brief Sets the first middle index of elided glyphs, index before ellipsis of middle.
527    *
528    * @param[in] firstMiddleIndexOfElidedGlyphs The first middle index of elided glyphs, index before ellipsis of middle.
529    */
530   void SetFirstMiddleIndexOfElidedGlyphs(GlyphIndex firstMiddleIndexOfElidedGlyphs);
531
532   /**
533    * @brief Sets the second middle index of elided glyphs, index of ellipsis of middle.
534    *
535    * @param[in] secondMiddleIndexOfElidedGlyphs The second middle index of elided glyphs, index of ellipsis of middle.
536    */
537   void SetSecondMiddleIndexOfElidedGlyphs(GlyphIndex secondMiddleIndexOfElidedGlyphs);
538
539   /**
540    * @brief Retrieves the start index of laid-out glyphs.
541    *
542    * @return The start index of laid-out glyphs.
543    */
544   GlyphIndex GetStartIndexOfElidedGlyphs() const;
545
546   /**
547    * @brief Retrieves the end index of laid-out glyphs.
548    *
549    * @return The end index of laid-out glyphs.
550    */
551   GlyphIndex GetEndIndexOfElidedGlyphs() const;
552
553   /**
554    * @brief Retrieves the first middle index of elided glyphs, index before ellipsis of middle.
555    *
556    * @return The first middle index of elided glyphs, index before ellipsis of middle.
557    */
558   GlyphIndex GetFirstMiddleIndexOfElidedGlyphs() const;
559
560   /**
561    * @brief Retrieves the second middle index of elided glyphs, index of ellipsis of middle.
562    *
563    * @return The second middle index of elided glyphs, index of ellipsis of middle.
564    */
565   GlyphIndex GetSecondMiddleIndexOfElidedGlyphs() const;
566
567   /**
568    * @brief Sets the text's strikethrough color.
569    *
570    * @param[in] color The text's strikethrough color.
571    */
572   void SetStrikethroughColor(const Vector4& color);
573
574   /**
575    * @brief Retrieves the text's strikethrough color.
576    *
577    * @return The text's strikethrough color.
578    */
579   const Vector4& GetStrikethroughColor() const;
580
581   /**
582    * @brief Sets the text strikethrough flag.
583    *
584    * @param[in] enabled true if strikethrough.
585    */
586   void SetStrikethroughEnabled(bool enabled);
587
588   /**
589    * @brief Returns whether the text is strikethrough or not.
590    *
591    * @return strikethrough state.
592    */
593   bool IsStrikethroughEnabled() const;
594
595   /**
596    * @brief Set the override used for strikethrough height, 0 indicates height will be come from font metrics
597    *
598    * @param[in] height The height in pixels of the strikethrough
599    */
600   void SetStrikethroughHeight(float height);
601
602   /**
603    * @brief Retrieves the strikethrough height override
604    *
605    * @return Returns the override height for a strikethrough, 0 indicates that font metrics will determine the height
606    */
607   float GetStrikethroughHeight() const;
608   /**
609    * @brief Set the override used for character spacing.
610    *
611    * @note A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).
612    *
613    * @param[in] characterSpacing The character spacing.
614    */
615   void SetCharacterSpacing(float characterSpacing);
616
617   /**
618    * @brief Retrieves the characterSpacing.
619    *
620    * @note A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).
621    *
622    * @return Returns the characterSpacing.
623    */
624   const float GetCharacterSpacing() const;
625
626   /**
627    * @brief Retrieves the Glyphs to Characters Array.
628    *
629    * @return The GlyphsToCharacters.
630    */
631   const Vector<CharacterIndex>& GetGlyphsToCharacters() const;
632
633   /**
634    * @brief Retrieves the strikethrough runs.
635    *
636    * @param[out] strikethroughRuns Pointer to a buffer where the strikethrough runs are copied.
637    * @param[in] index Index of the first strikethrough run to be copied.
638    * @param[in] numberOfRuns Number of strikethrough runs to be copied.
639    */
640   void GetStrikethroughRuns(StrikethroughGlyphRun* strikethroughRuns,
641                             StrikethroughRunIndex  index,
642                             Length                 numberOfRuns) const;
643
644   /**
645    * @brief Retrieves the number of strikethrough runs.
646    *
647    * @return The number of strikethrough runs.
648    */
649   Length GetNumberOfStrikethroughRuns() const;
650
651   /**
652    * @brief Retrieves the number of character-spacing glyph runs.
653    *
654    * @return The number of character-spacing glyph runs.
655    */
656   Length GetNumberOfCharacterSpacingGlyphRuns() const;
657
658   /**
659    * @brief Retrieves the reference for character-spacing glyph runs.
660    *
661    * @return The reference for character-spacing glyph runs.
662    */
663   const Vector<CharacterSpacingGlyphRun>& GetCharacterSpacingGlyphRuns() const;
664
665   /**
666    * @brief Sets the cutout flag.
667    *
668    * @param[in] enable true if cutouted.
669    */
670   void SetCutoutEnabled(bool enable);
671
672   /**
673    * @brief Returns whether the text is cutouted or not.
674    *
675    * @return cutout state.
676    */
677   bool IsCutoutEnabled() const;
678
679   /**
680    * @brief Sets the background with cutout flag.
681    *
682    * @param[in] enable true if background enabled.
683    */
684   void SetBackgroundWithCutoutEnabled(bool enable);
685
686   /**
687    * @brief Returns whether the text is cutouted or not.
688    *
689    * @return True if enabled.
690    */
691   bool IsBackgroundWithCutoutEnabled() const;
692
693   /**
694    * @brief Sets the Color of background with cutout.
695    *
696    * @param[in] color The color to set.
697    */
698   void SetBackgroundColorWithCutout(const Vector4& color);
699
700   /**
701    * @brief Retrieves the Color of background with cutout.
702    *
703    * @return The color.
704    */
705   const Vector4& GetBackgroundColorWithCutout() const;
706
707 protected:
708   /**
709    * @brief A reference counted object may only be deleted by calling Unreference().
710    */
711   virtual ~VisualModel();
712
713 private:
714   /**
715    * @brief Private constructor.
716    */
717   VisualModel();
718
719   // Undefined
720   VisualModel(const VisualModel& handle);
721
722   // Undefined
723   VisualModel& operator=(const VisualModel& handle);
724
725 public:
726   Vector<GlyphInfo>                mGlyphs;                     ///< For each glyph, the font's id, glyph's index within the font and glyph's metrics.
727   Vector<CharacterIndex>           mGlyphsToCharacters;         ///< For each glyph, the index of the first character.
728   Vector<GlyphIndex>               mCharactersToGlyph;          ///< For each character, the index of the first glyph.
729   Vector<Length>                   mCharactersPerGlyph;         ///< For each glyph, the number of characters that form the glyph.
730   Vector<Length>                   mGlyphsPerCharacter;         ///< For each character, the number of glyphs that are shaped.
731   Vector<Vector2>                  mGlyphPositions;             ///< For each glyph, the position.
732   Vector<LineRun>                  mLines;                      ///< The laid out lines.
733   Vector<UnderlinedGlyphRun>       mUnderlineRuns;              ///< Runs of glyphs that are underlined.
734   Vector<Vector4>                  mColors;                     ///< Colors of the glyphs.
735   Vector<ColorIndex>               mColorIndices;               ///< Indices to the vector of colors for each glyphs.
736   Vector<Vector4>                  mBackgroundColors;           ///< Background colors of the glyphs.
737   Vector<ColorIndex>               mBackgroundColorIndices;     ///< Indices to the vector of background colors for each glyphs.
738   Vector4                          mTextColor;                  ///< The text color
739   Vector4                          mShadowColor;                ///< Color of drop shadow
740   Vector4                          mUnderlineColor;             ///< Color of underline
741   Vector4                          mOutlineColor;               ///< Color of outline
742   Vector4                          mBackgroundColor;            ///< Color of text background
743   Vector4                          mStrikethroughColor;         ///< Color of text background
744   Size                             mControlSize;                ///< The size of the UI control.
745   Vector2                          mShadowOffset;               ///< Offset for drop shadow, 0 indicates no shadow
746   Vector2                          mOutlineOffset;              ///< Offset for outline
747   float                            mUnderlineHeight;            ///< Fixed height for underline to override font metrics.
748   float                            mStrikethroughHeight;        ///< Fixed height for strikethrough to override font metrics.
749   Text::Underline::Type            mUnderlineType;              ///< The type of the underline.
750   float                            mDashedUnderlineWidth;       ///< The width of the dashes of the dashed underline.
751   float                            mDashedUnderlineGap;         ///< The gap between the dashes of the dashed underline.
752   float                            mShadowBlurRadius;           ///< Blur radius of shadow, 0 indicates no blur.
753   float                            mOutlineBlurRadius;      ///< Blur radius of outline, 0 indicates no blur.
754   uint16_t                         mOutlineWidth;               ///< Width of outline.
755   Vector<StrikethroughGlyphRun>    mStrikethroughRuns;          ///< Runs of glyphs that have strikethrough.
756   Vector<CharacterSpacingGlyphRun> mCharacterSpacingRuns;       ///< Runs of glyphs that have character-spacing.
757   Vector4                          mBackgroundColorWithCutout;  ///< Background color with cutout.
758
759 private:
760   Size mNaturalSize;    ///< Size of the text with no line wrapping.
761   Size mLayoutSize;     ///< Size of the laid-out text considering the layout properties set.
762   Size mHeightForWidth; ///< Size of the text last calculated using GetHeightForWidth.
763
764   // Caches to increase performance in some consecutive operations.
765   LineIndex mCachedLineIndex; ///< Used to increase performance in consecutive calls to GetLineOfGlyph() or GetLineOfCharacter() with consecutive glyphs or characters.
766
767   DevelText::EllipsisPosition::Type mEllipsisPosition;                ///< Where is the location the text elide
768   GlyphIndex                        mStartIndexOfElidedGlyphs;        ///< The start index of elided glyphs.
769   GlyphIndex                        mEndIndexOfElidedGlyphs;          ///< The end index of elided glyphs.
770   GlyphIndex                        mFirstMiddleIndexOfElidedGlyphs;  ///< The first end index of elided glyphs, index before ellipsis of middle.
771   GlyphIndex                        mSecondMiddleIndexOfElidedGlyphs; ///< The first end index of elided glyphs, index of ellipsis of middle.
772   bool                              mTextElideEnabled : 1;            ///< Whether the text's elide is enabled.
773
774 public:
775   bool       mUnderlineEnabled : 1;             ///< Underline enabled flag
776   bool       mUnderlineColorSet : 1;            ///< Has the underline color been explicitly set?
777   bool       mBackgroundEnabled : 1;            ///< Background enabled flag
778   bool       mMarkupProcessorEnabled : 1;       ///< Markup-processor enabled flag
779   HyphenInfo mHyphen;                           ///< Contains hyphen glyph info & the character index to draw hyphen after.
780   bool       mStrikethroughEnabled : 1;         ///< Strikethrough enabled flag
781   float      mCharacterSpacing;                 ///< Contains the value of the character spacing.
782   bool       mCutoutEnabled : 1;                ///< Cutout enabled flag
783   bool       mBackgroundWithCutoutEnabled : 1;  ///< Background with cutout enabled flag.
784 };
785
786 } // namespace Text
787
788 } // namespace Toolkit
789
790 } // namespace Dali
791
792 #endif // DALI_TOOLKIT_TEXT_VISUAL_MODEL_IMPL_H