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