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