2 * Copyright(c) 2021 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 System.ComponentModel;
20 using Tizen.NUI.Binding;
22 namespace Tizen.NUI.BaseComponents
25 /// A control which renders a short text string.<br />
26 /// Text labels are lightweight, non-editable, and do not respond to the user input.<br />
28 /// <since_tizen> 3 </since_tizen>
29 public partial class TextLabel
34 [EditorBrowsable(EditorBrowsableState.Never)]
35 public static readonly BindableProperty TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
37 var textLabel = (TextLabel)bindable;
39 if (newValue is Selector<string> selector)
41 textLabel.TranslatableTextSelector = selector;
45 textLabel.selectorData?.TranslatableText?.Reset(textLabel);
46 textLabel.SetTranslatableText((string)newValue);
49 defaultValueCreator: (bindable) =>
51 var textLabel = (TextLabel)bindable;
52 return textLabel.translatableText;
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: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
58 var textLabel = (TextLabel)bindable;
60 if (newValue is Selector<string> selector)
62 textLabel.TextSelector = selector;
66 textLabel.selectorData?.Text?.Reset(textLabel);
67 textLabel.SetText((string)newValue);
70 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
72 var textLabel = (TextLabel)bindable;
74 return Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.TEXT);
76 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
77 [EditorBrowsable(EditorBrowsableState.Never)]
78 public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
80 var textLabel = (TextLabel)bindable;
82 if (newValue is Selector<string> selector)
84 textLabel.FontFamilySelector = selector;
88 textLabel.selectorData?.FontFamily?.Reset(textLabel);
89 textLabel.SetFontFamily((string)newValue);
92 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
94 var textLabel = (TextLabel)bindable;
95 return textLabel.InternalFontFamily;
97 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
98 [EditorBrowsable(EditorBrowsableState.Never)]
99 public static readonly BindableProperty FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
101 var textLabel = (TextLabel)bindable;
102 if (newValue != null)
104 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.FontStyle, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
105 textLabel.RequestLayout();
108 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
110 var textLabel = (TextLabel)bindable;
111 PropertyMap temp = new PropertyMap();
112 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.FontStyle).Get(temp);
115 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
116 [EditorBrowsable(EditorBrowsableState.Never)]
117 public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
119 var textLabel = (TextLabel)bindable;
121 if (newValue is Selector<float?> selector)
123 textLabel.PointSizeSelector = selector;
127 textLabel.selectorData?.PointSize?.Reset(textLabel);
128 textLabel.SetPointSize((float?)newValue);
131 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
133 var textLabel = (TextLabel)bindable;
135 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.PointSize);
137 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
138 [EditorBrowsable(EditorBrowsableState.Never)]
139 public static readonly BindableProperty MultiLineProperty = BindableProperty.Create(nameof(MultiLine), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
141 var textLabel = (TextLabel)bindable;
142 if (newValue != null)
145 Object.InternalSetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.MultiLine, (bool)newValue);
146 textLabel.RequestLayout();
149 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
151 var textLabel = (TextLabel)bindable;
153 return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.MultiLine);
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 HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextLabel), HorizontalAlignment.Begin, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
159 var textLabel = (TextLabel)bindable;
160 if (newValue != null)
163 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.HorizontalAlignment, (int)newValue);
166 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
168 var textLabel = (TextLabel)bindable;
171 temp = Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.HorizontalAlignment);
172 if (System.String.IsNullOrEmpty(temp))
174 return HorizontalAlignment.Begin; // Return default value.
177 if (temp.Equals("BEGIN"))
179 return HorizontalAlignment.Begin;
181 else if (temp.Equals("CENTER"))
183 return HorizontalAlignment.Center;
187 return HorizontalAlignment.End;
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 VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
194 var textLabel = (TextLabel)bindable;
195 if (newValue != null)
198 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.VerticalAlignment, (int)newValue);
201 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
203 var textLabel = (TextLabel)bindable;
206 temp = Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.VerticalAlignment);
207 if (System.String.IsNullOrEmpty(temp))
209 return VerticalAlignment.Top; // Return default value.
212 if (temp.Equals("TOP"))
214 return VerticalAlignment.Top;
216 else if (temp.Equals("CENTER"))
218 return VerticalAlignment.Center;
222 return VerticalAlignment.Bottom;
225 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
226 [EditorBrowsable(EditorBrowsableState.Never)]
227 public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
229 var textLabel = (TextLabel)bindable;
231 if (newValue is Selector<Color> selector)
233 textLabel.TextColorSelector = selector;
237 textLabel.selectorData?.TextColor?.Reset(textLabel);
238 textLabel.SetTextColor((Color)newValue);
241 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
243 var textLabel = (TextLabel)bindable;
245 if (textLabel.internalTextColor == null)
247 textLabel.internalTextColor = new Color(0, 0, 0, 0);
249 Object.InternalRetrievingPropertyVector4(textLabel.SwigCPtr, TextLabel.Property.TextColor, textLabel.internalTextColor.SwigCPtr);
250 return textLabel.internalTextColor;
253 [EditorBrowsable(EditorBrowsableState.Never)]
254 public static readonly BindableProperty AnchorColorProperty = BindableProperty.Create(nameof(TextLabel.AnchorColor), typeof(Color), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
256 var textLabel = (TextLabel)bindable;
257 if (newValue != null)
259 Object.InternalSetPropertyVector4(textLabel.SwigCPtr, TextLabel.Property.AnchorColor, ((Color)newValue).SwigCPtr);
262 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
264 var textLabel = (TextLabel)bindable;
266 if (textLabel.internalAnchorColor == null)
268 textLabel.internalAnchorColor = new Color(0, 0, 0, 0);
270 Object.InternalRetrievingPropertyVector4(textLabel.SwigCPtr, TextLabel.Property.TextColor, textLabel.internalAnchorColor.SwigCPtr);
271 return textLabel.internalAnchorColor;
274 [EditorBrowsable(EditorBrowsableState.Never)]
275 public static readonly BindableProperty AnchorClickedColorProperty = BindableProperty.Create(nameof(TextLabel.AnchorClickedColor), typeof(Color), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
277 var textLabel = (TextLabel)bindable;
278 if (newValue != null)
280 Object.InternalSetPropertyVector4(textLabel.SwigCPtr, TextLabel.Property.AnchorClickedColor, ((Color)newValue).SwigCPtr);
283 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
285 var textLabel = (TextLabel)bindable;
287 if (textLabel.internalAnchorClickedColor == null)
289 textLabel.internalAnchorClickedColor = new Color(0, 0, 0, 0);
291 Object.InternalRetrievingPropertyVector4(textLabel.SwigCPtr, TextLabel.Property.TextColor, textLabel.internalAnchorClickedColor.SwigCPtr);
292 return textLabel.internalAnchorClickedColor;
295 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
296 [EditorBrowsable(EditorBrowsableState.Never)]
297 public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
299 var textLabel = (TextLabel)bindable;
300 if (newValue != null)
303 Object.InternalSetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableMarkup, (bool)newValue);
306 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
308 var textLabel = (TextLabel)bindable;
310 return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableMarkup);
312 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
313 [EditorBrowsable(EditorBrowsableState.Never)]
314 public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create(nameof(EnableAutoScroll), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
316 var textLabel = (TextLabel)bindable;
317 if (newValue != null)
320 Object.InternalSetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableAutoScroll, (bool)newValue);
323 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
325 var textLabel = (TextLabel)bindable;
327 return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableAutoScroll);
329 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
330 [EditorBrowsable(EditorBrowsableState.Never)]
331 public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create(nameof(AutoScrollSpeed), typeof(int), typeof(TextLabel), default(int), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
333 var textLabel = (TextLabel)bindable;
334 if (newValue != null)
337 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.AutoScrollSpeed, (int)newValue);
340 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
342 var textLabel = (TextLabel)bindable;
344 return Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.AutoScrollSpeed);
346 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
347 [EditorBrowsable(EditorBrowsableState.Never)]
348 public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create(nameof(AutoScrollLoopCount), typeof(int), typeof(TextLabel), default(int), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
350 var textLabel = (TextLabel)bindable;
351 if (newValue != null)
354 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.AutoScrollLoopCount, (int)newValue);
357 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
359 var textLabel = (TextLabel)bindable;
361 return Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.AutoScrollLoopCount);
363 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
364 [EditorBrowsable(EditorBrowsableState.Never)]
365 public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create(nameof(AutoScrollGap), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
367 var textLabel = (TextLabel)bindable;
368 if (newValue != null)
371 Object.InternalSetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.AutoScrollGap, (float)newValue);
374 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
376 var textLabel = (TextLabel)bindable;
378 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.AutoScrollGap);
380 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
381 [EditorBrowsable(EditorBrowsableState.Never)]
382 public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
384 var textLabel = (TextLabel)bindable;
385 if (newValue != null)
388 Object.InternalSetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.LineSpacing, (float)newValue);
389 textLabel.RequestLayout();
392 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
394 var textLabel = (TextLabel)bindable;
396 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.LineSpacing);
398 [EditorBrowsable(EditorBrowsableState.Never)]
399 public static readonly BindableProperty RelativeLineHeightProperty = BindableProperty.Create(nameof(RelativeLineHeight), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
401 var textLabel = (TextLabel)bindable;
402 if (newValue != null)
405 Object.InternalSetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.RelativeLineHeight, (float)newValue);
408 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
410 var textLabel = (TextLabel)bindable;
412 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.RelativeLineHeight);
414 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
415 [EditorBrowsable(EditorBrowsableState.Never)]
416 public static readonly BindableProperty UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
418 var textLabel = (TextLabel)bindable;
419 if (newValue != null)
421 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
424 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
426 var textLabel = (TextLabel)bindable;
427 PropertyMap temp = new PropertyMap();
428 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.UNDERLINE).Get(temp);
432 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
433 [EditorBrowsable(EditorBrowsableState.Never)]
434 public static readonly BindableProperty ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
436 var textLabel = (TextLabel)bindable;
437 if (newValue != null)
439 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
442 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
444 var textLabel = (TextLabel)bindable;
445 PropertyMap temp = new PropertyMap();
446 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.SHADOW).Get(temp);
449 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
450 [EditorBrowsable(EditorBrowsableState.Never)]
451 public static readonly BindableProperty TextShadowProperty = BindableProperty.Create(nameof(TextShadow), typeof(TextShadow), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
453 var textLabel = (TextLabel)bindable;
455 if (newValue is Selector<TextShadow> selector)
457 textLabel.TextShadowSelector = selector;
461 textLabel.selectorData?.TextShadow?.Reset(textLabel);
462 textLabel.SetTextShadow((TextShadow)newValue);
465 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
467 var textLabel = (TextLabel)bindable;
468 PropertyMap temp = new PropertyMap();
469 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.SHADOW).Get(temp);
470 return temp.Empty() ? null : new TextShadow(temp);
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 EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
476 var textLabel = (TextLabel)bindable;
477 if (newValue != null)
480 Object.InternalSetPropertyString(textLabel.SwigCPtr, TextLabel.Property.EMBOSS, (string)newValue);
483 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
485 var textLabel = (TextLabel)bindable;
487 return Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.EMBOSS);
489 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
490 [EditorBrowsable(EditorBrowsableState.Never)]
491 public static readonly BindableProperty OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
493 var textLabel = (TextLabel)bindable;
494 if (newValue != null)
496 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
499 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
501 var textLabel = (TextLabel)bindable;
502 PropertyMap temp = new PropertyMap();
503 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.OUTLINE).Get(temp);
506 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
507 [EditorBrowsable(EditorBrowsableState.Never)]
508 public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
510 var textLabel = (TextLabel)bindable;
512 if (newValue is Selector<float?> selector)
514 textLabel.PixelSizeSelector = selector;
518 textLabel.selectorData?.PixelSize?.Reset(textLabel);
519 textLabel.SetPixelSize((float?)newValue);
522 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
524 var textLabel = (TextLabel)bindable;
526 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.PixelSize);
528 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
529 [EditorBrowsable(EditorBrowsableState.Never)]
530 public static readonly BindableProperty EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
532 var textLabel = (TextLabel)bindable;
533 if (newValue != null)
536 Object.InternalSetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.ELLIPSIS, (bool)newValue);
539 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
541 var textLabel = (TextLabel)bindable;
543 return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.ELLIPSIS);
545 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
546 [EditorBrowsable(EditorBrowsableState.Never)]
547 public static readonly BindableProperty EllipsisPositionProperty = BindableProperty.Create(nameof(EllipsisPosition), typeof(EllipsisPosition), typeof(TextLabel), EllipsisPosition.End, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
549 var textLabel = (TextLabel)bindable;
550 if (newValue != null)
553 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.EllipsisPosition, (int)newValue);
556 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
558 var textLabel = (TextLabel)bindable;
560 return (EllipsisPosition)Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.EllipsisPosition);
562 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
563 [EditorBrowsable(EditorBrowsableState.Never)]
564 public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create(nameof(AutoScrollLoopDelay), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
566 var textLabel = (TextLabel)bindable;
567 if (newValue != null)
570 Object.InternalSetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.AutoScrollLoopDelay, (float)newValue);
573 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
575 var textLabel = (TextLabel)bindable;
577 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.AutoScrollLoopDelay);
579 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
580 [EditorBrowsable(EditorBrowsableState.Never)]
581 public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create(nameof(AutoScrollStopMode), typeof(AutoScrollStopMode), typeof(TextLabel), AutoScrollStopMode.FinishLoop, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
583 var textLabel = (TextLabel)bindable;
584 if (newValue != null)
587 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.AutoScrollStopMode, (int)newValue);
590 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
592 var textLabel = (TextLabel)bindable;
595 temp = Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.AutoScrollStopMode);
596 return temp.GetValueByDescription<AutoScrollStopMode>();
598 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
599 [EditorBrowsable(EditorBrowsableState.Never)]
600 public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextLabel), LineWrapMode.Word, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
602 var textLabel = (TextLabel)bindable;
603 if (newValue != null)
606 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.LineWrapMode, (int)newValue);
609 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
611 var textLabel = (TextLabel)bindable;
613 return (LineWrapMode)Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.LineWrapMode);
615 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
616 [EditorBrowsable(EditorBrowsableState.Never)]
617 public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create(nameof(VerticalLineAlignment), typeof(VerticalLineAlignment), typeof(TextLabel), VerticalLineAlignment.Bottom, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
619 var textLabel = (TextLabel)bindable;
620 if (newValue != null)
623 Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.VerticalLineAlignment, (int)newValue);
626 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
628 var textLabel = (TextLabel)bindable;
630 return (VerticalLineAlignment)Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.VerticalLineAlignment);
632 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
633 [EditorBrowsable(EditorBrowsableState.Never)]
634 public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
636 var textLabel = (TextLabel)bindable;
637 if (newValue != null)
640 Object.InternalSetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.MatchSystemLanguageDirection, (bool)newValue);
643 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
645 var textLabel = (TextLabel)bindable;
647 return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.MatchSystemLanguageDirection);
649 /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
650 [EditorBrowsable(EditorBrowsableState.Never)]
651 public static readonly BindableProperty CharacterSpacingProperty = BindableProperty.Create(nameof(CharacterSpacing), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
653 var textLabel = (TextLabel)bindable;
654 if (newValue != null)
657 Object.InternalSetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.CharacterSpacing, (float)newValue);
660 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
662 var textLabel = (TextLabel)bindable;
664 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.CharacterSpacing);
666 /// Only for XAML. No need of public API. Make hidden as inhouse API.
667 [EditorBrowsable(EditorBrowsableState.Never)]
668 public static readonly BindableProperty TextFitProperty = BindableProperty.Create(nameof(TextFit), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
670 var textLabel = (TextLabel)bindable;
671 if (newValue != null)
673 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.TextFit, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
676 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
678 var textLabel = (TextLabel)bindable;
679 PropertyMap temp = new PropertyMap();
680 Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.TextFit).Get(temp);
684 /// Only for XAML. No need of public API. Make hidden as inhouse API.
685 [EditorBrowsable(EditorBrowsableState.Never)]
686 public static readonly BindableProperty MinLineSizeProperty = BindableProperty.Create(nameof(MinLineSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
688 var textLabel = (TextLabel)bindable;
689 if (newValue != null)
692 Object.InternalSetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.MinLineSize, (float)newValue);
693 textLabel.RequestLayout();
696 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
698 var textLabel = (TextLabel)bindable;
700 return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.MinLineSize);
703 [EditorBrowsable(EditorBrowsableState.Never)]
704 public static readonly BindableProperty FontSizeScaleProperty = BindableProperty.Create(nameof(FontSizeScale), typeof(float), typeof(TextLabel), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
706 var textLabel = (TextLabel)bindable;
707 if (newValue != null)
709 textLabel.InternalFontSizeScale = (float)newValue;
712 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
714 var textLabel = (TextLabel)bindable;
715 return textLabel.InternalFontSizeScale;
718 [EditorBrowsable(EditorBrowsableState.Never)]
719 public static readonly BindableProperty EnableFontSizeScaleProperty = BindableProperty.Create(nameof(EnableFontSizeScale), typeof(bool), typeof(TextLabel), default(bool), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
721 var textLabel = (TextLabel)bindable;
722 if (newValue != null)
725 Object.InternalSetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableFontSizeScale, (bool)newValue);
726 textLabel.RequestLayout();
729 defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
731 var textLabel = (TextLabel)bindable;
733 return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableFontSizeScale);
737 /// ShadowOffsetProperty
739 [EditorBrowsable(EditorBrowsableState.Never)]
740 public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create(nameof(ShadowOffset), typeof(Tizen.NUI.Vector2), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
742 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
743 if (newValue != null)
745 instance.InternalShadowOffset = (Tizen.NUI.Vector2)newValue;
748 defaultValueCreator: (bindable) =>
750 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
751 return instance.InternalShadowOffset;
755 /// ShadowColorProperty
757 [EditorBrowsable(EditorBrowsableState.Never)]
758 public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create(nameof(ShadowColor), typeof(Tizen.NUI.Vector4), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
760 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
761 if (newValue != null)
763 instance.InternalShadowColor = (Tizen.NUI.Vector4)newValue;
766 defaultValueCreator: (bindable) =>
768 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
769 return instance.InternalShadowColor;
773 /// UnderlineEnabledProperty
775 [EditorBrowsable(EditorBrowsableState.Never)]
776 public static readonly BindableProperty UnderlineEnabledProperty = BindableProperty.Create(nameof(UnderlineEnabled), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
778 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
779 if (newValue != null)
781 instance.InternalUnderlineEnabled = (bool)newValue;
784 defaultValueCreator: (bindable) =>
786 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
787 return instance.InternalUnderlineEnabled;
791 /// UnderlineColorProperty
793 [EditorBrowsable(EditorBrowsableState.Never)]
794 public static readonly BindableProperty UnderlineColorProperty = BindableProperty.Create(nameof(UnderlineColor), typeof(Tizen.NUI.Vector4), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
796 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
797 if (newValue != null)
799 instance.InternalUnderlineColor = (Tizen.NUI.Vector4)newValue;
802 defaultValueCreator: (bindable) =>
804 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
805 return instance.InternalUnderlineColor;
809 /// UnderlineHeightProperty
811 [EditorBrowsable(EditorBrowsableState.Never)]
812 public static readonly BindableProperty UnderlineHeightProperty = BindableProperty.Create(nameof(UnderlineHeight), typeof(float), typeof(TextLabel), 0.0f, propertyChanged: (bindable, oldValue, newValue) =>
814 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
815 if (newValue != null)
817 instance.InternalUnderlineHeight = (float)newValue;
820 defaultValueCreator: (bindable) =>
822 var instance = (Tizen.NUI.BaseComponents.TextLabel)bindable;
823 return instance.InternalUnderlineHeight;
826 internal Selector<string> TranslatableTextSelector
828 get => GetSelector<string>(selectorData?.TranslatableText, TextLabel.TranslatableTextProperty);
831 selectorData?.TranslatableText?.Reset(this);
832 if (value == null) return;
834 if (value.HasAll()) SetTranslatableText(value.All);
835 else EnsureSelectorData().TranslatableText = new TriggerableSelector<string>(this, value, SetTranslatableText, true);
839 internal Selector<string> TextSelector
841 get => GetSelector<string>(selectorData?.Text, TextLabel.TextProperty);
844 selectorData?.Text?.Reset(this);
845 if (value == null) return;
847 if (value.HasAll()) SetText(value.All);
848 else EnsureSelectorData().Text = new TriggerableSelector<string>(this, value, SetText, true);
852 internal Selector<string> FontFamilySelector
854 get => GetSelector<string>(selectorData?.FontFamily, TextLabel.FontFamilyProperty);
857 selectorData?.FontFamily?.Reset(this);
858 if (value == null) return;
860 if (value.HasAll()) SetFontFamily(value.All);
861 else EnsureSelectorData().FontFamily = new TriggerableSelector<string>(this, value, SetFontFamily, true);
865 internal Selector<float?> PointSizeSelector
867 get => GetSelector<float?>(selectorData?.PointSize, TextLabel.PointSizeProperty);
870 selectorData?.PointSize?.Reset(this);
871 if (value == null) return;
873 if (value.HasAll()) SetPointSize(value.All);
874 else EnsureSelectorData().PointSize = new TriggerableSelector<float?>(this, value, SetPointSize, true);
878 internal Selector<Color> TextColorSelector
882 var selector = selectorData?.TextColor?.Get();
883 if (selector != null)
888 Color color = new Color();
889 if (!GetProperty(TextLabel.Property.TextColor).Get(color))
893 return new Selector<Color>(color);
897 selectorData?.TextColor?.Reset(this);
898 if (value == null) return;
900 if (value.HasAll()) SetTextColor(value.All);
901 else EnsureSelectorData().TextColor = new TriggerableSelector<Color>(this, value, SetTextColor, true);
905 internal Selector<float?> PixelSizeSelector
907 get => GetSelector<float?>(selectorData?.PixelSize, TextLabel.PixelSizeProperty);
910 selectorData?.PixelSize?.Reset(this);
911 if (value == null) return;
913 if (value.HasAll()) SetPixelSize(value.All);
914 else EnsureSelectorData().PixelSize = new TriggerableSelector<float?>(this, value, SetPixelSize, true);
918 internal Selector<TextShadow> TextShadowSelector
920 get => GetSelector<TextShadow>(selectorData?.TextShadow, TextLabel.TextShadowProperty);
923 selectorData?.TextShadow?.Reset(this);
924 if (value == null) return;
926 if (value.HasAll()) SetTextShadow(value.All);
927 else EnsureSelectorData().TextShadow = new TriggerableSelector<TextShadow>(this, value, SetTextShadow);
931 private void SetTranslatableText(string value)
935 translatableText = value;
939 private void SetText(string value)
944 Object.InternalSetPropertyString(SwigCPtr, TextLabel.Property.TEXT, value);
949 private void SetFontFamily(string value)
953 InternalFontFamily = (string)value;
957 private void SetTextColor(Color value)
962 Object.InternalSetPropertyVector4(SwigCPtr, TextLabel.Property.TextColor, value.SwigCPtr);
966 private void SetPointSize(float? value)
971 Object.InternalSetPropertyFloat(SwigCPtr, TextLabel.Property.PointSize, (float)value);
976 private void SetPixelSize(float? value)
981 Object.InternalSetPropertyFloat(SwigCPtr, TextLabel.Property.PixelSize, (float)value);
986 private void SetTextShadow(TextShadow value)
990 Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, Property.SHADOW, TextShadow.ToPropertyValue(value));