2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
21 using System.Globalization;
22 using System.ComponentModel;
23 using Tizen.NUI.Binding;
25 namespace Tizen.NUI.BaseComponents
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 />
32 /// <since_tizen> 3 </since_tizen>
33 [ContentProperty("Text")]
34 public class TextLabel : View
36 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
37 [EditorBrowsable(EditorBrowsableState.Never)]
38 public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
40 var textLabel = (TextLabel)bindable;
43 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue));
46 defaultValueCreator:(bindable) =>
48 var textLabel = (TextLabel)bindable;
50 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT).Get(out temp);
53 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
54 [EditorBrowsable(EditorBrowsableState.Never)]
55 public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
57 var textLabel = (TextLabel)bindable;
60 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue));
63 defaultValueCreator:(bindable) =>
65 var textLabel = (TextLabel)bindable;
67 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_FAMILY).Get(out temp);
70 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
71 [EditorBrowsable(EditorBrowsableState.Never)]
72 public static readonly BindableProperty FontStyleProperty = BindableProperty.Create("FontStyle", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
74 var textLabel = (TextLabel)bindable;
77 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
80 defaultValueCreator:(bindable) =>
82 var textLabel = (TextLabel)bindable;
83 PropertyMap temp = new PropertyMap();
84 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_STYLE).Get(temp);
87 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
88 [EditorBrowsable(EditorBrowsableState.Never)]
89 public static readonly BindableProperty PointSizeProperty = BindableProperty.Create("PointSize", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
91 var textLabel = (TextLabel)bindable;
94 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue));
97 defaultValueCreator:(bindable) =>
99 var textLabel = (TextLabel)bindable;
101 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.POINT_SIZE).Get(out temp);
104 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
105 [EditorBrowsable(EditorBrowsableState.Never)]
106 public static readonly BindableProperty MultiLineProperty = BindableProperty.Create("MultiLine", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
108 var textLabel = (TextLabel)bindable;
109 if (newValue != null)
111 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.MULTI_LINE, new Tizen.NUI.PropertyValue((bool)newValue));
114 defaultValueCreator:(bindable) =>
116 var textLabel = (TextLabel)bindable;
118 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.MULTI_LINE).Get(out temp);
121 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
122 [EditorBrowsable(EditorBrowsableState.Never)]
123 public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment), typeof(TextLabel), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) =>
125 var textLabel = (TextLabel)bindable;
126 string valueToString = "";
127 if (newValue != null)
129 switch ((HorizontalAlignment)newValue)
131 case HorizontalAlignment.Begin: { valueToString = "BEGIN"; break; }
132 case HorizontalAlignment.Center: { valueToString = "CENTER"; break; }
133 case HorizontalAlignment.End: { valueToString = "END"; break; }
134 default: { valueToString = "BEGIN"; break; }
136 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
139 defaultValueCreator:(bindable) =>
141 var textLabel = (TextLabel)bindable;
143 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
145 NUILog.Error("HorizontalAlignment get error!");
149 case "BEGIN": return HorizontalAlignment.Begin;
150 case "CENTER": return HorizontalAlignment.Center;
151 case "END": return HorizontalAlignment.End;
152 default: return HorizontalAlignment.Begin;
155 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
156 [EditorBrowsable(EditorBrowsableState.Never)]
157 public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create("VerticalAlignment", typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
159 var textLabel = (TextLabel)bindable;
160 string valueToString = "";
161 if (newValue != null)
163 switch ((VerticalAlignment)newValue)
165 case VerticalAlignment.Top: { valueToString = "TOP"; break; }
166 case VerticalAlignment.Center: { valueToString = "CENTER"; break; }
167 case VerticalAlignment.Bottom: { valueToString = "BOTTOM"; break; }
168 default: { valueToString = "BOTTOM"; break; }
170 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
173 defaultValueCreator:(bindable) =>
175 var textLabel = (TextLabel)bindable;
177 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT).Get(out temp) == false)
179 NUILog.Error("VerticalAlignment get error!");
184 case "TOP": return VerticalAlignment.Top;
185 case "CENTER": return VerticalAlignment.Center;
186 case "BOTTOM": return VerticalAlignment.Bottom;
187 default: return VerticalAlignment.Bottom;
190 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
191 [EditorBrowsable(EditorBrowsableState.Never)]
192 public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Color), typeof(TextLabel), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) =>
194 var textLabel = (TextLabel)bindable;
195 if (newValue != null)
197 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue));
200 defaultValueCreator:(bindable) =>
202 var textLabel = (TextLabel)bindable;
203 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
204 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR).Get(temp);
207 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
208 [EditorBrowsable(EditorBrowsableState.Never)]
209 public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create("ShadowOffset", typeof(Vector2), typeof(TextLabel), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) =>
211 var textLabel = (TextLabel)bindable;
212 if (newValue != null)
214 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_OFFSET, new Tizen.NUI.PropertyValue((Vector2)newValue));
217 defaultValueCreator:(bindable) =>
219 var textLabel = (TextLabel)bindable;
220 Vector2 temp = new Vector2(0.0f, 0.0f);
221 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_OFFSET).Get(temp);
224 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
225 [EditorBrowsable(EditorBrowsableState.Never)]
226 public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create("ShadowColor", typeof(Vector4), typeof(TextLabel), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
228 var textLabel = (TextLabel)bindable;
229 if (newValue != null)
231 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue));
234 defaultValueCreator:(bindable) =>
236 var textLabel = (TextLabel)bindable;
237 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
238 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_COLOR).Get(temp);
241 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
242 [EditorBrowsable(EditorBrowsableState.Never)]
243 public static readonly BindableProperty UnderlineEnabledProperty = BindableProperty.Create("UnderlineEnabled", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
245 var textLabel = (TextLabel)bindable;
246 if (newValue != null)
248 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue));
251 defaultValueCreator:(bindable) =>
253 var textLabel = (TextLabel)bindable;
255 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_ENABLED).Get(out temp);
258 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
259 [EditorBrowsable(EditorBrowsableState.Never)]
260 public static readonly BindableProperty UnderlineColorProperty = BindableProperty.Create("UnderlineColor", typeof(Vector4), typeof(TextLabel), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
262 var textLabel = (TextLabel)bindable;
263 if (newValue != null)
265 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue));
268 defaultValueCreator:(bindable) =>
270 var textLabel = (TextLabel)bindable;
271 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
272 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_COLOR).Get(temp);
275 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
276 [EditorBrowsable(EditorBrowsableState.Never)]
277 public static readonly BindableProperty UnderlineHeightProperty = BindableProperty.Create("UnderlineHeight", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
279 var textLabel = (TextLabel)bindable;
280 if (newValue != null)
282 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
285 defaultValueCreator:(bindable) =>
287 var textLabel = (TextLabel)bindable;
289 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_HEIGHT).Get(out temp);
292 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
293 [EditorBrowsable(EditorBrowsableState.Never)]
294 public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
296 var textLabel = (TextLabel)bindable;
297 if (newValue != null)
299 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue));
302 defaultValueCreator:(bindable) =>
304 var textLabel = (TextLabel)bindable;
306 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP).Get(out temp);
309 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
310 [EditorBrowsable(EditorBrowsableState.Never)]
311 public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create("EnableAutoScroll", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
313 var textLabel = (TextLabel)bindable;
314 if (newValue != null)
316 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue));
319 defaultValueCreator:(bindable) =>
321 var textLabel = (TextLabel)bindable;
323 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL).Get(out temp);
326 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
327 [EditorBrowsable(EditorBrowsableState.Never)]
328 public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create("AutoScrollSpeed", typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
330 var textLabel = (TextLabel)bindable;
331 if (newValue != null)
333 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue((int)newValue));
336 defaultValueCreator:(bindable) =>
338 var textLabel = (TextLabel)bindable;
340 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED).Get(out temp);
343 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
344 [EditorBrowsable(EditorBrowsableState.Never)]
345 public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create("AutoScrollLoopCount", typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
347 var textLabel = (TextLabel)bindable;
348 if (newValue != null)
350 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue((int)newValue));
353 defaultValueCreator:(bindable) =>
355 var textLabel = (TextLabel)bindable;
357 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT).Get(out temp);
360 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
361 [EditorBrowsable(EditorBrowsableState.Never)]
362 public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create("AutoScrollGap", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
364 var textLabel = (TextLabel)bindable;
365 if (newValue != null)
367 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue((float)newValue));
370 defaultValueCreator:(bindable) =>
372 var textLabel = (TextLabel)bindable;
374 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP).Get(out temp);
377 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
378 [EditorBrowsable(EditorBrowsableState.Never)]
379 public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create("LineSpacing", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
381 var textLabel = (TextLabel)bindable;
382 if (newValue != null)
384 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue));
387 defaultValueCreator:(bindable) =>
389 var textLabel = (TextLabel)bindable;
391 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING).Get(out temp);
394 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
395 [EditorBrowsable(EditorBrowsableState.Never)]
396 public static readonly BindableProperty UnderlineProperty = BindableProperty.Create("Underline", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
398 var textLabel = (TextLabel)bindable;
399 if (newValue != null)
401 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
404 defaultValueCreator:(bindable) =>
406 var textLabel = (TextLabel)bindable;
407 PropertyMap temp = new PropertyMap();
408 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE).Get(temp);
411 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
412 [EditorBrowsable(EditorBrowsableState.Never)]
413 public static readonly BindableProperty ShadowProperty = BindableProperty.Create("Shadow", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
415 var textLabel = (TextLabel)bindable;
416 if (newValue != null)
418 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
421 defaultValueCreator:(bindable) =>
423 var textLabel = (TextLabel)bindable;
424 PropertyMap temp = new PropertyMap();
425 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW).Get(temp);
428 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
429 [EditorBrowsable(EditorBrowsableState.Never)]
430 public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
432 var textLabel = (TextLabel)bindable;
433 if (newValue != null)
435 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue));
438 defaultValueCreator:(bindable) =>
440 var textLabel = (TextLabel)bindable;
442 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS).Get(out temp);
445 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
446 [EditorBrowsable(EditorBrowsableState.Never)]
447 public static readonly BindableProperty OutlineProperty = BindableProperty.Create("Outline", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
449 var textLabel = (TextLabel)bindable;
450 if (newValue != null)
452 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
455 defaultValueCreator:(bindable) =>
457 var textLabel = (TextLabel)bindable;
458 PropertyMap temp = new PropertyMap();
459 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE).Get(temp);
462 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
463 [EditorBrowsable(EditorBrowsableState.Never)]
464 public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
466 var textLabel = (TextLabel)bindable;
467 if (newValue != null)
469 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue));
472 defaultValueCreator:(bindable) =>
474 var textLabel = (TextLabel)bindable;
476 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE).Get(out temp);
479 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
480 [EditorBrowsable(EditorBrowsableState.Never)]
481 public static readonly BindableProperty EllipsisProperty = BindableProperty.Create("Ellipsis", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
483 var textLabel = (TextLabel)bindable;
484 if (newValue != null)
486 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue));
489 defaultValueCreator:(bindable) =>
491 var textLabel = (TextLabel)bindable;
493 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS).Get(out temp);
496 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
497 [EditorBrowsable(EditorBrowsableState.Never)]
498 public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create("AutoScrollLoopDelay", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
500 var textLabel = (TextLabel)bindable;
501 if (newValue != null)
503 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY, new Tizen.NUI.PropertyValue((float)newValue));
506 defaultValueCreator:(bindable) =>
508 var textLabel = (TextLabel)bindable;
510 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY).Get(out temp);
513 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
514 [EditorBrowsable(EditorBrowsableState.Never)]
515 public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create("AutoScrollStopMode", typeof(AutoScrollStopMode), typeof(TextLabel), AutoScrollStopMode.FinishLoop, propertyChanged: (bindable, oldValue, newValue) =>
517 var textLabel = (TextLabel)bindable;
518 if (newValue != null)
520 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
523 defaultValueCreator:(bindable) =>
525 var textLabel = (TextLabel)bindable;
527 if(Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false)
529 NUILog.Error("AutoScrollStopMode get error!");
533 case "FINISH_LOOP": return AutoScrollStopMode.FinishLoop;
534 case "IMMEDIATE": return AutoScrollStopMode.Immediate;
535 default: return AutoScrollStopMode.FinishLoop;
538 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
539 [EditorBrowsable(EditorBrowsableState.Never)]
540 public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create("LineWrapMode", typeof(LineWrapMode), typeof(TextLabel), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) =>
542 var textLabel = (TextLabel)bindable;
543 if (newValue != null)
545 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
548 defaultValueCreator:(bindable) =>
550 var textLabel = (TextLabel)bindable;
552 if (false == Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE).Get(out temp))
554 NUILog.Error("LineWrapMode get error!");
556 return (LineWrapMode)temp;
558 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
559 [EditorBrowsable(EditorBrowsableState.Never)]
560 public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create("VerticalLineAlignment", typeof(VerticalLineAlignment), typeof(TextLabel), VerticalLineAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
562 var textLabel = (TextLabel)bindable;
563 if (newValue != null)
565 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue));
568 defaultValueCreator:(bindable) =>
570 var textLabel = (TextLabel)bindable;
572 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT).Get(out temp);
573 return (VerticalLineAlignment)temp;
577 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
578 private string textLabelSid = null;
579 private bool systemlangTextFlag = false;
580 internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
582 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
585 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
587 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
591 /// Downcasts a handle to textLabel handle
593 /// <param name="handle"></param>
594 /// <returns></returns>
595 /// <since_tizen> 3 </since_tizen>
596 /// Please do not use! this will be deprecated!
597 /// Instead please use as keyword.
598 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
600 "BaseHandle handle = new TextLabel(\"Hello World!\"); " +
601 "TextLabel label = handle as TextLabel")]
602 [EditorBrowsable(EditorBrowsableState.Never)]
603 public static TextLabel DownCast(BaseHandle handle)
605 TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 /// <since_tizen> 3 </since_tizen>
615 protected override void Dispose(DisposeTypes type)
622 if(type == DisposeTypes.Explicit)
625 //Release your own managed resources here.
626 //You should release all of your own disposable objects here.
629 //Release your own unmanaged resources here.
630 //You should not access any managed member here except static instance.
631 //because the execution order of Finalizes is non-deterministic.
633 if (swigCPtr.Handle != global::System.IntPtr.Zero)
638 NDalicPINVOKE.delete_TextLabel(swigCPtr);
640 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
646 internal new class Property
648 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get();
649 internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get();
650 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextLabel_Property_FONT_FAMILY_get();
651 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextLabel_Property_FONT_STYLE_get();
652 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextLabel_Property_POINT_SIZE_get();
653 internal static readonly int MULTI_LINE = NDalicPINVOKE.TextLabel_Property_MULTI_LINE_get();
654 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
655 internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_VERTICAL_ALIGNMENT_get();
656 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_get();
657 internal static readonly int SHADOW_OFFSET = NDalicPINVOKE.TextLabel_Property_SHADOW_OFFSET_get();
658 internal static readonly int SHADOW_COLOR = NDalicPINVOKE.TextLabel_Property_SHADOW_COLOR_get();
659 internal static readonly int UNDERLINE_ENABLED = NDalicPINVOKE.TextLabel_Property_UNDERLINE_ENABLED_get();
660 internal static readonly int UNDERLINE_COLOR = NDalicPINVOKE.TextLabel_Property_UNDERLINE_COLOR_get();
661 internal static readonly int UNDERLINE_HEIGHT = NDalicPINVOKE.TextLabel_Property_UNDERLINE_HEIGHT_get();
662 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextLabel_Property_ENABLE_MARKUP_get();
663 internal static readonly int ENABLE_AUTO_SCROLL = NDalicPINVOKE.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
664 internal static readonly int AUTO_SCROLL_SPEED = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_SPEED_get();
665 internal static readonly int AUTO_SCROLL_LOOP_COUNT = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
666 internal static readonly int AUTO_SCROLL_GAP = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_GAP_get();
667 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextLabel_Property_LINE_SPACING_get();
668 internal static readonly int UNDERLINE = NDalicPINVOKE.TextLabel_Property_UNDERLINE_get();
669 internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get();
670 internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get();
671 internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get();
672 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextLabel_Property_PIXEL_SIZE_get();
673 internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get();
674 internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
675 internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
676 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextLabel_Property_LINE_COUNT_get();
677 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextLabel_Property_LINE_WRAP_MODE_get();
678 internal static readonly int TEXT_DIRECTION = NDalicManualPINVOKE.TextLabel_Property_TEXT_DIRECTION_get();
679 internal static readonly int VERTICAL_LINE_ALIGNMENT = NDalicManualPINVOKE.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get();
683 /// Creates the TextLabel control.
685 /// <since_tizen> 3 </since_tizen>
686 public TextLabel() : this(NDalicPINVOKE.TextLabel_New__SWIG_0(), true)
688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
693 /// Creates the TextLabel control.
695 /// <param name="text">The text to display</param>
696 /// <since_tizen> 3 </since_tizen>
697 public TextLabel(string text) : this(NDalicPINVOKE.TextLabel_New__SWIG_1(text), true)
699 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
703 internal TextLabel(TextLabel handle) : this(NDalicPINVOKE.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708 protected override void OnBindingContextChanged()
710 base.OnBindingContextChanged();
714 /// The TranslatableText property.<br />
715 /// The text can set the SID value.<br />
717 /// <exception cref='ArgumentNullException'>
718 /// ResourceManager about multilingual is null.
720 /// <since_tizen> 4 </since_tizen>
721 public string TranslatableText
729 if (NUIApplication.MultilingualResourceManager == null)
731 throw new ArgumentNullException("ResourceManager about multilingual is null");
733 string translatableText = null;
734 textLabelSid = value;
735 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
736 if (translatableText != null)
738 Text = translatableText;
739 if (systemlangTextFlag == false)
741 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
742 systemlangTextFlag = true;
749 NotifyPropertyChanged();
752 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
754 Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
758 /// The Text property.<br />
759 /// The text to display in the UTF-8 format.<br />
761 /// <since_tizen> 3 </since_tizen>
766 return (string)GetValue(TextProperty);
770 SetValue(TextProperty, value);
771 NotifyPropertyChanged();
776 /// The FontFamily property.<br />
777 /// The requested font family to use.<br />
779 /// <since_tizen> 3 </since_tizen>
780 public string FontFamily
784 return (string)GetValue(FontFamilyProperty);
788 SetValue(FontFamilyProperty, value);
789 NotifyPropertyChanged();
794 /// The FontStyle property.<br />
795 /// The requested font style to use.<br />
797 /// <since_tizen> 3 </since_tizen>
798 public PropertyMap FontStyle
802 return (PropertyMap)GetValue(FontStyleProperty);
806 SetValue(FontStyleProperty, value);
807 NotifyPropertyChanged();
812 /// The PointSize property.<br />
813 /// The size of font in points.<br />
815 /// <since_tizen> 3 </since_tizen>
816 public float PointSize
820 return (float)GetValue(PointSizeProperty);
824 SetValue(PointSizeProperty, value);
825 NotifyPropertyChanged();
830 /// The MultiLine property.<br />
831 /// The single-line or multi-line layout option.<br />
833 /// <since_tizen> 3 </since_tizen>
834 public bool MultiLine
838 return (bool)GetValue(MultiLineProperty);
842 SetValue(MultiLineProperty, value);
843 NotifyPropertyChanged();
848 /// The HorizontalAlignment property.<br />
849 /// The line horizontal alignment.<br />
851 /// <since_tizen> 3 </since_tizen>
852 public HorizontalAlignment HorizontalAlignment
856 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
860 SetValue(HorizontalAlignmentProperty, value);
861 NotifyPropertyChanged();
866 /// The VerticalAlignment property.<br />
867 /// The line vertical alignment.<br />
869 /// <since_tizen> 3 </since_tizen>
870 public VerticalAlignment VerticalAlignment
874 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
878 SetValue(VerticalAlignmentProperty, value);
879 NotifyPropertyChanged();
884 /// The TextColor property.<br />
885 /// The color of the text.<br />
886 /// Animation framework can be used to change the color of the text when not using mark up.<br />
887 /// Cannot animate the color when text is auto scrolling.<br />
889 /// <since_tizen> 3 </since_tizen>
890 public Color TextColor
894 return (Color)GetValue(TextColorProperty);
898 SetValue(TextColorProperty, value);
899 NotifyPropertyChanged();
904 /// The ShadowOffset property.<br />
905 /// The drop shadow offset 0 indicates no shadow.<br />
907 /// <since_tizen> 3 </since_tizen>
908 public Vector2 ShadowOffset
912 return (Vector2)GetValue(ShadowOffsetProperty);
916 SetValue(ShadowOffsetProperty, value);
917 NotifyPropertyChanged();
922 /// The ShadowColor property.<br />
923 /// The color of a drop shadow.<br />
925 /// <since_tizen> 3 </since_tizen>
926 public Vector4 ShadowColor
930 return (Vector4)GetValue(ShadowColorProperty);
934 SetValue(ShadowColorProperty, value);
935 NotifyPropertyChanged();
940 /// The UnderlineEnabled property.<br />
941 /// The underline enabled flag.<br />
943 /// <since_tizen> 3 </since_tizen>
944 public bool UnderlineEnabled
948 return (bool)GetValue(UnderlineEnabledProperty);
952 SetValue(UnderlineEnabledProperty, value);
953 NotifyPropertyChanged();
958 /// The UnderlineColor property.<br />
959 /// Overrides the underline height from font metrics.<br />
961 /// <since_tizen> 3 </since_tizen>
962 public Vector4 UnderlineColor
966 return (Vector4)GetValue(UnderlineColorProperty);
970 SetValue(UnderlineColorProperty, value);
971 NotifyPropertyChanged();
976 /// The UnderlineHeight property.<br />
977 /// Overrides the underline height from font metrics.<br />
979 /// <since_tizen> 3 </since_tizen>
980 public float UnderlineHeight
984 return (float)GetValue(UnderlineHeightProperty);
988 SetValue(UnderlineHeightProperty, value);
989 NotifyPropertyChanged();
994 /// The EnableMarkup property.<br />
995 /// Whether the mark-up processing is enabled.<br />
997 /// <since_tizen> 3 </since_tizen>
998 public bool EnableMarkup
1002 return (bool)GetValue(EnableMarkupProperty);
1006 SetValue(EnableMarkupProperty, value);
1007 NotifyPropertyChanged();
1012 /// The EnableAutoScroll property.<br />
1013 /// Starts or stops auto scrolling.<br />
1015 /// <since_tizen> 3 </since_tizen>
1016 public bool EnableAutoScroll
1020 return (bool)GetValue(EnableAutoScrollProperty);
1024 SetValue(EnableAutoScrollProperty, value);
1025 NotifyPropertyChanged();
1030 /// The AutoScrollSpeed property.<br />
1031 /// Sets the speed of scrolling in pixels per second.<br />
1033 /// <since_tizen> 3 </since_tizen>
1034 public int AutoScrollSpeed
1038 return (int)GetValue(AutoScrollSpeedProperty);
1042 SetValue(AutoScrollSpeedProperty, value);
1043 NotifyPropertyChanged();
1048 /// The AutoScrollLoopCount property.<br />
1049 /// Number of complete loops when scrolling enabled.<br />
1051 /// <since_tizen> 3 </since_tizen>
1052 public int AutoScrollLoopCount
1056 return (int)GetValue(AutoScrollLoopCountProperty);
1060 SetValue(AutoScrollLoopCountProperty, value);
1061 NotifyPropertyChanged();
1066 /// The AutoScrollGap property.<br />
1067 /// Gap before scrolling wraps.<br />
1069 /// <since_tizen> 3 </since_tizen>
1070 public float AutoScrollGap
1074 return (float)GetValue(AutoScrollGapProperty);
1078 SetValue(AutoScrollGapProperty, value);
1079 NotifyPropertyChanged();
1084 /// The LineSpacing property.<br />
1085 /// The default extra space between lines in points.<br />
1087 /// <since_tizen> 3 </since_tizen>
1088 public float LineSpacing
1092 return (float)GetValue(LineSpacingProperty);
1096 SetValue(LineSpacingProperty, value);
1097 NotifyPropertyChanged();
1102 /// The Underline property.<br />
1103 /// The default underline parameters.<br />
1105 /// <since_tizen> 3 </since_tizen>
1106 public PropertyMap Underline
1110 return (PropertyMap)GetValue(UnderlineProperty);
1114 SetValue(UnderlineProperty, value);
1115 NotifyPropertyChanged();
1120 /// The Shadow property.<br />
1121 /// The default shadow parameters.<br />
1123 /// <since_tizen> 3 </since_tizen>
1124 public PropertyMap Shadow
1128 return (PropertyMap)GetValue(ShadowProperty);
1132 SetValue(ShadowProperty, value);
1133 NotifyPropertyChanged();
1138 /// The Emboss property.<br />
1139 /// The default emboss parameters.<br />
1141 /// <since_tizen> 3 </since_tizen>
1142 public string Emboss
1146 return (string)GetValue(EmbossProperty);
1150 SetValue(EmbossProperty, value);
1151 NotifyPropertyChanged();
1156 /// The Outline property.<br />
1157 /// The default outline parameters.<br />
1159 /// <since_tizen> 3 </since_tizen>
1160 public PropertyMap Outline
1164 return (PropertyMap)GetValue(OutlineProperty);
1168 SetValue(OutlineProperty, value);
1169 NotifyPropertyChanged();
1174 /// The PixelSize property.<br />
1175 /// The size of font in pixels.<br />
1177 /// <since_tizen> 3 </since_tizen>
1178 public float PixelSize
1182 return (float)GetValue(PixelSizeProperty);
1186 SetValue(PixelSizeProperty, value);
1187 NotifyPropertyChanged();
1192 /// The Ellipsis property.<br />
1193 /// Enable or disable the ellipsis.<br />
1195 /// <since_tizen> 3 </since_tizen>
1196 public bool Ellipsis
1200 return (bool)GetValue(EllipsisProperty);
1204 SetValue(EllipsisProperty, value);
1205 NotifyPropertyChanged();
1210 /// The AutoScrollLoopDelay property.<br />
1211 /// Do something.<br />
1213 /// <since_tizen> 3 </since_tizen>
1214 public float AutoScrollLoopDelay
1218 return (float)GetValue(AutoScrollLoopDelayProperty);
1222 SetValue(AutoScrollLoopDelayProperty, value);
1223 NotifyPropertyChanged();
1228 /// The AutoScrollStopMode property.<br />
1229 /// Do something.<br />
1231 /// <since_tizen> 3 </since_tizen>
1232 public AutoScrollStopMode AutoScrollStopMode
1236 return (AutoScrollStopMode)GetValue(AutoScrollStopModeProperty);
1240 SetValue(AutoScrollStopModeProperty, value);
1241 NotifyPropertyChanged();
1246 /// The line count of the text.
1248 /// <since_tizen> 3 </since_tizen>
1249 public int LineCount
1254 GetProperty(TextLabel.Property.LINE_COUNT).Get(out temp);
1260 /// The LineWrapMode property.<br />
1261 /// line wrap mode when the text lines over layout width.<br />
1263 /// <since_tizen> 4 </since_tizen>
1264 public LineWrapMode LineWrapMode
1268 return (LineWrapMode)GetValue(LineWrapModeProperty);
1272 SetValue(LineWrapModeProperty, value);
1273 NotifyPropertyChanged();
1278 /// The text direction.
1280 /// <since_tizen> 5 </since_tizen>
1281 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1282 [EditorBrowsable(EditorBrowsableState.Never)]
1283 public TextDirection TextDirection
1288 GetProperty(TextLabel.Property.TEXT_DIRECTION).Get(out temp);
1289 return (TextDirection)temp;
1294 /// The text vertical line alignment.
1296 /// <since_tizen> 5 </since_tizen>
1297 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1298 [EditorBrowsable(EditorBrowsableState.Never)]
1299 public VerticalLineAlignment VerticalLineAlignment
1303 return (VerticalLineAlignment)GetValue(VerticalLineAlignmentProperty);
1307 SetValue(VerticalLineAlignmentProperty, value);
1308 NotifyPropertyChanged();