[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Label.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 namespace ElmSharp
19 {
20     /// <summary>
21     /// The Label is a widget to display text, with a simple HTML-like markup.
22     /// Inherits Layout.
23     /// </summary>
24     /// <since_tizen> preview </since_tizen>
25     [Obsolete("This has been deprecated in API12")]
26     public class Label : Layout
27     {
28         SmartEvent _slideCompleted;
29
30         /// <summary>
31         /// Creates and initializes a new instance of the Label class.
32         /// </summary>
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)
37         {
38             _slideCompleted = new SmartEvent(this, this.RealHandle, "slide,end");
39             _slideCompleted.On += (s, e) =>
40             {
41                 SlideCompleted?.Invoke(this, EventArgs.Empty);
42             };
43         }
44
45         /// <summary>
46         /// SlideCompleted will be triggered when the slide is completed.
47         /// </summary>
48         /// <since_tizen> preview </since_tizen>
49         [Obsolete("This has been deprecated in API12")]
50         public event EventHandler SlideCompleted;
51
52         /// <summary>
53         /// Sets or gets the wrap width of the label.
54         /// </summary>
55         /// <since_tizen> preview </since_tizen>
56         [Obsolete("This has been deprecated in API12")]
57         public int LineWrapWidth
58         {
59             get
60             {
61                 return Interop.Elementary.elm_label_wrap_width_get(RealHandle);
62             }
63             set
64             {
65                 Interop.Elementary.elm_label_wrap_width_set(RealHandle, value);
66             }
67         }
68
69         /// <summary>
70         /// Sets or gets the wrapping behavior of the label.
71         /// </summary>
72         /// <since_tizen> preview </since_tizen>
73         [Obsolete("This has been deprecated in API12")]
74         public WrapType LineWrapType
75         {
76             get
77             {
78                 return (WrapType)Interop.Elementary.elm_label_line_wrap_get(RealHandle);
79             }
80             set
81             {
82                 Interop.Elementary.elm_label_line_wrap_set(RealHandle, (int)value);
83                 if (value != WrapType.None)
84                 {
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);
87                 }
88             }
89         }
90
91         /// <summary>
92         /// Sets or gets the slide mode of the Label widget.
93         /// </summary>
94         /// <since_tizen> preview </since_tizen>
95         [Obsolete("This has been deprecated in API12")]
96         public LabelSlideMode SlideMode
97         {
98             get
99             {
100                 return (LabelSlideMode)Interop.Elementary.elm_label_slide_mode_get(RealHandle);
101             }
102             set
103             {
104                 Interop.Elementary.elm_label_slide_mode_set(RealHandle, (int)value);
105             }
106         }
107
108         /// <summary>
109         /// Sets or gets the slide duration of the label.
110         /// </summary>
111         /// <since_tizen> preview </since_tizen>
112         [Obsolete("This has been deprecated in API12")]
113         public double SlideDuration
114         {
115             get
116             {
117                 return Interop.Elementary.elm_label_slide_duration_get(RealHandle);
118             }
119             set
120             {
121                 Interop.Elementary.elm_label_slide_duration_set(RealHandle, value);
122             }
123         }
124
125         /// <summary>
126         /// Sets or gets the slide speed of the label.
127         /// </summary>
128         /// <remarks>
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.
131         /// </remarks>
132         /// <seealso cref="SlideDuration"/>
133         /// <since_tizen> preview </since_tizen>
134         [Obsolete("This has been deprecated in API12")]
135         public double SlideSpeed
136         {
137             get
138             {
139                 return Interop.Elementary.elm_label_slide_speed_get(RealHandle);
140             }
141             set
142             {
143                 Interop.Elementary.elm_label_slide_speed_set(RealHandle, value);
144             }
145         }
146
147         /// <summary>
148         /// Sets or gets the ellipsis behavior of the label.
149         /// </summary>
150         /// <since_tizen> preview </since_tizen>
151         [Obsolete("This has been deprecated in API12")]
152         public bool IsEllipsis
153         {
154             get
155             {
156                 return Interop.Elementary.elm_label_ellipsis_get(RealHandle);
157             }
158             set
159             {
160                 Interop.Elementary.elm_label_ellipsis_set(RealHandle, value);
161             }
162         }
163
164         /// <summary>
165         /// Sets or gets the style of the label text.
166         /// </summary>
167         /// <remarks>
168         /// APIs, elm_label_text_style_user_peek/pop/push, are internal APIs only in Tizen. Available since Tizen_4.0.
169         /// </remarks>
170         /// 
171         /// <since_tizen> preview </since_tizen>
172         [Obsolete("This has been deprecated in API12")]
173         public string TextStyle
174         {
175             get
176             {
177                 return Interop.Elementary.elm_label_text_style_user_peek(RealHandle);
178             }
179             set
180             {
181                 if (string.IsNullOrEmpty(value))
182                 {
183                     Interop.Elementary.elm_label_text_style_user_pop(RealHandle);
184                 }
185                 else
186                 {
187                     Interop.Elementary.elm_label_text_style_user_push(RealHandle, value);
188                 }
189             }
190         }
191
192         /// <summary>
193         /// Starts the slide effect.
194         /// </summary>
195         /// <since_tizen> preview </since_tizen>
196         [Obsolete("This has been deprecated in API12")]
197         public void PlaySlide()
198         {
199             Interop.Elementary.elm_label_slide_go(RealHandle);
200         }
201
202         /// <summary>
203         /// Sets the content at a part of a given container widget.
204         /// </summary>
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)
210         {
211             return Interop.Elementary.elm_label_add(parent.Handle);
212         }
213     }
214
215     /// <summary>
216     /// Enumeration for the slide modes of a label widget.
217     /// </summary>
218     /// <since_tizen> preview </since_tizen>
219     [Obsolete("This has been deprecated in API12")]
220     public enum LabelSlideMode
221     {
222         /// <summary>
223         /// No slide effect.
224         /// </summary>
225         None = 0,
226         /// <summary>
227         /// Slide only if the label area is bigger than the text width length.
228         /// </summary>
229         Auto,
230         /// <summary>
231         /// Slide always.
232         /// </summary>
233         Always
234     }
235 }