1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
27 namespace Tizen.NUI.BaseComponents
31 /// A control which renders a short text string.<br>
32 /// Text labels are lightweight, non-editable and do not respond to user input.<br>
34 public class TextLabel : View
36 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
38 internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41 // By default, we do not want the position to use the anchor point
42 PositionUsesAnchorPoint = false;
45 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
47 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
53 protected override void Dispose(DisposeTypes type)
60 if(type == DisposeTypes.Explicit)
63 //Release your own managed resources here.
64 //You should release all of your own disposable objects here.
67 //Release your own unmanaged resources here.
68 //You should not access any managed member here except static instance.
69 //because the execution order of Finalizes is non-deterministic.
71 if (swigCPtr.Handle != global::System.IntPtr.Zero)
76 NDalicPINVOKE.delete_TextLabel(swigCPtr);
78 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
84 internal class Property
86 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get();
87 internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get();
88 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextLabel_Property_FONT_FAMILY_get();
89 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextLabel_Property_FONT_STYLE_get();
90 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextLabel_Property_POINT_SIZE_get();
91 internal static readonly int MULTI_LINE = NDalicPINVOKE.TextLabel_Property_MULTI_LINE_get();
92 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
93 internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_VERTICAL_ALIGNMENT_get();
94 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_get();
95 internal static readonly int SHADOW_OFFSET = NDalicPINVOKE.TextLabel_Property_SHADOW_OFFSET_get();
96 internal static readonly int SHADOW_COLOR = NDalicPINVOKE.TextLabel_Property_SHADOW_COLOR_get();
97 internal static readonly int UNDERLINE_ENABLED = NDalicPINVOKE.TextLabel_Property_UNDERLINE_ENABLED_get();
98 internal static readonly int UNDERLINE_COLOR = NDalicPINVOKE.TextLabel_Property_UNDERLINE_COLOR_get();
99 internal static readonly int UNDERLINE_HEIGHT = NDalicPINVOKE.TextLabel_Property_UNDERLINE_HEIGHT_get();
100 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextLabel_Property_ENABLE_MARKUP_get();
101 internal static readonly int ENABLE_AUTO_SCROLL = NDalicPINVOKE.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
102 internal static readonly int AUTO_SCROLL_SPEED = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_SPEED_get();
103 internal static readonly int AUTO_SCROLL_LOOP_COUNT = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
104 internal static readonly int AUTO_SCROLL_GAP = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_GAP_get();
105 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextLabel_Property_LINE_SPACING_get();
106 internal static readonly int UNDERLINE = NDalicPINVOKE.TextLabel_Property_UNDERLINE_get();
107 internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get();
108 internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get();
109 internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get();
110 internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextLabel_Property_PIXEL_SIZE_get();
111 internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get();
112 internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
113 internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
118 /// Creates the TextLabel control.
120 public TextLabel() : this(NDalicPINVOKE.TextLabel_New__SWIG_0(), true)
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 /// Creates the TextLabel control.
129 /// <param name="text">The text to display</param>
130 public TextLabel(string text) : this(NDalicPINVOKE.TextLabel_New__SWIG_1(text), true)
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 internal TextLabel(TextLabel handle) : this(NDalicPINVOKE.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 /// Text property.<br>
142 /// The text to display in UTF-8 format.<br>
149 GetProperty(TextLabel.Property.TEXT).Get(out temp);
154 SetProperty(TextLabel.Property.TEXT, new Tizen.NUI.PropertyValue(value));
159 /// FontFamily property.<br>
160 /// The requested font family to use.<br>
162 public string FontFamily
167 GetProperty(TextLabel.Property.FONT_FAMILY).Get(out temp);
172 SetProperty(TextLabel.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
177 /// FontStyle property.<br>
178 /// The requested font style to use.<br>
180 public PropertyMap FontStyle
184 PropertyMap temp = new PropertyMap();
185 GetProperty(TextLabel.Property.FONT_STYLE).Get(temp);
190 SetProperty(TextLabel.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
195 /// PointSize property.<br>
196 /// The size of font in points.<br>
198 public float PointSize
203 GetProperty(TextLabel.Property.POINT_SIZE).Get(out temp);
208 SetProperty(TextLabel.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
213 /// MultiLine property.<br>
214 /// The single-line or multi-line layout option.<br>
216 public bool MultiLine
221 GetProperty(TextLabel.Property.MULTI_LINE).Get(out temp);
226 SetProperty(TextLabel.Property.MULTI_LINE, new Tizen.NUI.PropertyValue(value));
231 /// HorizontalAlignment property.<br>
232 /// The line horizontal alignment.<br>
234 public HorizontalAlignment HorizontalAlignment
239 if (GetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
242 Tizen.Log.Error("NUI", "HorizontalAlignment get error!");
248 return HorizontalAlignment.Begin;
250 return HorizontalAlignment.Center;
252 return HorizontalAlignment.End;
254 return HorizontalAlignment.Begin;
259 string valueToString = "";
262 case HorizontalAlignment.Begin:
264 valueToString = "BEGIN";
267 case HorizontalAlignment.Center:
269 valueToString = "CENTER";
272 case HorizontalAlignment.End:
274 valueToString = "END";
279 valueToString = "BEGIN";
283 SetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
288 /// VerticalAlignment property.<br>
289 /// The line vertical alignment.<br>
291 public VerticalAlignment VerticalAlignment
296 if (GetProperty(TextLabel.Property.VERTICAL_ALIGNMENT).Get(out temp) == false)
299 Tizen.Log.Error("NUI", "VerticalAlignment get error!");
306 return VerticalAlignment.Top;
308 return VerticalAlignment.Center;
310 return VerticalAlignment.Bottom;
312 return VerticalAlignment.Bottom;
317 string valueToString = "";
320 case VerticalAlignment.Top:
322 valueToString = "TOP";
325 case VerticalAlignment.Center:
327 valueToString = "CENTER";
330 case VerticalAlignment.Bottom:
332 valueToString = "BOTTOM";
337 valueToString = "BOTTOM";
341 SetProperty(TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
346 /// TextColor property.<br>
347 /// The color of the text.<br>
349 public Color TextColor
353 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
354 GetProperty(TextLabel.Property.TEXT_COLOR).Get(temp);
359 SetProperty(TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
364 /// ShadowOffset property.<br>
365 /// The drop shadow offset 0 indicates no shadow.<br>
367 public Vector2 ShadowOffset
371 Vector2 temp = new Vector2(0.0f, 0.0f);
372 GetProperty(TextLabel.Property.SHADOW_OFFSET).Get(temp);
377 SetProperty(TextLabel.Property.SHADOW_OFFSET, new Tizen.NUI.PropertyValue(value));
382 /// ShadowColor property.<br>
383 /// The color of a drop shadow.<br>
385 public Vector4 ShadowColor
389 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
390 GetProperty(TextLabel.Property.SHADOW_COLOR).Get(temp);
395 SetProperty(TextLabel.Property.SHADOW_COLOR, new Tizen.NUI.PropertyValue(value));
400 /// UnderlineEnabled property.<br>
401 /// The underline enabled flag.<br>
403 public bool UnderlineEnabled
408 GetProperty(TextLabel.Property.UNDERLINE_ENABLED).Get(out temp);
413 SetProperty(TextLabel.Property.UNDERLINE_ENABLED, new Tizen.NUI.PropertyValue(value));
418 /// UnderlineColor property.<br>
419 /// Overrides the underline height from font metrics.<br>
421 public Vector4 UnderlineColor
425 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
426 GetProperty(TextLabel.Property.UNDERLINE_COLOR).Get(temp);
431 SetProperty(TextLabel.Property.UNDERLINE_COLOR, new Tizen.NUI.PropertyValue(value));
436 /// UnderlineHeight property.<br>
437 /// Overrides the underline height from font metrics.<br>
439 public float UnderlineHeight
444 GetProperty(TextLabel.Property.UNDERLINE_HEIGHT).Get(out temp);
449 SetProperty(TextLabel.Property.UNDERLINE_HEIGHT, new Tizen.NUI.PropertyValue(value));
454 /// EnableMarkup property.<br>
455 /// Whether the mark-up processing is enabled.<br>
457 public bool EnableMarkup
462 GetProperty(TextLabel.Property.ENABLE_MARKUP).Get(out temp);
467 SetProperty(TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
472 /// EnableAutoScroll property.<br>
473 /// Starts or stops auto scrolling.<br>
475 public bool EnableAutoScroll
480 GetProperty(TextLabel.Property.ENABLE_AUTO_SCROLL).Get(out temp);
485 SetProperty(TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue(value));
490 /// AutoScrollSpeed property.<br>
491 /// Sets the speed of scrolling in pixels per second.<br>
493 public int AutoScrollSpeed
498 GetProperty(TextLabel.Property.AUTO_SCROLL_SPEED).Get(out temp);
503 SetProperty(TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
508 /// AutoScrollLoopCount property.<br>
509 /// Number of complete loops when scrolling enabled.<br>
511 public int AutoScrollLoopCount
516 GetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_COUNT).Get(out temp);
521 SetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue(value));
526 /// AutoScrollGap property.<br>
527 /// Gap before scrolling wraps.<br>
529 public float AutoScrollGap
534 GetProperty(TextLabel.Property.AUTO_SCROLL_GAP).Get(out temp);
539 SetProperty(TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue(value));
544 /// LineSpacing property.<br>
545 /// The default extra space between lines in points.<br>
547 public float LineSpacing
552 GetProperty(TextLabel.Property.LINE_SPACING).Get(out temp);
557 SetProperty(TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
562 /// Underline property.<br>
563 /// The default underline parameters.<br>
565 public PropertyMap Underline
569 PropertyMap temp = new PropertyMap();
570 GetProperty(TextLabel.Property.UNDERLINE).Get(temp);
575 SetProperty(TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
580 /// Shadow property.<br>
581 /// The default shadow parameters.<br>
583 public PropertyMap Shadow
587 PropertyMap temp = new PropertyMap();
588 GetProperty(TextLabel.Property.SHADOW).Get(temp);
593 SetProperty(TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
598 /// Emboss property.<br>
599 /// The default emboss parameters.<br>
606 GetProperty(TextLabel.Property.EMBOSS).Get( out temp);
611 SetProperty(TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
616 /// Outline property.<br>
617 /// The default outline parameters.<br>
619 public string Outline
624 GetProperty(TextLabel.Property.OUTLINE).Get(out temp);
629 SetProperty(TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));
634 /// PixelSize property.<br>
635 /// The size of font in pixels.<br>
637 public float PixelSize
642 GetProperty(TextLabel.Property.PIXEL_SIZE).Get(out temp);
647 SetProperty(TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue(value));
652 /// Ellipsis property.<br>
653 /// Enable or disable the ellipsis.<br>
660 GetProperty(TextLabel.Property.ELLIPSIS).Get(out temp);
665 SetProperty(TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue(value));
670 /// AutoScrollLoopDelay property.<br>
671 /// do something.<br>
673 public float AutoScrollLoopDelay
678 GetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_DELAY).Get(out temp);
683 SetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_DELAY, new Tizen.NUI.PropertyValue(value));
688 /// AutoScrollStopMode property.<br>
689 /// do something.<br>
691 public AutoScrollStopMode AutoScrollStopMode
696 if(GetProperty(TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false)
699 Tizen.Log.Error("NUI", "AutoScrollStopMode get error!");
705 return AutoScrollStopMode.FinishLoop;
707 return AutoScrollStopMode.Immediate;
709 return AutoScrollStopMode.FinishLoop;
714 SetProperty(TextLabel.Property.AUTO_SCROLL_STOP_MODE, new Tizen.NUI.PropertyValue((int)value));