[NUI] Add CursorPositionChanged Event (#3400)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextLabel.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
20
21 using System;
22 using System.Globalization;
23 using System.ComponentModel;
24 using Tizen.NUI.Text;
25
26 namespace Tizen.NUI.BaseComponents
27 {
28     /// <summary>
29     /// A control which renders a short text string.<br />
30     /// Text labels are lightweight, non-editable, and do not respond to the user input.<br />
31     /// </summary>
32     /// <since_tizen> 3 </since_tizen>
33     public partial class TextLabel : View
34     {
35         private class TextLayout : LayoutItem
36         {
37             protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
38             {
39                 // Padding will be automatically applied by DALi TextLabel.
40                 float totalWidth = widthMeasureSpec.Size.AsDecimal();
41                 float totalHeight = heightMeasureSpec.Size.AsDecimal();
42
43                 if (widthMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly)
44                 {
45                     if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly)
46                     {
47                         totalHeight = Owner.GetHeightForWidth(totalWidth);
48                         heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
49                     }
50                 }
51                 else
52                 {
53                     var minSize = Owner.MinimumSize;
54                     var maxSize = Owner.MaximumSize;
55                     var naturalSize = Owner.GetNaturalSize();
56
57                     if (heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly)
58                     {
59                         // GetWidthForHeight is not implemented.
60                         totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), (maxSize.Width < 0 ? Int32.MaxValue : maxSize.Width));
61                         widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
62                     }
63                     else
64                     {
65                         totalWidth = Math.Min(Math.Max(naturalSize.Width, minSize.Width), (maxSize.Width < 0 ? Int32.MaxValue : maxSize.Width));
66                         totalHeight = Math.Min(Math.Max(naturalSize.Height, minSize.Height), (maxSize.Height < 0 ? Int32.MaxValue : maxSize.Height));
67
68                         heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly);
69                         widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly);
70                     }
71                 }
72
73                 MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK;
74                 MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK;
75
76                 SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState),
77                                        ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState));
78             }
79         }
80
81         static TextLabel() { }
82
83         private string textLabelSid = null;
84         private bool systemlangTextFlag = false;
85         private TextLabelSelectorData selectorData;
86         private float fontSizeScale = 1.0f;
87         private bool hasFontSizeChangedCallback = false;
88
89         /// <summary>
90         /// Creates the TextLabel control.
91         /// </summary>
92         /// <since_tizen> 3 </since_tizen>
93         public TextLabel() : this(Interop.TextLabel.New(), true)
94         {
95             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96         }
97
98         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
99         [EditorBrowsable(EditorBrowsableState.Never)]
100         public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.New(), true, viewStyle)
101         {
102         }
103
104         /// <summary>
105         /// Creates the TextLabel with setting the status of shown or hidden.
106         /// </summary>
107         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
108         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
109         [EditorBrowsable(EditorBrowsableState.Never)]
110         public TextLabel(bool shown) : this(Interop.TextLabel.New(), true)
111         {
112             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113             SetVisible(shown);
114         }
115
116         /// <summary>
117         /// Creates the TextLabel control.
118         /// </summary>
119         /// <param name="text">The text to display</param>
120         /// <since_tizen> 3 </since_tizen>
121         public TextLabel(string text) : this(Interop.TextLabel.New(text), true)
122         {
123             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124         }
125
126         /// <summary>
127         /// Creates the TextLabel with setting the status of shown or hidden.
128         /// </summary>
129         /// <param name="text">The text to display</param>
130         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
131         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
132         [EditorBrowsable(EditorBrowsableState.Never)]
133         public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text), true)
134         {
135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136             SetVisible(shown);
137         }
138
139         internal TextLabel(TextLabel handle, bool shown = true) : this(Interop.TextLabel.NewTextLabel(TextLabel.getCPtr(handle)), true)
140         {
141             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142
143             if (!shown)
144             {
145                 SetVisible(false);
146             }
147         }
148
149         internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(cPtr, cMemoryOwn, viewStyle)
150         {
151             if (!shown)
152             {
153                 SetVisible(false);
154             }
155         }
156
157         internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn, null)
158         {
159             if (!shown)
160             {
161                 SetVisible(false);
162             }
163         }
164
165         /// <summary>
166         /// Create internal layout of TextLabel
167         /// </summary>
168         internal LayoutItem CreateTextLayout()
169         {
170             return new TextLayout();
171         }
172
173         /// <summary>
174         /// The TranslatableText property.<br />
175         /// The text can set the SID value.<br />
176         /// </summary>
177         /// <exception cref='ArgumentNullException'>
178         /// ResourceManager about multilingual is null.
179         /// </exception>
180         /// <since_tizen> 4 </since_tizen>
181         public string TranslatableText
182         {
183             get
184             {
185                 return (string)GetValue(TranslatableTextProperty);
186             }
187             set
188             {
189                 SetValue(TranslatableTextProperty, value);
190             }
191         }
192         private string translatableText
193         {
194             get
195             {
196                 return textLabelSid;
197             }
198             set
199             {
200                 if (NUIApplication.MultilingualResourceManager == null)
201                 {
202                     throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
203                 }
204                 string translatableText = null;
205                 textLabelSid = value;
206                 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
207                 if (translatableText != null)
208                 {
209                     Text = translatableText;
210                     if (systemlangTextFlag == false)
211                     {
212                         SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
213                         systemlangTextFlag = true;
214                     }
215                 }
216                 else
217                 {
218                     Text = "";
219                 }
220                 NotifyPropertyChanged();
221             }
222         }
223
224         /// <summary>
225         /// The Text property.<br />
226         /// The text to display in the UTF-8 format.<br />
227         /// </summary>
228         /// <since_tizen> 3 </since_tizen>
229         public string Text
230         {
231             get
232             {
233                 return (string)GetValue(TextProperty);
234             }
235             set
236             {
237                 SetValue(TextProperty, value);
238                 NotifyPropertyChanged();
239             }
240         }
241
242         /// <summary>
243         /// The FontFamily property.<br />
244         /// The requested font family to use.<br />
245         /// </summary>
246         /// <since_tizen> 3 </since_tizen>
247         public string FontFamily
248         {
249             get
250             {
251                 return (string)GetValue(FontFamilyProperty);
252             }
253             set
254             {
255                 SetValue(FontFamilyProperty, value);
256                 NotifyPropertyChanged();
257             }
258         }
259
260         /// <summary>
261         /// The FontStyle property.<br />
262         /// The requested font style to use.<br />
263         /// The fontStyle map contains the following keys :<br />
264         /// <list type="table">
265         /// <item><term>width (string)</term><description>The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)</description></item>
266         /// <item><term>weight (string)</term><description>The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)</description></item>
267         /// <item><term>slant (string)</term><description>The slant key defines whether to use italics. (values: normal, roman, italic, oblique)</description></item>
268         /// </list>
269         /// </summary>
270         /// <since_tizen> 3 </since_tizen>
271         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
272         public PropertyMap FontStyle
273         {
274             get
275             {
276                 return (PropertyMap)GetValue(FontStyleProperty);
277             }
278             set
279             {
280                 SetValue(FontStyleProperty, value);
281                 NotifyPropertyChanged();
282             }
283         }
284
285         /// <summary>
286         /// Set FontStyle to TextLabel. <br />
287         /// </summary>
288         /// <param name="fontStyle">The FontStyle</param>
289         /// <remarks>
290         /// SetFontStyle specifies the requested font style through <see cref="Tizen.NUI.Text.FontStyle"/>. <br />
291         /// </remarks>
292         /// <example>
293         /// The following example demonstrates how to use the SetFontStyle method.
294         /// <code>
295         /// var fontStyle = new Tizen.NUI.Text.FontStyle();
296         /// fontStyle.Width = FontWidthType.Expanded;
297         /// fontStyle.Weight = FontWeightType.Bold;
298         /// fontStyle.Slant = FontSlantType.Italic;
299         /// label.SetFontStyle(fontStyle);
300         /// </code>
301         /// </example>
302         [EditorBrowsable(EditorBrowsableState.Never)]
303         public void SetFontStyle(FontStyle fontStyle)
304         {
305             SetProperty(TextLabel.Property.FontStyle, new PropertyValue(TextUtils.GetFontStyleMap(fontStyle)));
306         }
307
308         /// <summary>
309         /// Get FontStyle from TextLabel. <br />
310         /// </summary>
311         /// <returns>The FontStyle</returns>
312         /// <remarks>
313         /// <see cref="Tizen.NUI.Text.FontStyle"/>
314         /// </remarks>
315         [EditorBrowsable(EditorBrowsableState.Never)]
316         public FontStyle GetFontStyle()
317         {
318             var map = new PropertyMap();
319             GetProperty(TextLabel.Property.FontStyle).Get(map);
320             return TextUtils.GetFontStyleStruct(map);
321         }
322
323         /// <summary>
324         /// The PointSize property.<br />
325         /// The size of font in points.<br />
326         /// </summary>
327         /// <since_tizen> 3 </since_tizen>
328         public float PointSize
329         {
330             get
331             {
332                 return (float)GetValue(PointSizeProperty);
333             }
334             set
335             {
336                 SetValue(PointSizeProperty, value);
337                 NotifyPropertyChanged();
338             }
339         }
340
341         /// <summary>
342         /// The MultiLine property.<br />
343         /// The single-line or multi-line layout option.<br />
344         /// </summary>
345         /// <since_tizen> 3 </since_tizen>
346         public bool MultiLine
347         {
348             get
349             {
350                 return (bool)GetValue(MultiLineProperty);
351             }
352             set
353             {
354                 SetValue(MultiLineProperty, value);
355                 NotifyPropertyChanged();
356             }
357         }
358
359         /// <summary>
360         /// The HorizontalAlignment property.<br />
361         /// The line horizontal alignment.<br />
362         /// </summary>
363         /// <since_tizen> 3 </since_tizen>
364         public HorizontalAlignment HorizontalAlignment
365         {
366             get
367             {
368                 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
369             }
370             set
371             {
372                 SetValue(HorizontalAlignmentProperty, value);
373                 NotifyPropertyChanged();
374             }
375         }
376
377         /// <summary>
378         /// The VerticalAlignment property.<br />
379         /// The line vertical alignment.<br />
380         /// </summary>
381         /// <since_tizen> 3 </since_tizen>
382         public VerticalAlignment VerticalAlignment
383         {
384             get
385             {
386                 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
387             }
388             set
389             {
390                 SetValue(VerticalAlignmentProperty, value);
391                 NotifyPropertyChanged();
392             }
393         }
394
395         /// <summary>
396         /// The TextColor property.<br />
397         /// The color of the text.<br />
398         /// Animation framework can be used to change the color of the text when not using mark up.<br />
399         /// Cannot animate the color when text is auto scrolling.<br />
400         /// </summary>
401         /// <remarks>
402         /// The property cascade chaining set is possible. For example, this (textLabel.TextColor.X = 0.1f;) is possible.
403         /// </remarks>
404         /// <since_tizen> 3 </since_tizen>
405         public Color TextColor
406         {
407             get
408             {
409                 Color temp = (Color)GetValue(TextColorProperty);
410                 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
411             }
412             set
413             {
414                 SetValue(TextColorProperty, value);
415                 NotifyPropertyChanged();
416             }
417         }
418
419         /// <summary>
420         /// The ShadowOffset property.<br />
421         /// The drop shadow offset 0 indicates no shadow.<br />
422         /// </summary>
423         /// <since_tizen> 3 </since_tizen>
424         /// <remarks>
425         /// Deprecated.(API Level 6) Use Shadow instead.
426         /// The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible.
427         /// </remarks>
428         [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
429         public Vector2 ShadowOffset
430         {
431             get
432             {
433                 Vector2 shadowOffset = new Vector2();
434                 Shadow.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset);
435                 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
436             }
437             set
438             {
439                 PropertyMap temp = new PropertyMap();
440                 temp.Insert("offset", new PropertyValue(value));
441
442                 PropertyMap shadowMap = Shadow;
443                 shadowMap.Merge(temp);
444
445                 SetValue(ShadowProperty, shadowMap);
446                 NotifyPropertyChanged();
447             }
448         }
449
450         /// <summary>
451         /// The ShadowColor property.<br />
452         /// The color of a drop shadow.<br />
453         /// </summary>
454         /// <since_tizen> 3 </since_tizen>
455         /// <remarks>
456         /// Deprecated.(API Level 6) Use Shadow instead.
457         /// The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible.
458         /// </remarks>
459         [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
460         public Vector4 ShadowColor
461         {
462             get
463             {
464                 Vector4 shadowColor = new Vector4();
465                 Shadow.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor);
466                 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
467             }
468             set
469             {
470                 PropertyMap temp = new PropertyMap();
471                 temp.Insert("color", new PropertyValue(value));
472
473                 PropertyMap shadowMap = Shadow;
474                 shadowMap.Merge(temp);
475
476                 SetValue(ShadowProperty, shadowMap);
477                 NotifyPropertyChanged();
478             }
479         }
480
481         /// <summary>
482         /// The UnderlineEnabled property.<br />
483         /// The underline enabled flag.<br />
484         /// </summary>
485         /// <since_tizen> 3 </since_tizen>
486         /// <remarks>
487         /// Deprecated.(API Level 6) Use Underline instead.
488         /// </remarks>
489         [Obsolete("Please do not use this UnderlineEnabled(Deprecated). Please use Underline instead.")]
490         public bool UnderlineEnabled
491         {
492             get
493             {
494                 bool underlineEnabled = false;
495                 Underline.Find(TextLabel.Property.UNDERLINE, "enable")?.Get(out underlineEnabled);
496                 return underlineEnabled;
497             }
498             set
499             {
500                 PropertyMap temp = new PropertyMap();
501                 temp.Add("enable", new PropertyValue(value));
502
503                 PropertyMap undelineMap = Underline;
504                 undelineMap.Merge(temp);
505
506                 SetValue(UnderlineProperty, undelineMap);
507                 NotifyPropertyChanged();
508
509             }
510         }
511
512         /// <summary>
513         /// The UnderlineColor property.<br />
514         /// Overrides the underline height from font metrics.<br />
515         /// </summary>
516         /// <since_tizen> 3 </since_tizen>
517         /// <remarks>
518         /// Deprecated.(API Level 6) Use Underline instead.
519         /// The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible.
520         /// </remarks>
521         [Obsolete("Please do not use this UnderlineColor(Deprecated). Please use Underline instead.")]
522         public Vector4 UnderlineColor
523         {
524             get
525             {
526                 Vector4 underlineColor = new Vector4();
527                 Underline.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor);
528                 return new Vector4(OnUnderlineColorChanged, underlineColor.X, underlineColor.Y, underlineColor.Z, underlineColor.W);
529             }
530             set
531             {
532                 PropertyMap temp = new PropertyMap();
533                 temp.Insert("color", new PropertyValue(value));
534
535                 PropertyMap undelineMap = Underline;
536                 undelineMap.Merge(temp);
537
538                 SetValue(UnderlineProperty, undelineMap);
539                 NotifyPropertyChanged();
540             }
541         }
542
543         /// <summary>
544         /// The UnderlineHeight property.<br />
545         /// Overrides the underline height from font metrics.<br />
546         /// </summary>
547         /// <since_tizen> 3 </since_tizen>
548         /// <remarks>
549         /// Deprecated.(API Level 6) Use Underline instead.
550         /// </remarks>
551         [Obsolete("Please do not use this UnderlineHeight(Deprecated). Please use Underline instead.")]
552         public float UnderlineHeight
553         {
554             get
555             {
556                 float underlineHeight = 0.0f;
557                 Underline.Find(TextLabel.Property.UNDERLINE, "height")?.Get(out underlineHeight);
558                 return underlineHeight;
559             }
560             set
561             {
562                 PropertyMap temp = new PropertyMap();
563                 temp.Insert("height", new PropertyValue(value));
564
565                 PropertyMap undelineMap = Underline;
566                 undelineMap.Merge(temp);
567
568                 SetValue(UnderlineProperty, undelineMap);
569                 NotifyPropertyChanged();
570             }
571         }
572
573         /// <summary>
574         /// The EnableMarkup property.<br />
575         /// Whether the mark-up processing is enabled.<br />
576         /// </summary>
577         /// <since_tizen> 3 </since_tizen>
578         public bool EnableMarkup
579         {
580             get
581             {
582                 return (bool)GetValue(EnableMarkupProperty);
583             }
584             set
585             {
586                 SetValue(EnableMarkupProperty, value);
587                 NotifyPropertyChanged();
588             }
589         }
590
591         /// <summary>
592         /// The EnableAutoScroll property.<br />
593         /// Starts or stops auto scrolling.<br />
594         /// </summary>
595         /// <since_tizen> 3 </since_tizen>
596         public bool EnableAutoScroll
597         {
598             get
599             {
600                 return (bool)GetValue(EnableAutoScrollProperty);
601             }
602             set
603             {
604                 SetValue(EnableAutoScrollProperty, value);
605                 NotifyPropertyChanged();
606             }
607         }
608
609         /// <summary>
610         /// The AutoScrollSpeed property.<br />
611         /// Sets the speed of scrolling in pixels per second.<br />
612         /// </summary>
613         /// <since_tizen> 3 </since_tizen>
614         public int AutoScrollSpeed
615         {
616             get
617             {
618                 return (int)GetValue(AutoScrollSpeedProperty);
619             }
620             set
621             {
622                 SetValue(AutoScrollSpeedProperty, value);
623                 NotifyPropertyChanged();
624             }
625         }
626
627         /// <summary>
628         /// The AutoScrollLoopCount property.<br />
629         /// Number of complete loops when scrolling enabled.<br />
630         /// </summary>
631         /// <since_tizen> 3 </since_tizen>
632         public int AutoScrollLoopCount
633         {
634             get
635             {
636                 return (int)GetValue(AutoScrollLoopCountProperty);
637             }
638             set
639             {
640                 SetValue(AutoScrollLoopCountProperty, value);
641                 NotifyPropertyChanged();
642             }
643         }
644
645         /// <summary>
646         /// The AutoScrollGap property.<br />
647         /// Gap before scrolling wraps.<br />
648         /// </summary>
649         /// <since_tizen> 3 </since_tizen>
650         public float AutoScrollGap
651         {
652             get
653             {
654                 return (float)GetValue(AutoScrollGapProperty);
655             }
656             set
657             {
658                 SetValue(AutoScrollGapProperty, value);
659                 NotifyPropertyChanged();
660             }
661         }
662
663         /// <summary>
664         /// The LineSpacing property.<br />
665         /// The default extra space between lines in points.<br />
666         /// </summary>
667         /// <since_tizen> 3 </since_tizen>
668         public float LineSpacing
669         {
670             get
671             {
672                 return (float)GetValue(LineSpacingProperty);
673             }
674             set
675             {
676                 SetValue(LineSpacingProperty, value);
677                 NotifyPropertyChanged();
678             }
679         }
680
681         /// <summary>
682         /// The Underline property.<br />
683         /// The default underline parameters.<br />
684         /// The underline map contains the following keys :<br />
685         /// <list type="table">
686         /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
687         /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
688         /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
689         /// </list>
690         /// </summary>
691         /// <since_tizen> 3 </since_tizen>
692         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
693         public PropertyMap Underline
694         {
695             get
696             {
697                 return (PropertyMap)GetValue(UnderlineProperty);
698             }
699             set
700             {
701                 SetValue(UnderlineProperty, value);
702                 NotifyPropertyChanged();
703             }
704         }
705
706         /// <summary>
707         /// Set Underline to TextLabel. <br />
708         /// </summary>
709         /// <param name="underline">The Underline</param>
710         /// <remarks>
711         /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
712         /// </remarks>
713         /// <example>
714         /// The following example demonstrates how to use the SetUnderline method.
715         /// <code>
716         /// var underline = new Tizen.NUI.Text.Underline();
717         /// underline.Enable = true;
718         /// underline.Color = new Color("#3498DB");
719         /// underline.Height = 2.0f;
720         /// label.SetUnderline(underline);
721         /// </code>
722         /// </example>
723         [EditorBrowsable(EditorBrowsableState.Never)]
724         public void SetUnderline(Underline underline)
725         {
726             SetProperty(TextLabel.Property.UNDERLINE, new PropertyValue(TextUtils.GetUnderlineMap(underline)));
727         }
728
729         /// <summary>
730         /// Get Underline from TextLabel. <br />
731         /// </summary>
732         /// <returns>The Underline</returns>
733         /// <remarks>
734         /// <see cref="Tizen.NUI.Text.Underline"/>
735         /// </remarks>
736         [EditorBrowsable(EditorBrowsableState.Never)]
737         public Underline GetUnderline()
738         {
739             var map = new PropertyMap();
740             GetProperty(TextLabel.Property.UNDERLINE).Get(map);
741             return TextUtils.GetUnderlineStruct(map);
742         }
743
744         /// <summary>
745         /// The Shadow property.<br />
746         /// The default shadow parameters.<br />
747         /// The shadow map contains the following keys :<br />
748         /// <list type="table">
749         /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
750         /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
751         /// <item><term>blurRadius (float)</term><description>The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled)</description></item>
752         /// </list>
753         /// </summary>
754         /// <since_tizen> 3 </since_tizen>
755         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
756         public PropertyMap Shadow
757         {
758             get
759             {
760                 return (PropertyMap)GetValue(ShadowProperty);
761             }
762             set
763             {
764                 SetValue(ShadowProperty, value);
765                 NotifyPropertyChanged();
766             }
767         }
768
769         /// <summary>
770         /// Set Shadow to TextLabel. <br />
771         /// </summary>
772         /// <param name="shadow">The Shadow</param>
773         /// <remarks>
774         /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
775         /// </remarks>
776         /// <example>
777         /// The following example demonstrates how to use the SetShadow method.
778         /// <code>
779         /// var shadow = new Tizen.NUI.Text.Shadow();
780         /// shadow.Offset = new Vector2(3, 3);
781         /// shadow.Color = new Color("#F1C40F");
782         /// shadow.BlurRadius = 4.0f;
783         /// label.SetShadow(shadow);
784         /// </code>
785         /// </example>
786         [EditorBrowsable(EditorBrowsableState.Never)]
787         public void SetShadow(Tizen.NUI.Text.Shadow shadow)
788         {
789             SetProperty(TextLabel.Property.SHADOW, new PropertyValue(TextUtils.GetShadowMap(shadow)));
790         }
791
792         /// <summary>
793         /// Get Shadow from TextLabel. <br />
794         /// </summary>
795         /// <returns>The Shadow</returns>
796         /// <remarks>
797         /// <see cref="Tizen.NUI.Text.Shadow"/>
798         /// </remarks>
799         [EditorBrowsable(EditorBrowsableState.Never)]
800         public Tizen.NUI.Text.Shadow GetShadow()
801         {
802             var map = new PropertyMap();
803             GetProperty(TextLabel.Property.SHADOW).Get(map);
804             return TextUtils.GetShadowStruct(map);
805         }
806
807         /// <summary>
808         /// Describes a text shadow for a TextLabel.
809         /// It is null by default.
810         /// </summary>
811         [EditorBrowsable(EditorBrowsableState.Never)]
812         public TextShadow TextShadow
813         {
814             get
815             {
816                 return (TextShadow)GetValue(TextShadowProperty);
817             }
818             set
819             {
820                 SetValue(TextShadowProperty, value);
821                 NotifyPropertyChanged();
822             }
823         }
824
825         /// <summary>
826         /// The Emboss property.<br />
827         /// The default emboss parameters.<br />
828         /// </summary>
829         /// <since_tizen> 3 </since_tizen>
830         public string Emboss
831         {
832             get
833             {
834                 return (string)GetValue(EmbossProperty);
835             }
836             set
837             {
838                 SetValue(EmbossProperty, value);
839                 NotifyPropertyChanged();
840             }
841         }
842
843         /// <summary>
844         /// The Outline property.<br />
845         /// The default outline parameters.<br />
846         /// The outline map contains the following keys :<br />
847         /// <list type="table">
848         /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
849         /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
850         /// </list>
851         /// </summary>
852         /// <since_tizen> 3 </since_tizen>
853         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
854         public PropertyMap Outline
855         {
856             get
857             {
858                 return (PropertyMap)GetValue(OutlineProperty);
859             }
860             set
861             {
862                 SetValue(OutlineProperty, value);
863                 NotifyPropertyChanged();
864             }
865         }
866
867         /// <summary>
868         /// Set Outline to TextLabel. <br />
869         /// </summary>
870         /// <param name="outline">The Outline</param>
871         /// <remarks>
872         /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
873         /// </remarks>
874         /// <example>
875         /// The following example demonstrates how to use the SetOutline method.
876         /// <code>
877         /// var outline = new Tizen.NUI.Text.Outline();
878         /// outline.Width = 2.0f;
879         /// outline.Color = new Color("#45B39D");
880         /// label.SetOutline(outline);
881         /// </code>
882         /// </example>
883         [EditorBrowsable(EditorBrowsableState.Never)]
884         public void SetOutline(Outline outline)
885         {
886             SetProperty(TextLabel.Property.OUTLINE, new PropertyValue(TextUtils.GetOutlineMap(outline)));
887         }
888
889         /// <summary>
890         /// Get Outline from TextLabel. <br />
891         /// </summary>
892         /// <returns>The Outline</returns>
893         /// <remarks>
894         /// <see cref="Tizen.NUI.Text.Outline"/>
895         /// </remarks>
896         [EditorBrowsable(EditorBrowsableState.Never)]
897         public Outline GetOutline()
898         {
899             var map = new PropertyMap();
900             GetProperty(TextLabel.Property.OUTLINE).Get(map);
901             return TextUtils.GetOutlineStruct(map);
902         }
903
904         /// <summary>
905         /// The PixelSize property.<br />
906         /// The size of font in pixels.<br />
907         /// </summary>
908         /// <since_tizen> 3 </since_tizen>
909         public float PixelSize
910         {
911             get
912             {
913                 return (float)GetValue(PixelSizeProperty);
914             }
915             set
916             {
917                 SetValue(PixelSizeProperty, value);
918                 NotifyPropertyChanged();
919             }
920         }
921
922         /// <summary>
923         /// The Ellipsis property.<br />
924         /// Enable or disable the ellipsis.<br />
925         /// </summary>
926         /// <since_tizen> 3 </since_tizen>
927         public bool Ellipsis
928         {
929             get
930             {
931                 return (bool)GetValue(EllipsisProperty);
932             }
933             set
934             {
935                 SetValue(EllipsisProperty, value);
936                 NotifyPropertyChanged();
937             }
938         }
939
940         /// <summary>
941         /// The ellipsis position of the text.
942         /// The ellipsis position type when the text size over the layout size.<br />
943         /// The ellipsis position: End, Start or Middle.<br />
944         /// </summary>
945         [EditorBrowsable(EditorBrowsableState.Never)]
946         public EllipsisPosition EllipsisPosition
947         {
948             get
949             {
950                 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
951             }
952             set
953             {
954                 SetValue(EllipsisPositionProperty, value);
955                 NotifyPropertyChanged();
956             }
957         }
958
959         /// <summary>
960         /// The AutoScrollLoopDelay property.<br />
961         /// Do something.<br />
962         /// </summary>
963         /// <since_tizen> 3 </since_tizen>
964         public float AutoScrollLoopDelay
965         {
966             get
967             {
968                 return (float)GetValue(AutoScrollLoopDelayProperty);
969             }
970             set
971             {
972                 SetValue(AutoScrollLoopDelayProperty, value);
973                 NotifyPropertyChanged();
974             }
975         }
976
977         /// <summary>
978         /// The AutoScrollStopMode property.<br />
979         /// Do something.<br />
980         /// </summary>
981         /// <since_tizen> 3 </since_tizen>
982         public AutoScrollStopMode AutoScrollStopMode
983         {
984             get
985             {
986                 return (AutoScrollStopMode)GetValue(AutoScrollStopModeProperty);
987             }
988             set
989             {
990                 SetValue(AutoScrollStopModeProperty, value);
991                 NotifyPropertyChanged();
992             }
993         }
994
995         /// <summary>
996         /// The line count of the text.
997         /// </summary>
998         /// <since_tizen> 3 </since_tizen>
999         public int LineCount
1000         {
1001             get
1002             {
1003                 int temp = 0;
1004                 GetProperty(TextLabel.Property.LineCount).Get(out temp);
1005                 return temp;
1006             }
1007         }
1008
1009         /// <summary>
1010         /// The LineWrapMode property.<br />
1011         /// line wrap mode when the text lines over layout width.<br />
1012         /// </summary>
1013         /// <since_tizen> 4 </since_tizen>
1014         public LineWrapMode LineWrapMode
1015         {
1016             get
1017             {
1018                 return (LineWrapMode)GetValue(LineWrapModeProperty);
1019             }
1020             set
1021             {
1022                 SetValue(LineWrapModeProperty, value);
1023                 NotifyPropertyChanged();
1024             }
1025         }
1026
1027         /// <summary>
1028         /// The direction of the text such as left to right or right to left.
1029         /// </summary>
1030         /// <since_tizen> 5 </since_tizen>
1031         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1032         [EditorBrowsable(EditorBrowsableState.Never)]
1033         public TextDirection TextDirection
1034         {
1035             get
1036             {
1037                 int temp = 0;
1038                 GetProperty(TextLabel.Property.TextDirection).Get(out temp);
1039                 return (TextDirection)temp;
1040             }
1041         }
1042
1043         /// <summary>
1044         /// The vertical line alignment of the text.
1045         /// </summary>
1046         /// <since_tizen> 5 </since_tizen>
1047         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1048         [EditorBrowsable(EditorBrowsableState.Never)]
1049         public VerticalLineAlignment VerticalLineAlignment
1050         {
1051             get
1052             {
1053                 return (VerticalLineAlignment)GetValue(VerticalLineAlignmentProperty);
1054             }
1055             set
1056             {
1057                 SetValue(VerticalLineAlignmentProperty, value);
1058                 NotifyPropertyChanged();
1059             }
1060         }
1061
1062         /// <summary>
1063         /// The text alignment to match the direction of the system language.
1064         /// </summary>
1065         /// <since_tizen> 6 </since_tizen>
1066         public bool MatchSystemLanguageDirection
1067         {
1068             get
1069             {
1070                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1071             }
1072             set
1073             {
1074                 SetValue(MatchSystemLanguageDirectionProperty, value);
1075                 NotifyPropertyChanged();
1076             }
1077         }
1078
1079         /// <summary>
1080         /// The text fit parameters.<br />
1081         /// The textFit map contains the following keys :<br />
1082         /// <list type="table">
1083         /// <item><term>enable (bool)</term><description>True to enable the text fit or false to disable (the default value is false)</description></item>
1084         /// <item><term>minSize (float)</term><description>Minimum Size for text fit (the default value is 10.f)</description></item>
1085         /// <item><term>maxSize (float)</term><description>Maximum Size for text fit (the default value is 100.f)</description></item>
1086         /// <item><term>stepSize (float)</term><description>Step Size for font increase (the default value is 1.f)</description></item>
1087         /// <item><term>fontSize (string)</term><description>The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize")</description></item>
1088         /// </list>
1089         /// </summary>
1090         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1091         [EditorBrowsable(EditorBrowsableState.Never)]
1092         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1093         public PropertyMap TextFit
1094         {
1095             get
1096             {
1097                 return (PropertyMap)GetValue(TextFitProperty);
1098             }
1099             set
1100             {
1101                 SetValue(TextFitProperty, value);
1102                 NotifyPropertyChanged();
1103             }
1104         }
1105
1106         /// <summary>
1107         /// Set TextFit to TextLabel. <br />
1108         /// </summary>
1109         /// <param name="textFit">The TextFit</param>
1110         /// <remarks>
1111         /// SetTextFit specifies the textFit of the text through <see cref="Tizen.NUI.Text.TextFit"/>. <br />
1112         /// </remarks>
1113         /// <example>
1114         /// The following example demonstrates how to use the SetTextFit method.
1115         /// <code>
1116         /// var textFit = new Tizen.NUI.Text.TextFit();
1117         /// textFit.Enable = true;
1118         /// textFit.MinSize = 10.0f;
1119         /// textFit.MaxSize = 100.0f;
1120         /// textFit.StepSize = 5.0f;
1121         /// textFit.FontSizeType = FontSizeType.PointSize;
1122         /// label.SetTextFit(textFit);
1123         /// </code>
1124         /// </example>
1125         [EditorBrowsable(EditorBrowsableState.Never)]
1126         public void SetTextFit(TextFit textFit)
1127         {
1128             SetProperty(TextLabel.Property.TextFit, new PropertyValue(TextUtils.GetTextFitMap(textFit)));
1129         }
1130
1131         /// <summary>
1132         /// Get TextFit from TextLabel. <br />
1133         /// </summary>
1134         /// <returns>The TextFit</returns>
1135         /// <remarks>
1136         /// TextFit is always returned based on PointSize. <br />
1137         /// If the user sets FontSizeType to PixelSize, then MinSize, MaxSize, and StepSize are converted based on PointSize and returned. <br />
1138         /// <see cref="Tizen.NUI.Text.TextFit"/>
1139         /// </remarks>
1140         [EditorBrowsable(EditorBrowsableState.Never)]
1141         public TextFit GetTextFit()
1142         {
1143             var map = new PropertyMap();
1144             GetProperty(TextLabel.Property.TextFit).Get(map);
1145             return TextUtils.GetTextFitStruct(map);
1146         }
1147
1148         /// <summary>
1149         /// The MinLineSize property.<br />
1150         /// </summary>
1151         /// <since_tizen> 8 </since_tizen>
1152         [EditorBrowsable(EditorBrowsableState.Never)]
1153         public float MinLineSize
1154         {
1155             get
1156             {
1157                 return (float)GetValue(MinLineSizeProperty);
1158             }
1159             set
1160             {
1161                 SetValue(MinLineSizeProperty, value);
1162                 NotifyPropertyChanged();
1163             }
1164         }
1165
1166         /// <summary>
1167         /// The FontSizeScale property. <br />
1168         /// The default value is 1.0. <br />
1169         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1170         /// </summary>
1171         /// <since_tizen> 9 </since_tizen>
1172         public float FontSizeScale
1173         {
1174             get
1175             {
1176                 return fontSizeScale;
1177             }
1178             set
1179             {
1180                 float newFontSizeScale;
1181
1182                 if (fontSizeScale == value) return;
1183
1184                 fontSizeScale = value;
1185                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1186                 {
1187                     SystemSettingsFontSize systemSettingsFontSize;
1188
1189                     try
1190                     {
1191                         systemSettingsFontSize = SystemSettings.FontSize;
1192                     }
1193                     catch (Exception e)
1194                     {
1195                         Console.WriteLine("{0} Exception caught.", e);
1196                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
1197                     }
1198                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1199                     addFontSizeChangedCallback();
1200                 }
1201                 else
1202                 {
1203                     newFontSizeScale = fontSizeScale;
1204                     removeFontSizeChangedCallback();
1205                 }
1206
1207                 SetValue(FontSizeScaleProperty, newFontSizeScale);
1208                 NotifyPropertyChanged();
1209             }
1210         }
1211
1212         private TextLabelSelectorData EnsureSelectorData() => selectorData ?? (selectorData = new TextLabelSelectorData());
1213
1214         /// <summary>
1215         /// Downcasts a handle to textLabel handle
1216         /// </summary>
1217         /// <param name="handle"></param>
1218         /// <returns></returns>
1219         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
1220         /// <since_tizen> 3 </since_tizen>
1221         /// Please do not use! this will be deprecated!
1222         /// Instead please use as keyword.
1223         [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
1224             "Like: " +
1225             "BaseHandle handle = new TextLabel(\"Hello World!\"); " +
1226             "TextLabel label = handle as TextLabel")]
1227         [EditorBrowsable(EditorBrowsableState.Never)]
1228         public static TextLabel DownCast(BaseHandle handle)
1229         {
1230             if (null == handle)
1231             {
1232                 throw new ArgumentNullException(nameof(handle));
1233             }
1234             TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
1235             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1236             return ret;
1237         }
1238
1239         /// <inheritdoc/>
1240         [EditorBrowsable(EditorBrowsableState.Never)]
1241         protected override void Dispose(DisposeTypes type)
1242         {
1243             if (disposed)
1244             {
1245                 return;
1246             }
1247
1248             if (systemlangTextFlag)
1249             {
1250                 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
1251             }
1252
1253             removeFontSizeChangedCallback();
1254
1255             if (type == DisposeTypes.Explicit)
1256             {
1257                 //Called by User
1258                 //Release your own managed resources here.
1259                 //You should release all of your own disposable objects here.
1260                 selectorData?.Reset(this);
1261             }
1262
1263             base.Dispose(type);
1264         }
1265
1266         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
1267         {
1268             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
1269         }
1270
1271         /// This will not be public opened.
1272         [EditorBrowsable(EditorBrowsableState.Never)]
1273         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1274         {
1275             Interop.TextLabel.DeleteTextLabel(swigCPtr);
1276         }
1277
1278         /// <summary>
1279         /// Get attribues, it is abstract function and must be override.
1280         /// </summary>
1281         [EditorBrowsable(EditorBrowsableState.Never)]
1282         protected override ViewStyle CreateViewStyle()
1283         {
1284             return new TextLabelStyle();
1285         }
1286
1287         /// <summary>
1288         /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event.
1289         /// </summary>
1290         protected override void OnBindingContextChanged()
1291         {
1292             base.OnBindingContextChanged();
1293         }
1294
1295         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1296         {
1297             Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
1298         }
1299
1300         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
1301         {
1302             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
1303             SetValue(FontSizeScaleProperty, newFontSizeScale);
1304         }
1305
1306         private void addFontSizeChangedCallback()
1307         {
1308             if (hasFontSizeChangedCallback != true)
1309             {
1310                 try
1311                 {
1312                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
1313                     hasFontSizeChangedCallback = true;
1314                 }
1315                 catch (Exception e)
1316                 {
1317                     Console.WriteLine("{0} Exception caught.", e);
1318                     hasFontSizeChangedCallback = false;
1319                 }
1320             }
1321         }
1322
1323         private void removeFontSizeChangedCallback()
1324         {
1325             if (hasFontSizeChangedCallback == true)
1326             {
1327                 try
1328                 {
1329                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
1330                     hasFontSizeChangedCallback = false;
1331                 }
1332                 catch (Exception e)
1333                 {
1334                     Console.WriteLine("{0} Exception caught.", e);
1335                     hasFontSizeChangedCallback = true;
1336                 }
1337             }
1338         }
1339
1340         private void RequestLayout()
1341         {
1342             Layout?.RequestLayout();
1343         }
1344
1345         internal new class Property
1346         {
1347             internal static readonly int TEXT = Interop.TextLabel.TextGet();
1348             internal static readonly int FontFamily = Interop.TextLabel.FontFamilyGet();
1349             internal static readonly int FontStyle = Interop.TextLabel.FontStyleGet();
1350             internal static readonly int PointSize = Interop.TextLabel.PointSizeGet();
1351             internal static readonly int MultiLine = Interop.TextLabel.MultiLineGet();
1352             internal static readonly int HorizontalAlignment = Interop.TextLabel.HorizontalAlignmentGet();
1353             internal static readonly int VerticalAlignment = Interop.TextLabel.VerticalAlignmentGet();
1354             internal static readonly int TextColor = Interop.TextLabel.TextColorGet();
1355             internal static readonly int EnableMarkup = Interop.TextLabel.EnableMarkupGet();
1356             internal static readonly int EnableAutoScroll = Interop.TextLabel.EnableAutoScrollGet();
1357             internal static readonly int AutoScrollSpeed = Interop.TextLabel.AutoScrollSpeedGet();
1358             internal static readonly int AutoScrollLoopCount = Interop.TextLabel.AutoScrollLoopCountGet();
1359             internal static readonly int AutoScrollGap = Interop.TextLabel.AutoScrollGapGet();
1360             internal static readonly int LineSpacing = Interop.TextLabel.LineSpacingGet();
1361             internal static readonly int UNDERLINE = Interop.TextLabel.UnderlineGet();
1362             internal static readonly int SHADOW = Interop.TextLabel.ShadowGet();
1363             internal static readonly int EMBOSS = Interop.TextLabel.EmbossGet();
1364             internal static readonly int OUTLINE = Interop.TextLabel.OutlineGet();
1365             internal static readonly int PixelSize = Interop.TextLabel.PixelSizeGet();
1366             internal static readonly int ELLIPSIS = Interop.TextLabel.EllipsisGet();
1367             internal static readonly int AutoScrollStopMode = Interop.TextLabel.AutoScrollStopModeGet();
1368             internal static readonly int AutoScrollLoopDelay = Interop.TextLabel.AutoScrollLoopDelayGet();
1369             internal static readonly int LineCount = Interop.TextLabel.LineCountGet();
1370             internal static readonly int LineWrapMode = Interop.TextLabel.LineWrapModeGet();
1371             internal static readonly int TextDirection = Interop.TextLabel.TextDirectionGet();
1372             internal static readonly int VerticalLineAlignment = Interop.TextLabel.VerticalLineAlignmentGet();
1373             internal static readonly int MatchSystemLanguageDirection = Interop.TextLabel.MatchSystemLanguageDirectionGet();
1374             internal static readonly int TextFit = Interop.TextLabel.TextFitGet();
1375             internal static readonly int MinLineSize = Interop.TextLabel.MinLineSizeGet();
1376             internal static readonly int FontSizeScale = Interop.TextLabel.FontSizeScaleGet();
1377             internal static readonly int EllipsisPosition = Interop.TextLabel.EllipsisPositionGet();
1378         }
1379
1380         private void OnShadowColorChanged(float x, float y, float z, float w)
1381         {
1382             ShadowColor = new Vector4(x, y, z, w);
1383         }
1384         private void OnShadowOffsetChanged(float x, float y)
1385         {
1386             ShadowOffset = new Vector2(x, y);
1387         }
1388         private void OnTextColorChanged(float r, float g, float b, float a)
1389         {
1390             TextColor = new Color(r, g, b, a);
1391         }
1392         private void OnUnderlineColorChanged(float x, float y, float z, float w)
1393         {
1394             UnderlineColor = new Vector4(x, y, z, w);
1395         }
1396     }
1397 }