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