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 //------------------------------------------------------------------------------
31 /// A control which renders a short text string.
32 /// Text labels are lightweight, non-editable and do not respond to user input.
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);
43 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
45 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 DisposeQueue.Instance.Add(this);
56 public override void Dispose()
58 if (!Stage.IsInstalled())
60 DisposeQueue.Instance.Add(this);
66 if (swigCPtr.Handle != global::System.IntPtr.Zero)
71 NDalicPINVOKE.delete_TextLabel(swigCPtr);
73 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
75 global::System.GC.SuppressFinalize(this);
81 internal class Property : global::System.IDisposable
83 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
84 protected bool swigCMemOwn;
86 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
88 swigCMemOwn = cMemoryOwn;
89 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
92 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
94 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
102 public virtual void Dispose()
106 if (swigCPtr.Handle != global::System.IntPtr.Zero)
111 NDalicPINVOKE.delete_TextLabel_Property(swigCPtr);
113 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
115 global::System.GC.SuppressFinalize(this);
119 internal Property() : this(NDalicPINVOKE.new_TextLabel_Property(), true)
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get();
125 internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get();
126 internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextLabel_Property_FONT_FAMILY_get();
127 internal static readonly int FONT_STYLE = NDalicPINVOKE.TextLabel_Property_FONT_STYLE_get();
128 internal static readonly int POINT_SIZE = NDalicPINVOKE.TextLabel_Property_POINT_SIZE_get();
129 internal static readonly int MULTI_LINE = NDalicPINVOKE.TextLabel_Property_MULTI_LINE_get();
130 internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
131 internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_VERTICAL_ALIGNMENT_get();
132 internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_get();
133 internal static readonly int SHADOW_OFFSET = NDalicPINVOKE.TextLabel_Property_SHADOW_OFFSET_get();
134 internal static readonly int SHADOW_COLOR = NDalicPINVOKE.TextLabel_Property_SHADOW_COLOR_get();
135 internal static readonly int UNDERLINE_ENABLED = NDalicPINVOKE.TextLabel_Property_UNDERLINE_ENABLED_get();
136 internal static readonly int UNDERLINE_COLOR = NDalicPINVOKE.TextLabel_Property_UNDERLINE_COLOR_get();
137 internal static readonly int UNDERLINE_HEIGHT = NDalicPINVOKE.TextLabel_Property_UNDERLINE_HEIGHT_get();
138 internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextLabel_Property_ENABLE_MARKUP_get();
139 internal static readonly int ENABLE_AUTO_SCROLL = NDalicPINVOKE.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
140 internal static readonly int AUTO_SCROLL_SPEED = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_SPEED_get();
141 internal static readonly int AUTO_SCROLL_LOOP_COUNT = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
142 internal static readonly int AUTO_SCROLL_GAP = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_GAP_get();
143 internal static readonly int LINE_SPACING = NDalicPINVOKE.TextLabel_Property_LINE_SPACING_get();
144 internal static readonly int UNDERLINE = NDalicPINVOKE.TextLabel_Property_UNDERLINE_get();
145 internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get();
146 internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get();
147 internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get();
152 /// Creates the TextLabel control.
154 public TextLabel() : this(NDalicPINVOKE.TextLabel_New__SWIG_0(), true)
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 /// Creates the TextLabel control.
163 /// <param name="text">The text to display</param>
164 public TextLabel(string text) : this(NDalicPINVOKE.TextLabel_New__SWIG_1(text), true)
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 internal TextLabel(TextLabel handle) : this(NDalicPINVOKE.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 internal TextLabel Assign(TextLabel handle)
176 TextLabel ret = new TextLabel(NDalicPINVOKE.TextLabel_Assign(swigCPtr, TextLabel.getCPtr(handle)), false);
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 /// Downcasts a handle to TextLabel.
184 /// <param name="handle">Handle to an object</param>
185 public new static TextLabel DownCast(BaseHandle handle)
187 TextLabel ret = new TextLabel(NDalicPINVOKE.TextLabel_DownCast(BaseHandle.getCPtr(handle)), true);
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 internal enum PropertyRange
194 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
195 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
199 /// RenderingBackend property
200 /// The type of rendering e.g. bitmap-based.
202 public int RenderingBackend
207 GetProperty(TextLabel.Property.RENDERING_BACKEND).Get(ref temp);
212 SetProperty(TextLabel.Property.RENDERING_BACKEND, new Tizen.NUI.PropertyValue(value));
218 /// The text to display in UTF-8 format.
225 GetProperty(TextLabel.Property.TEXT).Get(out temp);
230 SetProperty(TextLabel.Property.TEXT, new Tizen.NUI.PropertyValue(value));
235 /// FontFamily property
236 /// The requested font family to use.
238 public string FontFamily
243 GetProperty(TextLabel.Property.FONT_FAMILY).Get(out temp);
248 SetProperty(TextLabel.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue(value));
253 /// FontStyle property
254 /// The requested font style to use.
256 public PropertyMap FontStyle
260 PropertyMap temp = new PropertyMap();
261 GetProperty(TextLabel.Property.FONT_STYLE).Get(temp);
266 SetProperty(TextLabel.Property.FONT_STYLE, new Tizen.NUI.PropertyValue(value));
271 /// PointSize property
272 /// The size of font in points.
274 public float PointSize
279 GetProperty(TextLabel.Property.POINT_SIZE).Get(ref temp);
284 SetProperty(TextLabel.Property.POINT_SIZE, new Tizen.NUI.PropertyValue(value));
289 /// MultiLine property
290 /// The single-line or multi-line layout option.
292 public bool MultiLine
297 GetProperty(TextLabel.Property.MULTI_LINE).Get(ref temp);
302 SetProperty(TextLabel.Property.MULTI_LINE, new Tizen.NUI.PropertyValue(value));
307 /// HorizontalAlignment property
308 /// The line horizontal alignment.
310 public string HorizontalAlignment
315 GetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT).Get(out temp);
320 SetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(value));
325 /// VerticalAlignment property
326 /// The line vertical alignment.
328 public string VerticalAlignment
333 GetProperty(TextLabel.Property.VERTICAL_ALIGNMENT).Get(out temp);
338 SetProperty(TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(value));
343 /// TextColor property
344 /// The color of the text.
346 public Color TextColor
350 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
351 GetProperty(TextLabel.Property.TEXT_COLOR).Get(temp);
356 SetProperty(TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue(value));
361 /// ShadowOffset property
362 /// The drop shadow offset 0 indicates no shadow.
364 public Vector2 ShadowOffset
368 Vector2 temp = new Vector2(0.0f, 0.0f);
369 GetProperty(TextLabel.Property.SHADOW_OFFSET).Get(temp);
374 SetProperty(TextLabel.Property.SHADOW_OFFSET, new Tizen.NUI.PropertyValue(value));
379 /// ShadowColor property
380 /// The color of a drop shadow.
382 public Vector4 ShadowColor
386 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
387 GetProperty(TextLabel.Property.SHADOW_COLOR).Get(temp);
392 SetProperty(TextLabel.Property.SHADOW_COLOR, new Tizen.NUI.PropertyValue(value));
397 /// UnderlineEnabled property
398 /// The underline enabled flag.
400 public bool UnderlineEnabled
405 GetProperty(TextLabel.Property.UNDERLINE_ENABLED).Get(ref temp);
410 SetProperty(TextLabel.Property.UNDERLINE_ENABLED, new Tizen.NUI.PropertyValue(value));
415 /// UnderlineColor property
416 /// Overrides the underline height from font metrics.
418 public Vector4 UnderlineColor
422 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
423 GetProperty(TextLabel.Property.UNDERLINE_COLOR).Get(temp);
428 SetProperty(TextLabel.Property.UNDERLINE_COLOR, new Tizen.NUI.PropertyValue(value));
433 /// UnderlineHeight property
434 /// Overrides the underline height from font metrics.
436 public float UnderlineHeight
441 GetProperty(TextLabel.Property.UNDERLINE_HEIGHT).Get(ref temp);
446 SetProperty(TextLabel.Property.UNDERLINE_HEIGHT, new Tizen.NUI.PropertyValue(value));
451 /// EnableMarkup property
452 /// Whether the mark-up processing is enabled.
454 public bool EnableMarkup
459 GetProperty(TextLabel.Property.ENABLE_MARKUP).Get(ref temp);
464 SetProperty(TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue(value));
469 /// EnableAutoScroll property
470 /// Starts or stops auto scrolling.
472 public bool EnableAutoScroll
477 GetProperty(TextLabel.Property.ENABLE_AUTO_SCROLL).Get(ref temp);
482 SetProperty(TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue(value));
487 /// AutoScrollSpeed property
488 /// Sets the speed of scrolling in pixels per second.
490 public int AutoScrollSpeed
495 GetProperty(TextLabel.Property.AUTO_SCROLL_SPEED).Get(ref temp);
500 SetProperty(TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue(value));
505 /// AutoScrollLoopCount property
506 /// Number of complete loops when scrolling enabled.
508 public int AutoScrollLoopCount
513 GetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_COUNT).Get(ref temp);
518 SetProperty(TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue(value));
523 /// AutoScrollGap property
524 /// Gap before scrolling wraps.
526 public float AutoScrollGap
531 GetProperty(TextLabel.Property.AUTO_SCROLL_GAP).Get(ref temp);
536 SetProperty(TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue(value));
541 /// LineSpacing property
542 /// The default extra space between lines in points.
544 public float LineSpacing
549 GetProperty(TextLabel.Property.LINE_SPACING).Get(ref temp);
554 SetProperty(TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue(value));
559 /// Underline property
560 /// The default underline parameters.
562 public PropertyMap Underline
566 PropertyMap temp = new PropertyMap();
567 GetProperty(TextLabel.Property.UNDERLINE).Get(temp);
572 SetProperty(TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue(value));
578 /// The default shadow parameters.
580 public PropertyMap Shadow
584 PropertyMap temp = new PropertyMap();
585 GetProperty(TextLabel.Property.SHADOW).Get(temp);
590 SetProperty(TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue(value));
596 /// The default emboss parameters.
603 GetProperty(TextLabel.Property.EMBOSS).Get( out temp);
608 SetProperty(TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue(value));
614 /// The default outline parameters.
616 public string Outline
621 GetProperty(TextLabel.Property.OUTLINE).Get(out temp);
626 SetProperty(TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue(value));