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