2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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.
21 /// The Label is a widget to display text, with a simple HTML-like markup.
24 /// <since_tizen> preview </since_tizen>
25 [Obsolete("This has been deprecated in API12")]
26 public class Label : Layout
28 SmartEvent _slideCompleted;
31 /// Creates and initializes a new instance of the Label class.
33 /// <param name="parent">The parent is a given container, which will be attached by the Label as a child. It's <see cref="EvasObject"/> type.</param>
34 /// <since_tizen> preview </since_tizen>
35 [Obsolete("This has been deprecated in API12")]
36 public Label(EvasObject parent) : base(parent)
38 _slideCompleted = new SmartEvent(this, this.RealHandle, "slide,end");
39 _slideCompleted.On += (s, e) =>
41 SlideCompleted?.Invoke(this, EventArgs.Empty);
46 /// SlideCompleted will be triggered when the slide is completed.
48 /// <since_tizen> preview </since_tizen>
49 [Obsolete("This has been deprecated in API12")]
50 public event EventHandler SlideCompleted;
53 /// Sets or gets the wrap width of the label.
55 /// <since_tizen> preview </since_tizen>
56 [Obsolete("This has been deprecated in API12")]
57 public int LineWrapWidth
61 return Interop.Elementary.elm_label_wrap_width_get(RealHandle);
65 Interop.Elementary.elm_label_wrap_width_set(RealHandle, value);
70 /// Sets or gets the wrapping behavior of the label.
72 /// <since_tizen> preview </since_tizen>
73 [Obsolete("This has been deprecated in API12")]
74 public WrapType LineWrapType
78 return (WrapType)Interop.Elementary.elm_label_line_wrap_get(RealHandle);
82 Interop.Elementary.elm_label_line_wrap_set(RealHandle, (int)value);
83 if (value != WrapType.None)
85 Interop.Evas.evas_object_size_hint_min_get(RealHandle, IntPtr.Zero, out int h);
86 Interop.Evas.evas_object_size_hint_min_set(RealHandle, 0, h);
92 /// Sets or gets the slide mode of the Label widget.
94 /// <since_tizen> preview </since_tizen>
95 [Obsolete("This has been deprecated in API12")]
96 public LabelSlideMode SlideMode
100 return (LabelSlideMode)Interop.Elementary.elm_label_slide_mode_get(RealHandle);
104 Interop.Elementary.elm_label_slide_mode_set(RealHandle, (int)value);
109 /// Sets or gets the slide duration of the label.
111 /// <since_tizen> preview </since_tizen>
112 [Obsolete("This has been deprecated in API12")]
113 public double SlideDuration
117 return Interop.Elementary.elm_label_slide_duration_get(RealHandle);
121 Interop.Elementary.elm_label_slide_duration_set(RealHandle, value);
126 /// Sets or gets the slide speed of the label.
129 /// The speed of the slide animation in px per seconds.
130 /// If you set the duration of the slide using elm_label_slide_duration_set(), you cannot get the correct speed using this function until the label is actually rendered and resized.
132 /// <seealso cref="SlideDuration"/>
133 /// <since_tizen> preview </since_tizen>
134 [Obsolete("This has been deprecated in API12")]
135 public double SlideSpeed
139 return Interop.Elementary.elm_label_slide_speed_get(RealHandle);
143 Interop.Elementary.elm_label_slide_speed_set(RealHandle, value);
148 /// Sets or gets the ellipsis behavior of the label.
150 /// <since_tizen> preview </since_tizen>
151 [Obsolete("This has been deprecated in API12")]
152 public bool IsEllipsis
156 return Interop.Elementary.elm_label_ellipsis_get(RealHandle);
160 Interop.Elementary.elm_label_ellipsis_set(RealHandle, value);
165 /// Sets or gets the style of the label text.
168 /// APIs, elm_label_text_style_user_peek/pop/push, are internal APIs only in Tizen. Available since Tizen_4.0.
171 /// <since_tizen> preview </since_tizen>
172 [Obsolete("This has been deprecated in API12")]
173 public string TextStyle
177 return Interop.Elementary.elm_label_text_style_user_peek(RealHandle);
181 if (string.IsNullOrEmpty(value))
183 Interop.Elementary.elm_label_text_style_user_pop(RealHandle);
187 Interop.Elementary.elm_label_text_style_user_push(RealHandle, value);
193 /// Starts the slide effect.
195 /// <since_tizen> preview </since_tizen>
196 [Obsolete("This has been deprecated in API12")]
197 public void PlaySlide()
199 Interop.Elementary.elm_label_slide_go(RealHandle);
203 /// Sets the content at a part of a given container widget.
205 /// <param name="parent">EvasObject</param>
206 /// <returns>The new object, otherwise null if it cannot be created.</returns>
207 /// <since_tizen> preview </since_tizen>
208 [Obsolete("This has been deprecated in API12")]
209 protected override IntPtr CreateHandle(EvasObject parent)
211 return Interop.Elementary.elm_label_add(parent.Handle);
216 /// Enumeration for the slide modes of a label widget.
218 /// <since_tizen> preview </since_tizen>
219 [Obsolete("This has been deprecated in API12")]
220 public enum LabelSlideMode
227 /// Slide only if the label area is bigger than the text width length.