[NUI] Move to dali2 (#1787)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextLabel.cs
1 /*
2  * Copyright(c) 2020 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 using System;
21 using System.Globalization;
22 using System.ComponentModel;
23 using Tizen.NUI.Binding;
24
25 namespace Tizen.NUI.BaseComponents
26 {
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         static TextLabel() { }
36
37         private string textLabelSid = null;
38         private bool systemlangTextFlag = false;
39
40         private CloneableViewSelector<TextShadow> textShadow;
41
42         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         public TextLabelStyle Style => ViewStyle as TextLabelStyle;
45
46         /// <summary>
47         /// Creates the TextLabel control.
48         /// </summary>
49         /// <since_tizen> 3 </since_tizen>
50         public TextLabel() : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
51         {
52             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53         }
54
55         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
56         [EditorBrowsable(EditorBrowsableState.Never)]
57         public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true, viewStyle)
58         {
59         }
60
61         /// <summary>
62         /// Creates the TextLabel with setting the status of shown or hidden.
63         /// </summary>
64         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
65         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
66         [EditorBrowsable(EditorBrowsableState.Never)]
67         public TextLabel(bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
68         {
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70             SetVisible(shown);
71         }
72
73         /// <summary>
74         /// Creates the TextLabel control.
75         /// </summary>
76         /// <param name="text">The text to display</param>
77         /// <since_tizen> 3 </since_tizen>
78         public TextLabel(string text) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
79         {
80             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81         }
82
83         /// <summary>
84         /// Creates the TextLabel with setting the status of shown or hidden.
85         /// </summary>
86         /// <param name="text">The text to display</param>
87         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
88         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
89         [EditorBrowsable(EditorBrowsableState.Never)]
90         public TextLabel(string text, bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
91         {
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93             SetVisible(shown);
94         }
95
96         internal TextLabel(TextLabel handle, bool shown = true) : this(Interop.TextLabel.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
97         {
98             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99
100             if (!shown)
101             {
102                 SetVisible(false);
103             }
104         }
105
106         internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
107         {
108             if (!shown)
109             {
110                 SetVisible(false);
111             }
112         }
113
114         internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
115         {
116             if (!shown)
117             {
118                 SetVisible(false);
119             }
120         }
121
122         /// <summary>
123         /// The TranslatableText property.<br />
124         /// The text can set the SID value.<br />
125         /// </summary>
126         /// <exception cref='ArgumentNullException'>
127         /// ResourceManager about multilingual is null.
128         /// </exception>
129         /// <since_tizen> 4 </since_tizen>
130         public string TranslatableText
131         {
132             get
133             {
134                 return (string)GetValue(TranslatableTextProperty);
135             }
136             set
137             {
138                 SetValue(TranslatableTextProperty, value);
139             }
140         }
141         private string translatableText
142         {
143             get
144             {
145                 string temp = (string)GetValue(TranslatableTextProperty);
146                 return textLabelSid;
147             }
148             set
149             {
150                 if (NUIApplication.MultilingualResourceManager == null)
151                 {
152                     throw new ArgumentNullException("ResourceManager about multilingual is null");
153                 }
154                 string translatableText = null;
155                 textLabelSid = value;
156                 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
157                 if (translatableText != null)
158                 {
159                     Text = translatableText;
160                     if (systemlangTextFlag == false)
161                     {
162                         SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
163                         systemlangTextFlag = true;
164                     }
165                 }
166                 else
167                 {
168                     Text = "";
169                 }
170                 NotifyPropertyChanged();
171             }
172         }
173
174         /// <summary>
175         /// The Text property.<br />
176         /// The text to display in the UTF-8 format.<br />
177         /// </summary>
178         /// <since_tizen> 3 </since_tizen>
179         public string Text
180         {
181             get
182             {
183                 return (string)GetValue(TextProperty);
184             }
185             set
186             {
187                 SetValue(TextProperty, value);
188                 NotifyPropertyChangedAndRequestLayout();
189             }
190         }
191
192         /// <summary>
193         /// The FontFamily property.<br />
194         /// The requested font family to use.<br />
195         /// </summary>
196         /// <since_tizen> 3 </since_tizen>
197         public string FontFamily
198         {
199             get
200             {
201                 return (string)GetValue(FontFamilyProperty);
202             }
203             set
204             {
205                 SetValue(FontFamilyProperty, value);
206                 NotifyPropertyChangedAndRequestLayout();
207             }
208         }
209
210         /// <summary>
211         /// The FontStyle property.<br />
212         /// The requested font style to use.<br />
213         /// </summary>
214         /// <since_tizen> 3 </since_tizen>
215         public PropertyMap FontStyle
216         {
217             get
218             {
219                 return (PropertyMap)GetValue(FontStyleProperty);
220             }
221             set
222             {
223                 SetValue(FontStyleProperty, value);
224                 NotifyPropertyChangedAndRequestLayout();
225             }
226         }
227
228         /// <summary>
229         /// The PointSize property.<br />
230         /// The size of font in points.<br />
231         /// </summary>
232         /// <since_tizen> 3 </since_tizen>
233         public float PointSize
234         {
235             get
236             {
237                 return (float)GetValue(PointSizeProperty);
238             }
239             set
240             {
241                 SetValue(PointSizeProperty, value);
242                 NotifyPropertyChangedAndRequestLayout();
243             }
244         }
245
246         /// <summary>
247         /// The MultiLine property.<br />
248         /// The single-line or multi-line layout option.<br />
249         /// </summary>
250         /// <since_tizen> 3 </since_tizen>
251         public bool MultiLine
252         {
253             get
254             {
255                 return (bool)GetValue(MultiLineProperty);
256             }
257             set
258             {
259                 SetValue(MultiLineProperty, value);
260                 NotifyPropertyChangedAndRequestLayout();
261             }
262         }
263
264         /// <summary>
265         /// The HorizontalAlignment property.<br />
266         /// The line horizontal alignment.<br />
267         /// </summary>
268         /// <since_tizen> 3 </since_tizen>
269         public HorizontalAlignment HorizontalAlignment
270         {
271             get
272             {
273                 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
274             }
275             set
276             {
277                 SetValue(HorizontalAlignmentProperty, value);
278                 NotifyPropertyChanged();
279             }
280         }
281
282         /// <summary>
283         /// The VerticalAlignment property.<br />
284         /// The line vertical alignment.<br />
285         /// </summary>
286         /// <since_tizen> 3 </since_tizen>
287         public VerticalAlignment VerticalAlignment
288         {
289             get
290             {
291                 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
292             }
293             set
294             {
295                 SetValue(VerticalAlignmentProperty, value);
296                 NotifyPropertyChanged();
297             }
298         }
299
300         /// <summary>
301         /// The TextColor property.<br />
302         /// The color of the text.<br />
303         /// Animation framework can be used to change the color of the text when not using mark up.<br />
304         /// Cannot animate the color when text is auto scrolling.<br />
305         /// </summary>
306         /// <remarks>
307         /// The property cascade chaining set is possible. For example, this (textLabel.TextColor.X = 0.1f;) is possible.
308         /// </remarks>
309         /// <since_tizen> 3 </since_tizen>
310         public Color TextColor
311         {
312             get
313             {
314                 Color temp = (Color)GetValue(TextColorProperty);
315                 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
316             }
317             set
318             {
319                 SetValue(TextColorProperty, value);
320                 NotifyPropertyChanged();
321             }
322         }
323
324         /// <summary>
325         /// The ShadowOffset property.<br />
326         /// The drop shadow offset 0 indicates no shadow.<br />
327         /// </summary>
328         /// <since_tizen> 3 </since_tizen>
329         /// <remarks>
330         /// Deprecated.(API Level 6) Use Shadow instead.
331         /// The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible.
332         /// </remarks>
333         [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
334         public Vector2 ShadowOffset
335         {
336             get
337             {
338                 Vector2 shadowOffset = new Vector2();
339                 Shadow.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset);
340                 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
341             }
342             set
343             {
344                 PropertyMap temp = new PropertyMap();
345                 temp.Insert("offset", new PropertyValue(value));
346
347                 PropertyMap shadowMap = Shadow;
348                 shadowMap.Merge(temp);
349
350                 SetValue(ShadowProperty, shadowMap);
351                 NotifyPropertyChanged();
352             }
353         }
354
355         /// <summary>
356         /// The ShadowColor property.<br />
357         /// The color of a drop shadow.<br />
358         /// </summary>
359         /// <since_tizen> 3 </since_tizen>
360         /// <remarks>
361         /// Deprecated.(API Level 6) Use Shadow instead.
362         /// The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible.
363         /// </remarks>
364         [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
365         public Vector4 ShadowColor
366         {
367             get
368             {
369                 Vector4 shadowColor = new Vector4();
370                 Shadow.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor);
371                 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
372             }
373             set
374             {
375                 PropertyMap temp = new PropertyMap();
376                 temp.Insert("color", new PropertyValue(value));
377
378                 PropertyMap shadowMap = Shadow;
379                 shadowMap.Merge(temp);
380
381                 SetValue(ShadowProperty, shadowMap);
382                 NotifyPropertyChanged();
383             }
384         }
385
386         /// <summary>
387         /// The UnderlineEnabled property.<br />
388         /// The underline enabled flag.<br />
389         /// </summary>
390         /// <since_tizen> 3 </since_tizen>
391         /// <remarks>
392         /// Deprecated.(API Level 6) Use Underline instead.
393         /// </remarks>
394         [Obsolete("Please do not use this UnderlineEnabled(Deprecated). Please use Underline instead.")]
395         public bool UnderlineEnabled
396         {
397             get
398             {
399                 bool underlineEnabled = false;
400                 Underline.Find(TextLabel.Property.UNDERLINE, "enable")?.Get(out underlineEnabled);
401                 return underlineEnabled;
402             }
403             set
404             {
405                 PropertyMap temp = new PropertyMap();
406                 temp.Add("enable", new PropertyValue(value));
407
408                 PropertyMap undelineMap = Underline;
409                 undelineMap.Merge(temp);
410
411                 SetValue(UnderlineProperty, undelineMap);
412                 NotifyPropertyChanged();
413
414             }
415         }
416
417         /// <summary>
418         /// The UnderlineColor property.<br />
419         /// Overrides the underline height from font metrics.<br />
420         /// </summary>
421         /// <since_tizen> 3 </since_tizen>
422         /// <remarks>
423         /// Deprecated.(API Level 6) Use Underline instead.
424         /// The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible.
425         /// </remarks>
426         [Obsolete("Please do not use this UnderlineColor(Deprecated). Please use Underline instead.")]
427         public Vector4 UnderlineColor
428         {
429             get
430             {
431                 Vector4 underlineColor = new Vector4();
432                 Underline.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor);
433                 return new Vector4(OnUnderlineColorChanged, underlineColor.X, underlineColor.Y, underlineColor.Z, underlineColor.W);
434             }
435             set
436             {
437                 PropertyMap temp = new PropertyMap();
438                 temp.Insert("color", new PropertyValue(value));
439
440                 PropertyMap undelineMap = Underline;
441                 undelineMap.Merge(temp);
442
443                 SetValue(UnderlineProperty, undelineMap);
444                 NotifyPropertyChanged();
445             }
446         }
447
448         /// <summary>
449         /// The UnderlineHeight property.<br />
450         /// Overrides the underline height from font metrics.<br />
451         /// </summary>
452         /// <since_tizen> 3 </since_tizen>
453         /// <remarks>
454         /// Deprecated.(API Level 6) Use Underline instead.
455         /// </remarks>
456         [Obsolete("Please do not use this UnderlineHeight(Deprecated). Please use Underline instead.")]
457         public float UnderlineHeight
458         {
459             get
460             {
461                 float underlineHeight = 0.0f;
462                 Underline.Find(TextLabel.Property.UNDERLINE, "height")?.Get(out underlineHeight);
463                 return underlineHeight;
464             }
465             set
466             {
467                 PropertyMap temp = new PropertyMap();
468                 temp.Insert("height", new PropertyValue(value));
469
470                 PropertyMap undelineMap = Underline;
471                 undelineMap.Merge(temp);
472
473                 SetValue(UnderlineProperty, undelineMap);
474                 NotifyPropertyChanged();
475             }
476         }
477
478         /// <summary>
479         /// The EnableMarkup property.<br />
480         /// Whether the mark-up processing is enabled.<br />
481         /// </summary>
482         /// <since_tizen> 3 </since_tizen>
483         public bool EnableMarkup
484         {
485             get
486             {
487                 return (bool)GetValue(EnableMarkupProperty);
488             }
489             set
490             {
491                 SetValue(EnableMarkupProperty, value);
492                 NotifyPropertyChanged();
493             }
494         }
495
496         /// <summary>
497         /// The EnableAutoScroll property.<br />
498         /// Starts or stops auto scrolling.<br />
499         /// </summary>
500         /// <since_tizen> 3 </since_tizen>
501         public bool EnableAutoScroll
502         {
503             get
504             {
505                 return (bool)GetValue(EnableAutoScrollProperty);
506             }
507             set
508             {
509                 SetValue(EnableAutoScrollProperty, value);
510                 NotifyPropertyChanged();
511             }
512         }
513
514         /// <summary>
515         /// The AutoScrollSpeed property.<br />
516         /// Sets the speed of scrolling in pixels per second.<br />
517         /// </summary>
518         /// <since_tizen> 3 </since_tizen>
519         public int AutoScrollSpeed
520         {
521             get
522             {
523                 return (int)GetValue(AutoScrollSpeedProperty);
524             }
525             set
526             {
527                 SetValue(AutoScrollSpeedProperty, value);
528                 NotifyPropertyChanged();
529             }
530         }
531
532         /// <summary>
533         /// The AutoScrollLoopCount property.<br />
534         /// Number of complete loops when scrolling enabled.<br />
535         /// </summary>
536         /// <since_tizen> 3 </since_tizen>
537         public int AutoScrollLoopCount
538         {
539             get
540             {
541                 return (int)GetValue(AutoScrollLoopCountProperty);
542             }
543             set
544             {
545                 SetValue(AutoScrollLoopCountProperty, value);
546                 NotifyPropertyChanged();
547             }
548         }
549
550         /// <summary>
551         /// The AutoScrollGap property.<br />
552         /// Gap before scrolling wraps.<br />
553         /// </summary>
554         /// <since_tizen> 3 </since_tizen>
555         public float AutoScrollGap
556         {
557             get
558             {
559                 return (float)GetValue(AutoScrollGapProperty);
560             }
561             set
562             {
563                 SetValue(AutoScrollGapProperty, value);
564                 NotifyPropertyChanged();
565             }
566         }
567
568         /// <summary>
569         /// The LineSpacing property.<br />
570         /// The default extra space between lines in points.<br />
571         /// </summary>
572         /// <since_tizen> 3 </since_tizen>
573         public float LineSpacing
574         {
575             get
576             {
577                 return (float)GetValue(LineSpacingProperty);
578             }
579             set
580             {
581                 SetValue(LineSpacingProperty, value);
582                 NotifyPropertyChangedAndRequestLayout();
583             }
584         }
585
586         /// <summary>
587         /// The Underline property.<br />
588         /// The default underline parameters.<br />
589         /// </summary>
590         /// <since_tizen> 3 </since_tizen>
591         public PropertyMap Underline
592         {
593             get
594             {
595                 return (PropertyMap)GetValue(UnderlineProperty);
596             }
597             set
598             {
599                 SetValue(UnderlineProperty, value);
600                 NotifyPropertyChanged();
601             }
602         }
603
604         /// <summary>
605         /// The Shadow property.<br />
606         /// The default shadow parameters.<br />
607         /// </summary>
608         /// <since_tizen> 3 </since_tizen>
609         public PropertyMap Shadow
610         {
611             get
612             {
613                 return (PropertyMap)GetValue(ShadowProperty);
614             }
615             set
616             {
617                 SetValue(ShadowProperty, value);
618                 NotifyPropertyChanged();
619             }
620         }
621
622         /// <summary>
623         /// Describes a text shadow for a TextLabel.
624         /// It is null by default.
625         /// </summary>
626         [EditorBrowsable(EditorBrowsableState.Never)]
627         public TextShadow TextShadow
628         {
629             get
630             {
631                 var value = (TextShadow)GetValue(TextShadowProperty);
632                 return value == null ? null : new TextShadow(value, OnTextShadowChanged);
633             }
634             set
635             {
636                 SetValue(TextShadowProperty, value);
637                 NotifyPropertyChanged();
638             }
639         }
640
641         /// <summary>
642         /// The Emboss property.<br />
643         /// The default emboss parameters.<br />
644         /// </summary>
645         /// <since_tizen> 3 </since_tizen>
646         public string Emboss
647         {
648             get
649             {
650                 return (string)GetValue(EmbossProperty);
651             }
652             set
653             {
654                 SetValue(EmbossProperty, value);
655                 NotifyPropertyChanged();
656             }
657         }
658
659         /// <summary>
660         /// The Outline property.<br />
661         /// The default outline parameters.<br />
662         /// </summary>
663         /// <since_tizen> 3 </since_tizen>
664         public PropertyMap Outline
665         {
666             get
667             {
668                 return (PropertyMap)GetValue(OutlineProperty);
669             }
670             set
671             {
672                 SetValue(OutlineProperty, value);
673                 NotifyPropertyChanged();
674             }
675         }
676
677         /// <summary>
678         /// The PixelSize property.<br />
679         /// The size of font in pixels.<br />
680         /// </summary>
681         /// <since_tizen> 3 </since_tizen>
682         public float PixelSize
683         {
684             get
685             {
686                 return (float)GetValue(PixelSizeProperty);
687             }
688             set
689             {
690                 SetValue(PixelSizeProperty, value);
691                 NotifyPropertyChangedAndRequestLayout();
692             }
693         }
694
695         /// <summary>
696         /// The Ellipsis property.<br />
697         /// Enable or disable the ellipsis.<br />
698         /// </summary>
699         /// <since_tizen> 3 </since_tizen>
700         public bool Ellipsis
701         {
702             get
703             {
704                 return (bool)GetValue(EllipsisProperty);
705             }
706             set
707             {
708                 SetValue(EllipsisProperty, value);
709                 NotifyPropertyChanged();
710             }
711         }
712
713         /// <summary>
714         /// The AutoScrollLoopDelay property.<br />
715         /// Do something.<br />
716         /// </summary>
717         /// <since_tizen> 3 </since_tizen>
718         public float AutoScrollLoopDelay
719         {
720             get
721             {
722                 return (float)GetValue(AutoScrollLoopDelayProperty);
723             }
724             set
725             {
726                 SetValue(AutoScrollLoopDelayProperty, value);
727                 NotifyPropertyChanged();
728             }
729         }
730
731         /// <summary>
732         /// The AutoScrollStopMode property.<br />
733         /// Do something.<br />
734         /// </summary>
735         /// <since_tizen> 3 </since_tizen>
736         public AutoScrollStopMode AutoScrollStopMode
737         {
738             get
739             {
740                 return (AutoScrollStopMode)GetValue(AutoScrollStopModeProperty);
741             }
742             set
743             {
744                 SetValue(AutoScrollStopModeProperty, value);
745                 NotifyPropertyChanged();
746             }
747         }
748
749         /// <summary>
750         /// The line count of the text.
751         /// </summary>
752         /// <since_tizen> 3 </since_tizen>
753         public int LineCount
754         {
755             get
756             {
757                 int temp = 0;
758                 GetProperty(TextLabel.Property.LINE_COUNT).Get(out temp);
759                 return temp;
760             }
761         }
762
763         /// <summary>
764         /// The LineWrapMode property.<br />
765         /// line wrap mode when the text lines over layout width.<br />
766         /// </summary>
767         /// <since_tizen> 4 </since_tizen>
768         public LineWrapMode LineWrapMode
769         {
770             get
771             {
772                 return (LineWrapMode)GetValue(LineWrapModeProperty);
773             }
774             set
775             {
776                 SetValue(LineWrapModeProperty, value);
777                 NotifyPropertyChanged();
778             }
779         }
780
781         /// <summary>
782         /// The direction of the text such as left to right or right to left.
783         /// </summary>
784         /// <since_tizen> 5 </since_tizen>
785         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
786         [EditorBrowsable(EditorBrowsableState.Never)]
787         public TextDirection TextDirection
788         {
789             get
790             {
791                 int temp = 0;
792                 GetProperty(TextLabel.Property.TEXT_DIRECTION).Get(out temp);
793                 return (TextDirection)temp;
794             }
795         }
796
797         /// <summary>
798         /// The vertical line alignment of the text.
799         /// </summary>
800         /// <since_tizen> 5 </since_tizen>
801         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
802         [EditorBrowsable(EditorBrowsableState.Never)]
803         public VerticalLineAlignment VerticalLineAlignment
804         {
805             get
806             {
807                 return (VerticalLineAlignment)GetValue(VerticalLineAlignmentProperty);
808             }
809             set
810             {
811                 SetValue(VerticalLineAlignmentProperty, value);
812                 NotifyPropertyChanged();
813             }
814         }
815
816         /// <summary>
817         /// The text alignment to match the direction of the system language.
818         /// </summary>
819         /// <since_tizen> 6 </since_tizen>
820         public bool MatchSystemLanguageDirection
821         {
822             get
823             {
824                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
825             }
826             set
827             {
828                 SetValue(MatchSystemLanguageDirectionProperty, value);
829                 NotifyPropertyChanged();
830             }
831         }
832
833         /// <summary>
834         /// The text fit parameters.<br />
835         /// The textFit map contains the following keys :<br />
836         /// - enable (bool type) : True to enable the text fit or false to disable(the default value is false)<br />
837         /// - minSize (float type) : Minimum Size for text fit(the default value is 10.f)<br />
838         /// - maxSize (float type) : Maximum Size for text fit(the default value is 100.f)<br />
839         /// - stepSize (float type) : Step Size for font increase(the default value is 1.f)<br />
840         /// - fontSize (string type) : The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize")<br />
841         /// </summary>
842         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
843         [EditorBrowsable(EditorBrowsableState.Never)]
844         public PropertyMap TextFit
845         {
846             get
847             {
848                 return (PropertyMap)GetValue(TextFitProperty);
849             }
850             set
851             {
852                 SetValue(TextFitProperty, value);
853                 NotifyPropertyChanged();
854             }
855         }
856
857         /// <summary>
858         /// The MinLineSize property.<br />
859         /// </summary>
860         /// <since_tizen> 8 </since_tizen>
861         [EditorBrowsable(EditorBrowsableState.Never)]
862         public float MinLineSize
863         {
864             get
865             {
866                 return (float)GetValue(MinLineSizeProperty);
867             }
868             set
869             {
870                 SetValue(MinLineSizeProperty, value);
871                 NotifyPropertyChangedAndRequestLayout();
872             }
873         }
874
875         /// <summary>
876         /// Downcasts a handle to textLabel handle
877         /// </summary>
878         /// <param name="handle"></param>
879         /// <returns></returns>
880         /// <since_tizen> 3 </since_tizen>
881         /// Please do not use! this will be deprecated!
882         /// Instead please use as keyword.
883         [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
884             "Like: " +
885             "BaseHandle handle = new TextLabel(\"Hello World!\"); " +
886             "TextLabel label = handle as TextLabel")]
887         [EditorBrowsable(EditorBrowsableState.Never)]
888         public static TextLabel DownCast(BaseHandle handle)
889         {
890             TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
891
892             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
893             return ret;
894         }
895
896         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
897         {
898             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
899         }
900
901         /// This will not be public opened.
902         [EditorBrowsable(EditorBrowsableState.Never)]
903         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
904         {
905             Interop.TextLabel.delete_TextLabel(swigCPtr);
906         }
907
908         /// <summary>
909         /// Get attribues, it is abstract function and must be override.
910         /// </summary>
911         /// <since_tizen> 6 </since_tizen>
912         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
913         [EditorBrowsable(EditorBrowsableState.Never)]
914         protected override ViewStyle GetViewStyle()
915         {
916             return new TextLabelStyle();
917         }
918
919         internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
920         {
921             var textLabel = (TextLabel)bindable;
922             textLabel.TranslatableTextSelector.Clone((Selector<string>)newValue);
923         },
924         defaultValueCreator: (bindable) =>
925         {
926             var textLabel = (TextLabel)bindable;
927             return textLabel.TranslatableTextSelector;
928         });
929         internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
930         {
931             var textLabel = (TextLabel)bindable;
932             textLabel.textSelector.Clone((Selector<string>)newValue);
933         },
934         defaultValueCreator: (bindable) =>
935         {
936             var textLabel = (TextLabel)bindable;
937             return textLabel.textSelector;
938         });
939         internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
940         {
941             var textLabel = (TextLabel)bindable;
942             textLabel.fontFamilySelector.Clone((Selector<string>)newValue);
943         },
944         defaultValueCreator: (bindable) =>
945         {
946             var textLabel = (TextLabel)bindable;
947             return textLabel.fontFamilySelector;
948         });
949         internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
950         {
951             var textLabel = (TextLabel)bindable;
952             textLabel.pointSizeSelector.Clone((Selector<float?>)newValue);
953         },
954         defaultValueCreator: (bindable) =>
955         {
956             var textLabel = (TextLabel)bindable;
957             return textLabel.pointSizeSelector;
958         });
959         internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
960         {
961             var textLabel = (TextLabel)bindable;
962             textLabel.textColorSelector.Clone((Selector<Color>)newValue);
963         },
964         defaultValueCreator: (bindable) =>
965         {
966             var textLabel = (TextLabel)bindable;
967             return textLabel.textColorSelector;
968         });
969
970         private TriggerableSelector<string> translatableTextSelector;
971         private TriggerableSelector<string> TranslatableTextSelector
972         {
973             get
974             {
975                 if (null == translatableTextSelector)
976                 {
977                     translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
978                 }
979                 return translatableTextSelector;
980             }
981         }
982
983         private TriggerableSelector<string> _textSelector;
984         private TriggerableSelector<string> textSelector
985         {
986             get
987             {
988                 if (null == _textSelector)
989                 {
990                     _textSelector = new TriggerableSelector<string>(this, TextProperty);
991                 }
992                 return _textSelector;
993             }
994         }
995
996         private TriggerableSelector<string> _fontFamilySelector;
997         private TriggerableSelector<string> fontFamilySelector
998         {
999             get
1000             {
1001                 if (null == _fontFamilySelector)
1002                 {
1003                     _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
1004                 }
1005                 return _fontFamilySelector;
1006             }
1007         }
1008
1009         private TriggerableSelector<Color> _textColorSelector;
1010         private TriggerableSelector<Color> textColorSelector
1011         {
1012             get
1013             {
1014                 if (null == _textColorSelector)
1015                 {
1016                     _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
1017                 }
1018                 return _textColorSelector;
1019             }
1020         }
1021
1022         private TriggerableSelector<float?> _pointSizeSelector;
1023         private TriggerableSelector<float?> pointSizeSelector
1024         {
1025             get
1026             {
1027                 if (null == _pointSizeSelector)
1028                 {
1029                     _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
1030                 }
1031                 return _pointSizeSelector;
1032             }
1033         }
1034
1035         /// <summary>
1036         /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event.
1037         /// </summary>
1038         protected override void OnBindingContextChanged()
1039         {
1040             base.OnBindingContextChanged();
1041         }
1042
1043         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1044         {
1045             Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
1046         }
1047
1048         private void  NotifyPropertyChangedAndRequestLayout()
1049         {
1050             NotifyPropertyChanged();
1051             Layout?.RequestLayout();
1052         }
1053
1054         internal new class Property
1055         {
1056             internal static readonly int RENDERING_BACKEND = Interop.TextLabel.TextLabel_Property_RENDERING_BACKEND_get();
1057             internal static readonly int TEXT = Interop.TextLabel.TextLabel_Property_TEXT_get();
1058             internal static readonly int FONT_FAMILY = Interop.TextLabel.TextLabel_Property_FONT_FAMILY_get();
1059             internal static readonly int FONT_STYLE = Interop.TextLabel.TextLabel_Property_FONT_STYLE_get();
1060             internal static readonly int POINT_SIZE = Interop.TextLabel.TextLabel_Property_POINT_SIZE_get();
1061             internal static readonly int MULTI_LINE = Interop.TextLabel.TextLabel_Property_MULTI_LINE_get();
1062             internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
1063             internal static readonly int VERTICAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_ALIGNMENT_get();
1064             internal static readonly int TEXT_COLOR = Interop.TextLabel.TextLabel_Property_TEXT_COLOR_get();
1065             internal static readonly int ENABLE_MARKUP = Interop.TextLabel.TextLabel_Property_ENABLE_MARKUP_get();
1066             internal static readonly int ENABLE_AUTO_SCROLL = Interop.TextLabel.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
1067             internal static readonly int AUTO_SCROLL_SPEED = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_SPEED_get();
1068             internal static readonly int AUTO_SCROLL_LOOP_COUNT = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
1069             internal static readonly int AUTO_SCROLL_GAP = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_GAP_get();
1070             internal static readonly int LINE_SPACING = Interop.TextLabel.TextLabel_Property_LINE_SPACING_get();
1071             internal static readonly int UNDERLINE = Interop.TextLabel.TextLabel_Property_UNDERLINE_get();
1072             internal static readonly int SHADOW = Interop.TextLabel.TextLabel_Property_SHADOW_get();
1073             internal static readonly int EMBOSS = Interop.TextLabel.TextLabel_Property_EMBOSS_get();
1074             internal static readonly int OUTLINE = Interop.TextLabel.TextLabel_Property_OUTLINE_get();
1075             internal static readonly int PIXEL_SIZE = Interop.TextLabel.TextLabel_Property_PIXEL_SIZE_get();
1076             internal static readonly int ELLIPSIS = Interop.TextLabel.TextLabel_Property_ELLIPSIS_get();
1077             internal static readonly int AUTO_SCROLL_STOP_MODE = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
1078             internal static readonly int AUTO_SCROLL_LOOP_DELAY = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
1079             internal static readonly int LINE_COUNT = Interop.TextLabel.TextLabel_Property_LINE_COUNT_get();
1080             internal static readonly int LINE_WRAP_MODE = Interop.TextLabel.TextLabel_Property_LINE_WRAP_MODE_get();
1081             internal static readonly int TEXT_DIRECTION = Interop.TextLabel.TextLabel_Property_TEXT_DIRECTION_get();
1082             internal static readonly int VERTICAL_LINE_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get();
1083             internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextLabel.TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1084             internal static readonly int TEXT_FIT = Interop.TextLabel.TextLabel_Property_TEXT_FIT_get();
1085             internal static readonly int MIN_LINE_SIZE = Interop.TextLabel.TextLabel_Property_MIN_LINE_SIZE_get();
1086         }
1087
1088         private void OnShadowColorChanged(float x, float y, float z, float w)
1089         {
1090             ShadowColor = new Vector4(x, y, z, w);
1091         }
1092         private void OnShadowOffsetChanged(float x, float y)
1093         {
1094             ShadowOffset = new Vector2(x, y);
1095         }
1096         private void OnTextColorChanged(float r, float g, float b, float a)
1097         {
1098             TextColor = new Color(r, g, b, a);
1099         }
1100         private void OnUnderlineColorChanged(float x, float y, float z, float w)
1101         {
1102             UnderlineColor = new Vector4(x, y, z, w);
1103         }
1104
1105         private void OnTextShadowChanged(TextShadow instance)
1106         {
1107             TextShadow = instance;
1108         }
1109
1110         private void OnControlStateChangedForShadow(object obj, ControlStateChangedEventArgs controlStateChangedInfo)
1111         {
1112             UpdateTextShadowVisual();
1113         }
1114
1115         private void UpdateTextShadowVisual()
1116         {
1117             TextShadow shadow = (textShadow != null && !textShadow.IsEmpty()) ? textShadow.GetValue() : textShadow?.GetValue();
1118             Object.SetProperty(swigCPtr, Property.SHADOW, TextShadow.ToPropertyValue(shadow));
1119         }
1120     }
1121 }