[NUI] Make EllipsisPosition property public
[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             SetValue(FontStyleProperty, 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             return TextUtils.GetFontStyleStruct((PropertyMap)GetValue(FontStyleProperty));
319         }
320
321         /// <summary>
322         /// The PointSize property.<br />
323         /// The size of font in points.<br />
324         /// </summary>
325         /// <since_tizen> 3 </since_tizen>
326         public float PointSize
327         {
328             get
329             {
330                 return (float)GetValue(PointSizeProperty);
331             }
332             set
333             {
334                 SetValue(PointSizeProperty, value);
335                 NotifyPropertyChanged();
336             }
337         }
338
339         /// <summary>
340         /// The MultiLine property.<br />
341         /// The single-line or multi-line layout option.<br />
342         /// </summary>
343         /// <since_tizen> 3 </since_tizen>
344         public bool MultiLine
345         {
346             get
347             {
348                 return (bool)GetValue(MultiLineProperty);
349             }
350             set
351             {
352                 SetValue(MultiLineProperty, value);
353                 NotifyPropertyChanged();
354             }
355         }
356
357         /// <summary>
358         /// The HorizontalAlignment property.<br />
359         /// The line horizontal alignment.<br />
360         /// </summary>
361         /// <since_tizen> 3 </since_tizen>
362         public HorizontalAlignment HorizontalAlignment
363         {
364             get
365             {
366                 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
367             }
368             set
369             {
370                 SetValue(HorizontalAlignmentProperty, value);
371                 NotifyPropertyChanged();
372             }
373         }
374
375         /// <summary>
376         /// The VerticalAlignment property.<br />
377         /// The line vertical alignment.<br />
378         /// </summary>
379         /// <since_tizen> 3 </since_tizen>
380         public VerticalAlignment VerticalAlignment
381         {
382             get
383             {
384                 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
385             }
386             set
387             {
388                 SetValue(VerticalAlignmentProperty, value);
389                 NotifyPropertyChanged();
390             }
391         }
392
393         /// <summary>
394         /// The TextColor property.<br />
395         /// The color of the text.<br />
396         /// Animation framework can be used to change the color of the text when not using mark up.<br />
397         /// Cannot animate the color when text is auto scrolling.<br />
398         /// </summary>
399         /// <remarks>
400         /// The property cascade chaining set is possible. For example, this (textLabel.TextColor.X = 0.1f;) is possible.
401         /// </remarks>
402         /// <since_tizen> 3 </since_tizen>
403         public Color TextColor
404         {
405             get
406             {
407                 Color temp = (Color)GetValue(TextColorProperty);
408                 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
409             }
410             set
411             {
412                 SetValue(TextColorProperty, value);
413                 NotifyPropertyChanged();
414             }
415         }
416
417         /// <summary>
418         /// The ShadowOffset property.<br />
419         /// The drop shadow offset 0 indicates no shadow.<br />
420         /// </summary>
421         /// <since_tizen> 3 </since_tizen>
422         /// <remarks>
423         /// Deprecated.(API Level 6) Use Shadow instead.
424         /// The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible.
425         /// </remarks>
426         [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
427         public Vector2 ShadowOffset
428         {
429             get
430             {
431                 Vector2 shadowOffset = new Vector2();
432                 Shadow.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset);
433                 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
434             }
435             set
436             {
437                 PropertyMap temp = new PropertyMap();
438                 temp.Insert("offset", new PropertyValue(value));
439
440                 PropertyMap shadowMap = Shadow;
441                 shadowMap.Merge(temp);
442
443                 SetValue(ShadowProperty, shadowMap);
444                 NotifyPropertyChanged();
445             }
446         }
447
448         /// <summary>
449         /// The ShadowColor property.<br />
450         /// The color of a drop shadow.<br />
451         /// </summary>
452         /// <since_tizen> 3 </since_tizen>
453         /// <remarks>
454         /// Deprecated.(API Level 6) Use Shadow instead.
455         /// The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible.
456         /// </remarks>
457         [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
458         public Vector4 ShadowColor
459         {
460             get
461             {
462                 Vector4 shadowColor = new Vector4();
463                 Shadow.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor);
464                 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
465             }
466             set
467             {
468                 PropertyMap temp = new PropertyMap();
469                 temp.Insert("color", new PropertyValue(value));
470
471                 PropertyMap shadowMap = Shadow;
472                 shadowMap.Merge(temp);
473
474                 SetValue(ShadowProperty, shadowMap);
475                 NotifyPropertyChanged();
476             }
477         }
478
479         /// <summary>
480         /// The UnderlineEnabled property.<br />
481         /// The underline enabled flag.<br />
482         /// </summary>
483         /// <since_tizen> 3 </since_tizen>
484         /// <remarks>
485         /// Deprecated.(API Level 6) Use Underline instead.
486         /// </remarks>
487         [Obsolete("Please do not use this UnderlineEnabled(Deprecated). Please use Underline instead.")]
488         public bool UnderlineEnabled
489         {
490             get
491             {
492                 bool underlineEnabled = false;
493                 Underline.Find(TextLabel.Property.UNDERLINE, "enable")?.Get(out underlineEnabled);
494                 return underlineEnabled;
495             }
496             set
497             {
498                 PropertyMap temp = new PropertyMap();
499                 temp.Add("enable", new PropertyValue(value));
500
501                 PropertyMap undelineMap = Underline;
502                 undelineMap.Merge(temp);
503
504                 SetValue(UnderlineProperty, undelineMap);
505                 NotifyPropertyChanged();
506
507             }
508         }
509
510         /// <summary>
511         /// The UnderlineColor property.<br />
512         /// Overrides the underline height from font metrics.<br />
513         /// </summary>
514         /// <since_tizen> 3 </since_tizen>
515         /// <remarks>
516         /// Deprecated.(API Level 6) Use Underline instead.
517         /// The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible.
518         /// </remarks>
519         [Obsolete("Please do not use this UnderlineColor(Deprecated). Please use Underline instead.")]
520         public Vector4 UnderlineColor
521         {
522             get
523             {
524                 Vector4 underlineColor = new Vector4();
525                 Underline.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor);
526                 return new Vector4(OnUnderlineColorChanged, underlineColor.X, underlineColor.Y, underlineColor.Z, underlineColor.W);
527             }
528             set
529             {
530                 PropertyMap temp = new PropertyMap();
531                 temp.Insert("color", new PropertyValue(value));
532
533                 PropertyMap undelineMap = Underline;
534                 undelineMap.Merge(temp);
535
536                 SetValue(UnderlineProperty, undelineMap);
537                 NotifyPropertyChanged();
538             }
539         }
540
541         /// <summary>
542         /// The UnderlineHeight property.<br />
543         /// Overrides the underline height from font metrics.<br />
544         /// </summary>
545         /// <since_tizen> 3 </since_tizen>
546         /// <remarks>
547         /// Deprecated.(API Level 6) Use Underline instead.
548         /// </remarks>
549         [Obsolete("Please do not use this UnderlineHeight(Deprecated). Please use Underline instead.")]
550         public float UnderlineHeight
551         {
552             get
553             {
554                 float underlineHeight = 0.0f;
555                 Underline.Find(TextLabel.Property.UNDERLINE, "height")?.Get(out underlineHeight);
556                 return underlineHeight;
557             }
558             set
559             {
560                 PropertyMap temp = new PropertyMap();
561                 temp.Insert("height", new PropertyValue(value));
562
563                 PropertyMap undelineMap = Underline;
564                 undelineMap.Merge(temp);
565
566                 SetValue(UnderlineProperty, undelineMap);
567                 NotifyPropertyChanged();
568             }
569         }
570
571         /// <summary>
572         /// The EnableMarkup property.<br />
573         /// Whether the mark-up processing is enabled.<br />
574         /// </summary>
575         /// <since_tizen> 3 </since_tizen>
576         public bool EnableMarkup
577         {
578             get
579             {
580                 return (bool)GetValue(EnableMarkupProperty);
581             }
582             set
583             {
584                 SetValue(EnableMarkupProperty, value);
585                 NotifyPropertyChanged();
586             }
587         }
588
589         /// <summary>
590         /// The EnableAutoScroll property.<br />
591         /// Starts or stops auto scrolling.<br />
592         /// </summary>
593         /// <since_tizen> 3 </since_tizen>
594         public bool EnableAutoScroll
595         {
596             get
597             {
598                 return (bool)GetValue(EnableAutoScrollProperty);
599             }
600             set
601             {
602                 SetValue(EnableAutoScrollProperty, value);
603                 NotifyPropertyChanged();
604             }
605         }
606
607         /// <summary>
608         /// The AutoScrollSpeed property.<br />
609         /// Sets the speed of scrolling in pixels per second.<br />
610         /// </summary>
611         /// <since_tizen> 3 </since_tizen>
612         public int AutoScrollSpeed
613         {
614             get
615             {
616                 return (int)GetValue(AutoScrollSpeedProperty);
617             }
618             set
619             {
620                 SetValue(AutoScrollSpeedProperty, value);
621                 NotifyPropertyChanged();
622             }
623         }
624
625         /// <summary>
626         /// The AutoScrollLoopCount property.<br />
627         /// Number of complete loops when scrolling enabled.<br />
628         /// </summary>
629         /// <since_tizen> 3 </since_tizen>
630         public int AutoScrollLoopCount
631         {
632             get
633             {
634                 return (int)GetValue(AutoScrollLoopCountProperty);
635             }
636             set
637             {
638                 SetValue(AutoScrollLoopCountProperty, value);
639                 NotifyPropertyChanged();
640             }
641         }
642
643         /// <summary>
644         /// The AutoScrollGap property.<br />
645         /// Gap before scrolling wraps.<br />
646         /// </summary>
647         /// <since_tizen> 3 </since_tizen>
648         public float AutoScrollGap
649         {
650             get
651             {
652                 return (float)GetValue(AutoScrollGapProperty);
653             }
654             set
655             {
656                 SetValue(AutoScrollGapProperty, value);
657                 NotifyPropertyChanged();
658             }
659         }
660
661         /// <summary>
662         /// The LineSpacing property.<br />
663         /// The default extra space between lines in points.<br />
664         /// </summary>
665         /// <since_tizen> 3 </since_tizen>
666         public float LineSpacing
667         {
668             get
669             {
670                 return (float)GetValue(LineSpacingProperty);
671             }
672             set
673             {
674                 SetValue(LineSpacingProperty, value);
675                 NotifyPropertyChanged();
676             }
677         }
678
679         /// <summary>
680         /// The Underline property.<br />
681         /// The default underline parameters.<br />
682         /// The underline map contains the following keys :<br />
683         /// <list type="table">
684         /// <item><term>enable (bool)</term><description>Whether the underline is enabled (the default value is false)</description></item>
685         /// <item><term>color (Color)</term><description>The color of the underline (If not provided then the color of the text is used)</description></item>
686         /// <item><term>height (float)</term><description>The height in pixels of the underline (the default value is 1.f)</description></item>
687         /// </list>
688         /// </summary>
689         /// <since_tizen> 3 </since_tizen>
690         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
691         public PropertyMap Underline
692         {
693             get
694             {
695                 return (PropertyMap)GetValue(UnderlineProperty);
696             }
697             set
698             {
699                 SetValue(UnderlineProperty, value);
700                 NotifyPropertyChanged();
701             }
702         }
703
704         /// <summary>
705         /// Set Underline to TextLabel. <br />
706         /// </summary>
707         /// <param name="underline">The Underline</param>
708         /// <remarks>
709         /// SetUnderline specifies the underline of the text through <see cref="Tizen.NUI.Text.Underline"/>. <br />
710         /// </remarks>
711         /// <example>
712         /// The following example demonstrates how to use the SetUnderline method.
713         /// <code>
714         /// var underline = new Tizen.NUI.Text.Underline();
715         /// underline.Enable = true;
716         /// underline.Color = new Color("#3498DB");
717         /// underline.Height = 2.0f;
718         /// label.SetUnderline(underline);
719         /// </code>
720         /// </example>
721         [EditorBrowsable(EditorBrowsableState.Never)]
722         public void SetUnderline(Underline underline)
723         {
724             SetValue(UnderlineProperty, TextUtils.GetUnderlineMap(underline));
725         }
726
727         /// <summary>
728         /// Get Underline from TextLabel. <br />
729         /// </summary>
730         /// <returns>The Underline</returns>
731         /// <remarks>
732         /// <see cref="Tizen.NUI.Text.Underline"/>
733         /// </remarks>
734         [EditorBrowsable(EditorBrowsableState.Never)]
735         public Underline GetUnderline()
736         {
737             return TextUtils.GetUnderlineStruct((PropertyMap)GetValue(UnderlineProperty));
738         }
739
740         /// <summary>
741         /// The Shadow property.<br />
742         /// The default shadow parameters.<br />
743         /// The shadow map contains the following keys :<br />
744         /// <list type="table">
745         /// <item><term>color (Color)</term><description>The color of the shadow (the default color is Color.Black)</description></item>
746         /// <item><term>offset (Vector2)</term><description>The offset in pixels of the shadow (If not provided then the shadow is not enabled)</description></item>
747         /// <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>
748         /// </list>
749         /// </summary>
750         /// <since_tizen> 3 </since_tizen>
751         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
752         public PropertyMap Shadow
753         {
754             get
755             {
756                 return (PropertyMap)GetValue(ShadowProperty);
757             }
758             set
759             {
760                 SetValue(ShadowProperty, value);
761                 NotifyPropertyChanged();
762             }
763         }
764
765         /// <summary>
766         /// Set Shadow to TextLabel. <br />
767         /// </summary>
768         /// <param name="shadow">The Shadow</param>
769         /// <remarks>
770         /// SetShadow specifies the shadow of the text through <see cref="Tizen.NUI.Text.Shadow"/>. <br />
771         /// </remarks>
772         /// <example>
773         /// The following example demonstrates how to use the SetShadow method.
774         /// <code>
775         /// var shadow = new Tizen.NUI.Text.Shadow();
776         /// shadow.Offset = new Vector2(3, 3);
777         /// shadow.Color = new Color("#F1C40F");
778         /// shadow.BlurRadius = 4.0f;
779         /// label.SetShadow(shadow);
780         /// </code>
781         /// </example>
782         [EditorBrowsable(EditorBrowsableState.Never)]
783         public void SetShadow(Tizen.NUI.Text.Shadow shadow)
784         {
785             SetValue(ShadowProperty, TextUtils.GetShadowMap(shadow));
786         }
787
788         /// <summary>
789         /// Get Shadow from TextLabel. <br />
790         /// </summary>
791         /// <returns>The Shadow</returns>
792         /// <remarks>
793         /// <see cref="Tizen.NUI.Text.Shadow"/>
794         /// </remarks>
795         [EditorBrowsable(EditorBrowsableState.Never)]
796         public Tizen.NUI.Text.Shadow GetShadow()
797         {
798             return TextUtils.GetShadowStruct((PropertyMap)GetValue(ShadowProperty));
799         }
800
801         /// <summary>
802         /// Describes a text shadow for a TextLabel.
803         /// It is null by default.
804         /// </summary>
805         [EditorBrowsable(EditorBrowsableState.Never)]
806         public TextShadow TextShadow
807         {
808             get
809             {
810                 return (TextShadow)GetValue(TextShadowProperty);
811             }
812             set
813             {
814                 SetValue(TextShadowProperty, value);
815                 NotifyPropertyChanged();
816             }
817         }
818
819         /// <summary>
820         /// The Emboss property.<br />
821         /// The default emboss parameters.<br />
822         /// </summary>
823         /// <since_tizen> 3 </since_tizen>
824         public string Emboss
825         {
826             get
827             {
828                 return (string)GetValue(EmbossProperty);
829             }
830             set
831             {
832                 SetValue(EmbossProperty, value);
833                 NotifyPropertyChanged();
834             }
835         }
836
837         /// <summary>
838         /// The Outline property.<br />
839         /// The default outline parameters.<br />
840         /// The outline map contains the following keys :<br />
841         /// <list type="table">
842         /// <item><term>color (Color)</term><description>The color of the outline (the default color is Color.White)</description></item>
843         /// <item><term>width (float)</term><description>The width in pixels of the outline (If not provided then the outline is not enabled)</description></item>
844         /// </list>
845         /// </summary>
846         /// <since_tizen> 3 </since_tizen>
847         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
848         public PropertyMap Outline
849         {
850             get
851             {
852                 return (PropertyMap)GetValue(OutlineProperty);
853             }
854             set
855             {
856                 SetValue(OutlineProperty, value);
857                 NotifyPropertyChanged();
858             }
859         }
860
861         /// <summary>
862         /// Set Outline to TextLabel. <br />
863         /// </summary>
864         /// <param name="outline">The Outline</param>
865         /// <remarks>
866         /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
867         /// </remarks>
868         /// <example>
869         /// The following example demonstrates how to use the SetOutline method.
870         /// <code>
871         /// var outline = new Tizen.NUI.Text.Outline();
872         /// outline.Width = 2.0f;
873         /// outline.Color = new Color("#45B39D");
874         /// label.SetOutline(outline);
875         /// </code>
876         /// </example>
877         [EditorBrowsable(EditorBrowsableState.Never)]
878         public void SetOutline(Outline outline)
879         {
880             SetValue(OutlineProperty, TextUtils.GetOutlineMap(outline));
881         }
882
883         /// <summary>
884         /// Get Outline from TextLabel. <br />
885         /// </summary>
886         /// <returns>The Outline</returns>
887         /// <remarks>
888         /// <see cref="Tizen.NUI.Text.Outline"/>
889         /// </remarks>
890         [EditorBrowsable(EditorBrowsableState.Never)]
891         public Outline GetOutline()
892         {
893             return TextUtils.GetOutlineStruct((PropertyMap)GetValue(OutlineProperty));
894         }
895
896         /// <summary>
897         /// The PixelSize property.<br />
898         /// The size of font in pixels.<br />
899         /// </summary>
900         /// <since_tizen> 3 </since_tizen>
901         public float PixelSize
902         {
903             get
904             {
905                 return (float)GetValue(PixelSizeProperty);
906             }
907             set
908             {
909                 SetValue(PixelSizeProperty, value);
910                 NotifyPropertyChanged();
911             }
912         }
913
914         /// <summary>
915         /// The Ellipsis property.<br />
916         /// Enable or disable the ellipsis.<br />
917         /// </summary>
918         /// <since_tizen> 3 </since_tizen>
919         public bool Ellipsis
920         {
921             get
922             {
923                 return (bool)GetValue(EllipsisProperty);
924             }
925             set
926             {
927                 SetValue(EllipsisProperty, value);
928                 NotifyPropertyChanged();
929             }
930         }
931
932         /// <summary>
933         /// The ellipsis position of the text.
934         /// The ellipsis position type when the text size over the layout size.<br />
935         /// The ellipsis position: End, Start or Middle.<br />
936         /// </summary>
937         /// <since_tizen> 9 </since_tizen>
938         public EllipsisPosition EllipsisPosition
939         {
940             get
941             {
942                 return (EllipsisPosition)GetValue(EllipsisPositionProperty);
943             }
944             set
945             {
946                 SetValue(EllipsisPositionProperty, value);
947                 NotifyPropertyChanged();
948             }
949         }
950
951         /// <summary>
952         /// The AutoScrollLoopDelay property.<br />
953         /// Do something.<br />
954         /// </summary>
955         /// <since_tizen> 3 </since_tizen>
956         public float AutoScrollLoopDelay
957         {
958             get
959             {
960                 return (float)GetValue(AutoScrollLoopDelayProperty);
961             }
962             set
963             {
964                 SetValue(AutoScrollLoopDelayProperty, value);
965                 NotifyPropertyChanged();
966             }
967         }
968
969         /// <summary>
970         /// The AutoScrollStopMode property.<br />
971         /// Do something.<br />
972         /// </summary>
973         /// <since_tizen> 3 </since_tizen>
974         public AutoScrollStopMode AutoScrollStopMode
975         {
976             get
977             {
978                 return (AutoScrollStopMode)GetValue(AutoScrollStopModeProperty);
979             }
980             set
981             {
982                 SetValue(AutoScrollStopModeProperty, value);
983                 NotifyPropertyChanged();
984             }
985         }
986
987         /// <summary>
988         /// The line count of the text.
989         /// </summary>
990         /// <since_tizen> 3 </since_tizen>
991         public int LineCount
992         {
993             get
994             {
995                 int temp = 0;
996                 GetProperty(TextLabel.Property.LineCount).Get(out temp);
997                 return temp;
998             }
999         }
1000
1001         /// <summary>
1002         /// The LineWrapMode property.<br />
1003         /// line wrap mode when the text lines over layout width.<br />
1004         /// </summary>
1005         /// <since_tizen> 4 </since_tizen>
1006         public LineWrapMode LineWrapMode
1007         {
1008             get
1009             {
1010                 return (LineWrapMode)GetValue(LineWrapModeProperty);
1011             }
1012             set
1013             {
1014                 SetValue(LineWrapModeProperty, value);
1015                 NotifyPropertyChanged();
1016             }
1017         }
1018
1019         /// <summary>
1020         /// The direction of the text such as left to right or right to left.
1021         /// </summary>
1022         /// <since_tizen> 5 </since_tizen>
1023         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1024         [EditorBrowsable(EditorBrowsableState.Never)]
1025         public TextDirection TextDirection
1026         {
1027             get
1028             {
1029                 int temp = 0;
1030                 GetProperty(TextLabel.Property.TextDirection).Get(out temp);
1031                 return (TextDirection)temp;
1032             }
1033         }
1034
1035         /// <summary>
1036         /// The vertical line alignment of the text.
1037         /// </summary>
1038         /// <since_tizen> 5 </since_tizen>
1039         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1040         [EditorBrowsable(EditorBrowsableState.Never)]
1041         public VerticalLineAlignment VerticalLineAlignment
1042         {
1043             get
1044             {
1045                 return (VerticalLineAlignment)GetValue(VerticalLineAlignmentProperty);
1046             }
1047             set
1048             {
1049                 SetValue(VerticalLineAlignmentProperty, value);
1050                 NotifyPropertyChanged();
1051             }
1052         }
1053
1054         /// <summary>
1055         /// The text alignment to match the direction of the system language.
1056         /// </summary>
1057         /// <since_tizen> 6 </since_tizen>
1058         public bool MatchSystemLanguageDirection
1059         {
1060             get
1061             {
1062                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1063             }
1064             set
1065             {
1066                 SetValue(MatchSystemLanguageDirectionProperty, value);
1067                 NotifyPropertyChanged();
1068             }
1069         }
1070
1071         /// <summary>
1072         /// The text fit parameters.<br />
1073         /// The textFit map contains the following keys :<br />
1074         /// <list type="table">
1075         /// <item><term>enable (bool)</term><description>True to enable the text fit or false to disable (the default value is false)</description></item>
1076         /// <item><term>minSize (float)</term><description>Minimum Size for text fit (the default value is 10.f)</description></item>
1077         /// <item><term>maxSize (float)</term><description>Maximum Size for text fit (the default value is 100.f)</description></item>
1078         /// <item><term>stepSize (float)</term><description>Step Size for font increase (the default value is 1.f)</description></item>
1079         /// <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>
1080         /// </list>
1081         /// </summary>
1082         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1083         [EditorBrowsable(EditorBrowsableState.Never)]
1084         [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")]
1085         public PropertyMap TextFit
1086         {
1087             get
1088             {
1089                 return (PropertyMap)GetValue(TextFitProperty);
1090             }
1091             set
1092             {
1093                 SetValue(TextFitProperty, value);
1094                 NotifyPropertyChanged();
1095             }
1096         }
1097
1098         /// <summary>
1099         /// Set TextFit to TextLabel. <br />
1100         /// </summary>
1101         /// <param name="textFit">The TextFit</param>
1102         /// <remarks>
1103         /// SetTextFit specifies the textFit of the text through <see cref="Tizen.NUI.Text.TextFit"/>. <br />
1104         /// </remarks>
1105         /// <example>
1106         /// The following example demonstrates how to use the SetTextFit method.
1107         /// <code>
1108         /// var textFit = new Tizen.NUI.Text.TextFit();
1109         /// textFit.Enable = true;
1110         /// textFit.MinSize = 10.0f;
1111         /// textFit.MaxSize = 100.0f;
1112         /// textFit.StepSize = 5.0f;
1113         /// textFit.FontSizeType = FontSizeType.PointSize;
1114         /// label.SetTextFit(textFit);
1115         /// </code>
1116         /// </example>
1117         [EditorBrowsable(EditorBrowsableState.Never)]
1118         public void SetTextFit(TextFit textFit)
1119         {
1120             SetValue(TextFitProperty, TextUtils.GetTextFitMap(textFit));
1121         }
1122
1123         /// <summary>
1124         /// Get TextFit from TextLabel. <br />
1125         /// </summary>
1126         /// <returns>The TextFit</returns>
1127         /// <remarks>
1128         /// TextFit is always returned based on PointSize. <br />
1129         /// If the user sets FontSizeType to PixelSize, then MinSize, MaxSize, and StepSize are converted based on PointSize and returned. <br />
1130         /// <see cref="Tizen.NUI.Text.TextFit"/>
1131         /// </remarks>
1132         [EditorBrowsable(EditorBrowsableState.Never)]
1133         public TextFit GetTextFit()
1134         {
1135             return TextUtils.GetTextFitStruct((PropertyMap)GetValue(TextFitProperty));
1136         }
1137
1138         /// <summary>
1139         /// The MinLineSize property.<br />
1140         /// </summary>
1141         /// <since_tizen> 8 </since_tizen>
1142         [EditorBrowsable(EditorBrowsableState.Never)]
1143         public float MinLineSize
1144         {
1145             get
1146             {
1147                 return (float)GetValue(MinLineSizeProperty);
1148             }
1149             set
1150             {
1151                 SetValue(MinLineSizeProperty, value);
1152                 NotifyPropertyChanged();
1153             }
1154         }
1155
1156         /// <summary>
1157         /// The FontSizeScale property. <br />
1158         /// The default value is 1.0. <br />
1159         /// If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally. <br />
1160         /// </summary>
1161         /// <since_tizen> 9 </since_tizen>
1162         public float FontSizeScale
1163         {
1164             get
1165             {
1166                 return fontSizeScale;
1167             }
1168             set
1169             {
1170                 float newFontSizeScale;
1171
1172                 if (fontSizeScale == value) return;
1173
1174                 fontSizeScale = value;
1175                 if (fontSizeScale == Tizen.NUI.FontSizeScale.UseSystemSetting)
1176                 {
1177                     SystemSettingsFontSize systemSettingsFontSize;
1178
1179                     try
1180                     {
1181                         systemSettingsFontSize = SystemSettings.FontSize;
1182                     }
1183                     catch (Exception e)
1184                     {
1185                         Console.WriteLine("{0} Exception caught.", e);
1186                         systemSettingsFontSize = SystemSettingsFontSize.Normal;
1187                     }
1188                     newFontSizeScale = TextUtils.GetFontSizeScale(systemSettingsFontSize);
1189                     addFontSizeChangedCallback();
1190                 }
1191                 else
1192                 {
1193                     newFontSizeScale = fontSizeScale;
1194                     removeFontSizeChangedCallback();
1195                 }
1196
1197                 SetValue(FontSizeScaleProperty, newFontSizeScale);
1198                 NotifyPropertyChanged();
1199             }
1200         }
1201
1202         private TextLabelSelectorData EnsureSelectorData() => selectorData ?? (selectorData = new TextLabelSelectorData());
1203
1204         /// <summary>
1205         /// Downcasts a handle to textLabel handle
1206         /// </summary>
1207         /// <param name="handle"></param>
1208         /// <returns></returns>
1209         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
1210         /// <since_tizen> 3 </since_tizen>
1211         /// Please do not use! this will be deprecated!
1212         /// Instead please use as keyword.
1213         [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
1214             "Like: " +
1215             "BaseHandle handle = new TextLabel(\"Hello World!\"); " +
1216             "TextLabel label = handle as TextLabel")]
1217         [EditorBrowsable(EditorBrowsableState.Never)]
1218         public static TextLabel DownCast(BaseHandle handle)
1219         {
1220             if (null == handle)
1221             {
1222                 throw new ArgumentNullException(nameof(handle));
1223             }
1224             TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
1225             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1226             return ret;
1227         }
1228
1229         /// <inheritdoc/>
1230         [EditorBrowsable(EditorBrowsableState.Never)]
1231         protected override void Dispose(DisposeTypes type)
1232         {
1233             if (disposed)
1234             {
1235                 return;
1236             }
1237
1238             if (systemlangTextFlag)
1239             {
1240                 SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
1241             }
1242
1243             removeFontSizeChangedCallback();
1244
1245             if (type == DisposeTypes.Explicit)
1246             {
1247                 //Called by User
1248                 //Release your own managed resources here.
1249                 //You should release all of your own disposable objects here.
1250                 selectorData?.Reset(this);
1251             }
1252
1253             base.Dispose(type);
1254         }
1255
1256         /// This will not be public opened.
1257         [EditorBrowsable(EditorBrowsableState.Never)]
1258         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1259         {
1260             Interop.TextLabel.DeleteTextLabel(swigCPtr);
1261         }
1262
1263         /// <summary>
1264         /// Get attribues, it is abstract function and must be override.
1265         /// </summary>
1266         [EditorBrowsable(EditorBrowsableState.Never)]
1267         protected override ViewStyle CreateViewStyle()
1268         {
1269             return new TextLabelStyle();
1270         }
1271
1272         /// <summary>
1273         /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event.
1274         /// </summary>
1275         protected override void OnBindingContextChanged()
1276         {
1277             base.OnBindingContextChanged();
1278         }
1279
1280         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1281         {
1282             Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
1283         }
1284
1285         private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
1286         {
1287             float newFontSizeScale = TextUtils.GetFontSizeScale(e.Value);
1288             SetValue(FontSizeScaleProperty, newFontSizeScale);
1289         }
1290
1291         private void addFontSizeChangedCallback()
1292         {
1293             if (hasFontSizeChangedCallback != true)
1294             {
1295                 try
1296                 {
1297                     SystemSettings.FontSizeChanged += SystemSettingsFontSizeChanged;
1298                     hasFontSizeChangedCallback = true;
1299                 }
1300                 catch (Exception e)
1301                 {
1302                     Console.WriteLine("{0} Exception caught.", e);
1303                     hasFontSizeChangedCallback = false;
1304                 }
1305             }
1306         }
1307
1308         private void removeFontSizeChangedCallback()
1309         {
1310             if (hasFontSizeChangedCallback == true)
1311             {
1312                 try
1313                 {
1314                     SystemSettings.FontSizeChanged -= SystemSettingsFontSizeChanged;
1315                     hasFontSizeChangedCallback = false;
1316                 }
1317                 catch (Exception e)
1318                 {
1319                     Console.WriteLine("{0} Exception caught.", e);
1320                     hasFontSizeChangedCallback = true;
1321                 }
1322             }
1323         }
1324
1325         private void RequestLayout()
1326         {
1327             Layout?.RequestLayout();
1328         }
1329
1330         internal new class Property
1331         {
1332             internal static readonly int TEXT = Interop.TextLabel.TextGet();
1333             internal static readonly int FontFamily = Interop.TextLabel.FontFamilyGet();
1334             internal static readonly int FontStyle = Interop.TextLabel.FontStyleGet();
1335             internal static readonly int PointSize = Interop.TextLabel.PointSizeGet();
1336             internal static readonly int MultiLine = Interop.TextLabel.MultiLineGet();
1337             internal static readonly int HorizontalAlignment = Interop.TextLabel.HorizontalAlignmentGet();
1338             internal static readonly int VerticalAlignment = Interop.TextLabel.VerticalAlignmentGet();
1339             internal static readonly int TextColor = Interop.TextLabel.TextColorGet();
1340             internal static readonly int EnableMarkup = Interop.TextLabel.EnableMarkupGet();
1341             internal static readonly int EnableAutoScroll = Interop.TextLabel.EnableAutoScrollGet();
1342             internal static readonly int AutoScrollSpeed = Interop.TextLabel.AutoScrollSpeedGet();
1343             internal static readonly int AutoScrollLoopCount = Interop.TextLabel.AutoScrollLoopCountGet();
1344             internal static readonly int AutoScrollGap = Interop.TextLabel.AutoScrollGapGet();
1345             internal static readonly int LineSpacing = Interop.TextLabel.LineSpacingGet();
1346             internal static readonly int UNDERLINE = Interop.TextLabel.UnderlineGet();
1347             internal static readonly int SHADOW = Interop.TextLabel.ShadowGet();
1348             internal static readonly int EMBOSS = Interop.TextLabel.EmbossGet();
1349             internal static readonly int OUTLINE = Interop.TextLabel.OutlineGet();
1350             internal static readonly int PixelSize = Interop.TextLabel.PixelSizeGet();
1351             internal static readonly int ELLIPSIS = Interop.TextLabel.EllipsisGet();
1352             internal static readonly int AutoScrollStopMode = Interop.TextLabel.AutoScrollStopModeGet();
1353             internal static readonly int AutoScrollLoopDelay = Interop.TextLabel.AutoScrollLoopDelayGet();
1354             internal static readonly int LineCount = Interop.TextLabel.LineCountGet();
1355             internal static readonly int LineWrapMode = Interop.TextLabel.LineWrapModeGet();
1356             internal static readonly int TextDirection = Interop.TextLabel.TextDirectionGet();
1357             internal static readonly int VerticalLineAlignment = Interop.TextLabel.VerticalLineAlignmentGet();
1358             internal static readonly int MatchSystemLanguageDirection = Interop.TextLabel.MatchSystemLanguageDirectionGet();
1359             internal static readonly int TextFit = Interop.TextLabel.TextFitGet();
1360             internal static readonly int MinLineSize = Interop.TextLabel.MinLineSizeGet();
1361             internal static readonly int FontSizeScale = Interop.TextLabel.FontSizeScaleGet();
1362             internal static readonly int EllipsisPosition = Interop.TextLabel.EllipsisPositionGet();
1363         }
1364
1365         private void OnShadowColorChanged(float x, float y, float z, float w)
1366         {
1367             ShadowColor = new Vector4(x, y, z, w);
1368         }
1369         private void OnShadowOffsetChanged(float x, float y)
1370         {
1371             ShadowOffset = new Vector2(x, y);
1372         }
1373         private void OnTextColorChanged(float r, float g, float b, float a)
1374         {
1375             TextColor = new Color(r, g, b, a);
1376         }
1377         private void OnUnderlineColorChanged(float x, float y, float z, float w)
1378         {
1379             UnderlineColor = new Vector4(x, y, z, w);
1380         }
1381     }
1382 }