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 public class TextLabel : View
35 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
39 var textLabel = (TextLabel)bindable;
42 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue));
45 defaultValueCreator:(bindable) =>
47 var textLabel = (TextLabel)bindable;
49 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT).Get(out temp);
52 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
53 [EditorBrowsable(EditorBrowsableState.Never)]
54 public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
56 var textLabel = (TextLabel)bindable;
59 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue));
62 defaultValueCreator:(bindable) =>
64 var textLabel = (TextLabel)bindable;
66 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_FAMILY).Get(out temp);
69 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 public static readonly BindableProperty FontStyleProperty = BindableProperty.Create("FontStyle", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
73 var textLabel = (TextLabel)bindable;
76 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
79 defaultValueCreator:(bindable) =>
81 var textLabel = (TextLabel)bindable;
82 PropertyMap temp = new PropertyMap();
83 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_STYLE).Get(temp);
86 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 public static readonly BindableProperty PointSizeProperty = BindableProperty.Create("PointSize", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
90 var textLabel = (TextLabel)bindable;
93 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue));
96 defaultValueCreator:(bindable) =>
98 var textLabel = (TextLabel)bindable;
100 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.POINT_SIZE).Get(out temp);
103 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 public static readonly BindableProperty MultiLineProperty = BindableProperty.Create("MultiLine", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
107 var textLabel = (TextLabel)bindable;
108 if (newValue != null)
110 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.MULTI_LINE, new Tizen.NUI.PropertyValue((bool)newValue));
113 defaultValueCreator:(bindable) =>
115 var textLabel = (TextLabel)bindable;
117 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.MULTI_LINE).Get(out temp);
120 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment), typeof(TextLabel), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) =>
124 var textLabel = (TextLabel)bindable;
125 string valueToString = "";
126 if (newValue != null)
128 switch ((HorizontalAlignment)newValue)
130 case HorizontalAlignment.Begin: { valueToString = "BEGIN"; break; }
131 case HorizontalAlignment.Center: { valueToString = "CENTER"; break; }
132 case HorizontalAlignment.End: { valueToString = "END"; break; }
133 default: { valueToString = "BEGIN"; break; }
135 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
138 defaultValueCreator:(bindable) =>
140 var textLabel = (TextLabel)bindable;
142 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
144 NUILog.Error("HorizontalAlignment get error!");
148 case "BEGIN": return HorizontalAlignment.Begin;
149 case "CENTER": return HorizontalAlignment.Center;
150 case "END": return HorizontalAlignment.End;
151 default: return HorizontalAlignment.Begin;
154 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
155 [EditorBrowsable(EditorBrowsableState.Never)]
156 public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create("VerticalAlignment", typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
158 var textLabel = (TextLabel)bindable;
159 string valueToString = "";
160 if (newValue != null)
162 switch ((VerticalAlignment)newValue)
164 case VerticalAlignment.Top: { valueToString = "TOP"; break; }
165 case VerticalAlignment.Center: { valueToString = "CENTER"; break; }
166 case VerticalAlignment.Bottom: { valueToString = "BOTTOM"; break; }
167 default: { valueToString = "BOTTOM"; break; }
169 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
172 defaultValueCreator:(bindable) =>
174 var textLabel = (TextLabel)bindable;
176 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT).Get(out temp) == false)
178 NUILog.Error("VerticalAlignment get error!");
183 case "TOP": return VerticalAlignment.Top;
184 case "CENTER": return VerticalAlignment.Center;
185 case "BOTTOM": return VerticalAlignment.Bottom;
186 default: return VerticalAlignment.Bottom;
189 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
190 [EditorBrowsable(EditorBrowsableState.Never)]
191 public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Color), typeof(TextLabel), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) =>
193 var textLabel = (TextLabel)bindable;
194 if (newValue != null)
196 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue));
199 defaultValueCreator:(bindable) =>
201 var textLabel = (TextLabel)bindable;
202 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
203 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR).Get(temp);
206 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
207 [EditorBrowsable(EditorBrowsableState.Never)]
208 public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create("ShadowOffset", typeof(Vector2), typeof(TextLabel), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) =>
210 var textLabel = (TextLabel)bindable;
211 if (newValue != null)
213 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_OFFSET, new Tizen.NUI.PropertyValue((Vector2)newValue));
216 defaultValueCreator:(bindable) =>
218 var textLabel = (TextLabel)bindable;
219 Vector2 temp = new Vector2(0.0f, 0.0f);
220 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_OFFSET).Get(temp);
223 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
224 [EditorBrowsable(EditorBrowsableState.Never)]
225 public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create("ShadowColor", typeof(Vector4), typeof(TextLabel), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
227 var textLabel = (TextLabel)bindable;
228 if (newValue != null)
230 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue));
233 defaultValueCreator:(bindable) =>
235 var textLabel = (TextLabel)bindable;
236 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
237 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_COLOR).Get(temp);
240 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
241 [EditorBrowsable(EditorBrowsableState.Never)]
242 public static readonly BindableProperty UnderlineEnabledProperty = BindableProperty.Create("UnderlineEnabled", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
244 var textLabel = (TextLabel)bindable;
245 if (newValue != null)
247 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue));
250 defaultValueCreator:(bindable) =>
252 var textLabel = (TextLabel)bindable;
254 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_ENABLED).Get(out temp);
257 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
258 [EditorBrowsable(EditorBrowsableState.Never)]
259 public static readonly BindableProperty UnderlineColorProperty = BindableProperty.Create("UnderlineColor", typeof(Vector4), typeof(TextLabel), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
261 var textLabel = (TextLabel)bindable;
262 if (newValue != null)
264 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue));
267 defaultValueCreator:(bindable) =>
269 var textLabel = (TextLabel)bindable;
270 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
271 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_COLOR).Get(temp);
274 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
275 [EditorBrowsable(EditorBrowsableState.Never)]
276 public static readonly BindableProperty UnderlineHeightProperty = BindableProperty.Create("UnderlineHeight", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
278 var textLabel = (TextLabel)bindable;
279 if (newValue != null)
281 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
284 defaultValueCreator:(bindable) =>
286 var textLabel = (TextLabel)bindable;
288 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_HEIGHT).Get(out temp);
291 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
292 [EditorBrowsable(EditorBrowsableState.Never)]
293 public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
295 var textLabel = (TextLabel)bindable;
296 if (newValue != null)
298 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue));
301 defaultValueCreator:(bindable) =>
303 var textLabel = (TextLabel)bindable;
305 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP).Get(out temp);
308 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
309 [EditorBrowsable(EditorBrowsableState.Never)]
310 public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create("EnableAutoScroll", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
312 var textLabel = (TextLabel)bindable;
313 if (newValue != null)
315 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue));
318 defaultValueCreator:(bindable) =>
320 var textLabel = (TextLabel)bindable;
322 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL).Get(out temp);
325 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
326 [EditorBrowsable(EditorBrowsableState.Never)]
327 public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create("AutoScrollSpeed", typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
329 var textLabel = (TextLabel)bindable;
330 if (newValue != null)
332 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue((int)newValue));
335 defaultValueCreator:(bindable) =>
337 var textLabel = (TextLabel)bindable;
339 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED).Get(out temp);
342 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
343 [EditorBrowsable(EditorBrowsableState.Never)]
344 public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create("AutoScrollLoopCount", typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
346 var textLabel = (TextLabel)bindable;
347 if (newValue != null)
349 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue((int)newValue));
352 defaultValueCreator:(bindable) =>
354 var textLabel = (TextLabel)bindable;
356 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT).Get(out temp);
359 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
360 [EditorBrowsable(EditorBrowsableState.Never)]
361 public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create("AutoScrollGap", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
363 var textLabel = (TextLabel)bindable;
364 if (newValue != null)
366 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue((float)newValue));
369 defaultValueCreator:(bindable) =>
371 var textLabel = (TextLabel)bindable;
373 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP).Get(out temp);
376 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
377 [EditorBrowsable(EditorBrowsableState.Never)]
378 public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create("LineSpacing", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
380 var textLabel = (TextLabel)bindable;
381 if (newValue != null)
383 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue));
386 defaultValueCreator:(bindable) =>
388 var textLabel = (TextLabel)bindable;
390 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING).Get(out temp);
393 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
394 [EditorBrowsable(EditorBrowsableState.Never)]
395 public static readonly BindableProperty UnderlineProperty = BindableProperty.Create("Underline", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
397 var textLabel = (TextLabel)bindable;
398 if (newValue != null)
400 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
403 defaultValueCreator:(bindable) =>
405 var textLabel = (TextLabel)bindable;
406 PropertyMap temp = new PropertyMap();
407 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE).Get(temp);
410 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
411 [EditorBrowsable(EditorBrowsableState.Never)]
412 public static readonly BindableProperty ShadowProperty = BindableProperty.Create("Shadow", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
414 var textLabel = (TextLabel)bindable;
415 if (newValue != null)
417 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
420 defaultValueCreator:(bindable) =>
422 var textLabel = (TextLabel)bindable;
423 PropertyMap temp = new PropertyMap();
424 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW).Get(temp);
427 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
428 [EditorBrowsable(EditorBrowsableState.Never)]
429 public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
431 var textLabel = (TextLabel)bindable;
432 if (newValue != null)
434 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue));
437 defaultValueCreator:(bindable) =>
439 var textLabel = (TextLabel)bindable;
441 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS).Get(out temp);
444 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
445 [EditorBrowsable(EditorBrowsableState.Never)]
446 public static readonly BindableProperty OutlineProperty = BindableProperty.Create("Outline", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
448 var textLabel = (TextLabel)bindable;
449 if (newValue != null)
451 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
454 defaultValueCreator:(bindable) =>
456 var textLabel = (TextLabel)bindable;
457 PropertyMap temp = new PropertyMap();
458 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE).Get(temp);
461 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
462 [EditorBrowsable(EditorBrowsableState.Never)]
463 public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
465 var textLabel = (TextLabel)bindable;
466 if (newValue != null)
468 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue));
471 defaultValueCreator:(bindable) =>
473 var textLabel = (TextLabel)bindable;
475 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE).Get(out temp);
478 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
479 [EditorBrowsable(EditorBrowsableState.Never)]
480 public static readonly BindableProperty EllipsisProperty = BindableProperty.Create("Ellipsis", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
482 var textLabel = (TextLabel)bindable;
483 if (newValue != null)
485 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue));
488 defaultValueCreator:(bindable) =>
490 var textLabel = (TextLabel)bindable;
492 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS).Get(out temp);
495 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
496 [EditorBrowsable(EditorBrowsableState.Never)]
497 public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create("AutoScrollLoopDelay", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
499 var textLabel = (TextLabel)bindable;
500 if (newValue != null)
502 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY, new Tizen.NUI.PropertyValue((float)newValue));
505 defaultValueCreator:(bindable) =>
507 var textLabel = (TextLabel)bindable;
509 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY).Get(out temp);
512 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
513 [EditorBrowsable(EditorBrowsableState.Never)]
514 public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create("AutoScrollStopMode", typeof(AutoScrollStopMode), typeof(TextLabel), AutoScrollStopMode.FinishLoop, propertyChanged: (bindable, oldValue, newValue) =>
516 var textLabel = (TextLabel)bindable;
517 if (newValue != null)
519 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
522 defaultValueCreator:(bindable) =>
524 var textLabel = (TextLabel)bindable;
526 if(Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false)
528 NUILog.Error("AutoScrollStopMode get error!");
532 case "FINISH_LOOP": return AutoScrollStopMode.FinishLoop;
533 case "IMMEDIATE": return AutoScrollStopMode.Immediate;
534 default: return AutoScrollStopMode.FinishLoop;
537 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
538 [EditorBrowsable(EditorBrowsableState.Never)]
539 public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create("LineWrapMode", typeof(LineWrapMode), typeof(TextLabel), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) =>
541 var textLabel = (TextLabel)bindable;
542 if (newValue != null)
544 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
547 defaultValueCreator:(bindable) =>
549 var textLabel = (TextLabel)bindable;
551 if (false == Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE).Get(out temp))
553 NUILog.Error("LineWrapMode get error!");
555 return (LineWrapMode)temp;
557 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
558 [EditorBrowsable(EditorBrowsableState.Never)]
559 public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create("VerticalLineAlignment", typeof(VerticalLineAlignment), typeof(TextLabel), VerticalLineAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
561 var textLabel = (TextLabel)bindable;
562 if (newValue != null)
564 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue));
567 defaultValueCreator:(bindable) =>
569 var textLabel = (TextLabel)bindable;
571 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT).Get(out temp);
572 return (VerticalLineAlignment)temp;
576 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
577 private string textLabelSid = null;
578 private bool systemlangTextFlag = false;
579 internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
581 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
584 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
586 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
590 /// Downcasts a handle to textLabel handle
592 /// <param name="handle"></param>
593 /// <returns></returns>
594 /// <since_tizen> 3 </since_tizen>
595 /// Please do not use! this will be deprecated!
596 /// Instead please use as keyword.
597 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
599 "BaseHandle handle = new TextLabel(\"Hello World!\"); " +
600 "TextLabel label = handle as TextLabel")]
601 [EditorBrowsable(EditorBrowsableState.Never)]
602 public static TextLabel DownCast(BaseHandle handle)
604 TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
606 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 /// <since_tizen> 3 </since_tizen>
614 protected override void Dispose(DisposeTypes type)
621 if(type == DisposeTypes.Explicit)
624 //Release your own managed resources here.
625 //You should release all of your own disposable objects here.
628 //Release your own unmanaged resources here.
629 //You should not access any managed member here except static instance.
630 //because the execution order of Finalizes is non-deterministic.
632 if (swigCPtr.Handle != global::System.IntPtr.Zero)
637 NDalicPINVOKE.delete_TextLabel(swigCPtr);
639 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
645 internal new class Property
647 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get();
648 internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get();
649 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextLabel_Property_FONT_FAMILY_get();
650 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextLabel_Property_FONT_STYLE_get();
651 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextLabel_Property_POINT_SIZE_get();
652 internal static readonly int MULTI_LINE = NDalicPINVOKE.TextLabel_Property_MULTI_LINE_get();
653 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
654 internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_VERTICAL_ALIGNMENT_get();
655 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_get();
656 internal static readonly int SHADOW_OFFSET = NDalicPINVOKE.TextLabel_Property_SHADOW_OFFSET_get();
657 internal static readonly int SHADOW_COLOR = NDalicPINVOKE.TextLabel_Property_SHADOW_COLOR_get();
658 internal static readonly int UNDERLINE_ENABLED = NDalicPINVOKE.TextLabel_Property_UNDERLINE_ENABLED_get();
659 internal static readonly int UNDERLINE_COLOR = NDalicPINVOKE.TextLabel_Property_UNDERLINE_COLOR_get();
660 internal static readonly int UNDERLINE_HEIGHT = NDalicPINVOKE.TextLabel_Property_UNDERLINE_HEIGHT_get();
661 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextLabel_Property_ENABLE_MARKUP_get();
662 internal static readonly int ENABLE_AUTO_SCROLL = NDalicPINVOKE.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
663 internal static readonly int AUTO_SCROLL_SPEED = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_SPEED_get();
664 internal static readonly int AUTO_SCROLL_LOOP_COUNT = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
665 internal static readonly int AUTO_SCROLL_GAP = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_GAP_get();
666 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextLabel_Property_LINE_SPACING_get();
667 internal static readonly int UNDERLINE = NDalicPINVOKE.TextLabel_Property_UNDERLINE_get();
668 internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get();
669 internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get();
670 internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get();
671 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextLabel_Property_PIXEL_SIZE_get();
672 internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get();
673 internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
674 internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
675 internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextLabel_Property_LINE_COUNT_get();
676 internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextLabel_Property_LINE_WRAP_MODE_get();
677 internal static readonly int TEXT_DIRECTION = NDalicManualPINVOKE.TextLabel_Property_TEXT_DIRECTION_get();
678 internal static readonly int VERTICAL_LINE_ALIGNMENT = NDalicManualPINVOKE.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get();
682 /// Creates the TextLabel control.
684 /// <since_tizen> 3 </since_tizen>
685 public TextLabel() : this(NDalicPINVOKE.TextLabel_New__SWIG_0(), true)
687 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 /// Creates the TextLabel control.
694 /// <param name="text">The text to display</param>
695 /// <since_tizen> 3 </since_tizen>
696 public TextLabel(string text) : this(NDalicPINVOKE.TextLabel_New__SWIG_1(text), true)
698 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702 internal TextLabel(TextLabel handle) : this(NDalicPINVOKE.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
704 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
707 protected override void OnBindingContextChanged()
709 base.OnBindingContextChanged();
713 /// The TranslatableText property.<br />
714 /// The text can set the SID value.<br />
716 /// <exception cref='ArgumentNullException'>
717 /// ResourceManager about multilingual is null.
719 /// <since_tizen> 4 </since_tizen>
720 public string TranslatableText
728 if (NUIApplication.MultilingualResourceManager == null)
730 throw new ArgumentNullException("ResourceManager about multilingual is null");
732 string translatableText = null;
733 textLabelSid = value;
734 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
735 if (translatableText != null)
737 Text = translatableText;
738 if (systemlangTextFlag == false)
740 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
741 systemlangTextFlag = true;
748 NotifyPropertyChanged();
751 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
753 Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
757 /// The Text property.<br />
758 /// The text to display in the UTF-8 format.<br />
760 /// <since_tizen> 3 </since_tizen>
765 return (string)GetValue(TextProperty);
769 SetValue(TextProperty, value);
770 NotifyPropertyChanged();
775 /// The FontFamily property.<br />
776 /// The requested font family to use.<br />
778 /// <since_tizen> 3 </since_tizen>
779 public string FontFamily
783 return (string)GetValue(FontFamilyProperty);
787 SetValue(FontFamilyProperty, value);
788 NotifyPropertyChanged();
793 /// The FontStyle property.<br />
794 /// The requested font style to use.<br />
796 /// <since_tizen> 3 </since_tizen>
797 public PropertyMap FontStyle
801 return (PropertyMap)GetValue(FontStyleProperty);
805 SetValue(FontStyleProperty, value);
806 NotifyPropertyChanged();
811 /// The PointSize property.<br />
812 /// The size of font in points.<br />
814 /// <since_tizen> 3 </since_tizen>
815 public float PointSize
819 return (float)GetValue(PointSizeProperty);
823 SetValue(PointSizeProperty, value);
824 NotifyPropertyChanged();
829 /// The MultiLine property.<br />
830 /// The single-line or multi-line layout option.<br />
832 /// <since_tizen> 3 </since_tizen>
833 public bool MultiLine
837 return (bool)GetValue(MultiLineProperty);
841 SetValue(MultiLineProperty, value);
842 NotifyPropertyChanged();
847 /// The HorizontalAlignment property.<br />
848 /// The line horizontal alignment.<br />
850 /// <since_tizen> 3 </since_tizen>
851 public HorizontalAlignment HorizontalAlignment
855 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
859 SetValue(HorizontalAlignmentProperty, value);
860 NotifyPropertyChanged();
865 /// The VerticalAlignment property.<br />
866 /// The line vertical alignment.<br />
868 /// <since_tizen> 3 </since_tizen>
869 public VerticalAlignment VerticalAlignment
873 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
877 SetValue(VerticalAlignmentProperty, value);
878 NotifyPropertyChanged();
883 /// The TextColor property.<br />
884 /// The color of the text.<br />
885 /// Animation framework can be used to change the color of the text when not using mark up.<br />
886 /// Cannot animate the color when text is auto scrolling.<br />
888 /// <since_tizen> 3 </since_tizen>
889 public Color TextColor
893 return (Color)GetValue(TextColorProperty);
897 SetValue(TextColorProperty, value);
898 NotifyPropertyChanged();
903 /// The ShadowOffset property.<br />
904 /// The drop shadow offset 0 indicates no shadow.<br />
906 /// <since_tizen> 3 </since_tizen>
907 public Vector2 ShadowOffset
911 return (Vector2)GetValue(ShadowOffsetProperty);
915 SetValue(ShadowOffsetProperty, value);
916 NotifyPropertyChanged();
921 /// The ShadowColor property.<br />
922 /// The color of a drop shadow.<br />
924 /// <since_tizen> 3 </since_tizen>
925 public Vector4 ShadowColor
929 return (Vector4)GetValue(ShadowColorProperty);
933 SetValue(ShadowColorProperty, value);
934 NotifyPropertyChanged();
939 /// The UnderlineEnabled property.<br />
940 /// The underline enabled flag.<br />
942 /// <since_tizen> 3 </since_tizen>
943 public bool UnderlineEnabled
947 return (bool)GetValue(UnderlineEnabledProperty);
951 SetValue(UnderlineEnabledProperty, value);
952 NotifyPropertyChanged();
957 /// The UnderlineColor property.<br />
958 /// Overrides the underline height from font metrics.<br />
960 /// <since_tizen> 3 </since_tizen>
961 public Vector4 UnderlineColor
965 return (Vector4)GetValue(UnderlineColorProperty);
969 SetValue(UnderlineColorProperty, value);
970 NotifyPropertyChanged();
975 /// The UnderlineHeight property.<br />
976 /// Overrides the underline height from font metrics.<br />
978 /// <since_tizen> 3 </since_tizen>
979 public float UnderlineHeight
983 return (float)GetValue(UnderlineHeightProperty);
987 SetValue(UnderlineHeightProperty, value);
988 NotifyPropertyChanged();
993 /// The EnableMarkup property.<br />
994 /// Whether the mark-up processing is enabled.<br />
996 /// <since_tizen> 3 </since_tizen>
997 public bool EnableMarkup
1001 return (bool)GetValue(EnableMarkupProperty);
1005 SetValue(EnableMarkupProperty, value);
1006 NotifyPropertyChanged();
1011 /// The EnableAutoScroll property.<br />
1012 /// Starts or stops auto scrolling.<br />
1014 /// <since_tizen> 3 </since_tizen>
1015 public bool EnableAutoScroll
1019 return (bool)GetValue(EnableAutoScrollProperty);
1023 SetValue(EnableAutoScrollProperty, value);
1024 NotifyPropertyChanged();
1029 /// The AutoScrollSpeed property.<br />
1030 /// Sets the speed of scrolling in pixels per second.<br />
1032 /// <since_tizen> 3 </since_tizen>
1033 public int AutoScrollSpeed
1037 return (int)GetValue(AutoScrollSpeedProperty);
1041 SetValue(AutoScrollSpeedProperty, value);
1042 NotifyPropertyChanged();
1047 /// The AutoScrollLoopCount property.<br />
1048 /// Number of complete loops when scrolling enabled.<br />
1050 /// <since_tizen> 3 </since_tizen>
1051 public int AutoScrollLoopCount
1055 return (int)GetValue(AutoScrollLoopCountProperty);
1059 SetValue(AutoScrollLoopCountProperty, value);
1060 NotifyPropertyChanged();
1065 /// The AutoScrollGap property.<br />
1066 /// Gap before scrolling wraps.<br />
1068 /// <since_tizen> 3 </since_tizen>
1069 public float AutoScrollGap
1073 return (float)GetValue(AutoScrollGapProperty);
1077 SetValue(AutoScrollGapProperty, value);
1078 NotifyPropertyChanged();
1083 /// The LineSpacing property.<br />
1084 /// The default extra space between lines in points.<br />
1086 /// <since_tizen> 3 </since_tizen>
1087 public float LineSpacing
1091 return (float)GetValue(LineSpacingProperty);
1095 SetValue(LineSpacingProperty, value);
1096 NotifyPropertyChanged();
1101 /// The Underline property.<br />
1102 /// The default underline parameters.<br />
1104 /// <since_tizen> 3 </since_tizen>
1105 public PropertyMap Underline
1109 return (PropertyMap)GetValue(UnderlineProperty);
1113 SetValue(UnderlineProperty, value);
1114 NotifyPropertyChanged();
1119 /// The Shadow property.<br />
1120 /// The default shadow parameters.<br />
1122 /// <since_tizen> 3 </since_tizen>
1123 public PropertyMap Shadow
1127 return (PropertyMap)GetValue(ShadowProperty);
1131 SetValue(ShadowProperty, value);
1132 NotifyPropertyChanged();
1137 /// The Emboss property.<br />
1138 /// The default emboss parameters.<br />
1140 /// <since_tizen> 3 </since_tizen>
1141 public string Emboss
1145 return (string)GetValue(EmbossProperty);
1149 SetValue(EmbossProperty, value);
1150 NotifyPropertyChanged();
1155 /// The Outline property.<br />
1156 /// The default outline parameters.<br />
1158 /// <since_tizen> 3 </since_tizen>
1159 public PropertyMap Outline
1163 return (PropertyMap)GetValue(OutlineProperty);
1167 SetValue(OutlineProperty, value);
1168 NotifyPropertyChanged();
1173 /// The PixelSize property.<br />
1174 /// The size of font in pixels.<br />
1176 /// <since_tizen> 3 </since_tizen>
1177 public float PixelSize
1181 return (float)GetValue(PixelSizeProperty);
1185 SetValue(PixelSizeProperty, value);
1186 NotifyPropertyChanged();
1191 /// The Ellipsis property.<br />
1192 /// Enable or disable the ellipsis.<br />
1194 /// <since_tizen> 3 </since_tizen>
1195 public bool Ellipsis
1199 return (bool)GetValue(EllipsisProperty);
1203 SetValue(EllipsisProperty, value);
1204 NotifyPropertyChanged();
1209 /// The AutoScrollLoopDelay property.<br />
1210 /// Do something.<br />
1212 /// <since_tizen> 3 </since_tizen>
1213 public float AutoScrollLoopDelay
1217 return (float)GetValue(AutoScrollLoopDelayProperty);
1221 SetValue(AutoScrollLoopDelayProperty, value);
1222 NotifyPropertyChanged();
1227 /// The AutoScrollStopMode property.<br />
1228 /// Do something.<br />
1230 /// <since_tizen> 3 </since_tizen>
1231 public AutoScrollStopMode AutoScrollStopMode
1235 return (AutoScrollStopMode)GetValue(AutoScrollStopModeProperty);
1239 SetValue(AutoScrollStopModeProperty, value);
1240 NotifyPropertyChanged();
1245 /// The line count of the text.
1247 /// <since_tizen> 3 </since_tizen>
1248 public int LineCount
1253 GetProperty(TextLabel.Property.LINE_COUNT).Get(out temp);
1259 /// The LineWrapMode property.<br />
1260 /// line wrap mode when the text lines over layout width.<br />
1262 /// <since_tizen> 4 </since_tizen>
1263 public LineWrapMode LineWrapMode
1267 return (LineWrapMode)GetValue(LineWrapModeProperty);
1271 SetValue(LineWrapModeProperty, value);
1272 NotifyPropertyChanged();
1277 /// The direction of the text such as left to right or right to left.
1279 /// <since_tizen> 5 </since_tizen>
1280 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1281 [EditorBrowsable(EditorBrowsableState.Never)]
1282 public TextDirection TextDirection
1287 GetProperty(TextLabel.Property.TEXT_DIRECTION).Get(out temp);
1288 return (TextDirection)temp;
1293 /// The vertical line alignment of the text.
1295 /// <since_tizen> 5 </since_tizen>
1296 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1297 [EditorBrowsable(EditorBrowsableState.Never)]
1298 public VerticalLineAlignment VerticalLineAlignment
1302 return (VerticalLineAlignment)GetValue(VerticalLineAlignmentProperty);
1306 SetValue(VerticalLineAlignmentProperty, value);
1307 NotifyPropertyChanged();