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.
18 using System.Collections.Generic;
23 /// The FlipSelector is a widget to show a set of text items, one at a time, with the same sheet switching style as the clock widget when one changes the current displaying sheet.
25 /// <since_tizen> preview </since_tizen>
26 [Obsolete("This has been deprecated in API12")]
27 public class FlipSelector : Layout
30 SmartEvent _overflowed;
31 SmartEvent _underflowed;
34 /// Creates and initializes a new instance of the FlipSelector.
36 /// <param name="parent">Parent EvasObject.</param>
37 /// <since_tizen> preview </since_tizen>
38 [Obsolete("This has been deprecated in API12")]
39 public FlipSelector(EvasObject parent) : base(parent)
41 _selected = new SmartEvent(this, Handle, "selected");
42 _overflowed = new SmartEvent(this, Handle, "overflowed");
43 _underflowed = new SmartEvent(this, Handle, "underflowed");
45 _selected.On += SelectedChanged;
46 _overflowed.On += OverflowedChanged;
47 _underflowed.On += UnderflowedChanged;
51 /// Selected will be triggered when selected.
53 /// <since_tizen> preview </since_tizen>
54 [Obsolete("This has been deprecated in API12")]
55 public event EventHandler Selected;
57 /// Overflowed will be triggered when overflowed.
59 /// <since_tizen> preview </since_tizen>
60 [Obsolete("This has been deprecated in API12")]
61 public event EventHandler Overflowed;
63 /// Underflowed will be triggered when underflowed.
65 /// <since_tizen> preview </since_tizen>
66 [Obsolete("This has been deprecated in API12")]
67 public event EventHandler Underflowed;
70 /// Sets or gets the interval on time updates for a user mouse button to hold on the flip selector widget.
72 /// <since_tizen> preview </since_tizen>
73 [Obsolete("This has been deprecated in API12")]
74 public double Interval
78 return Interop.Elementary.elm_flipselector_first_interval_get(Handle);
82 Interop.Elementary.elm_flipselector_first_interval_set(Handle, value);
88 /// Gets the currently selected item in the flip selector widget.
90 /// <since_tizen> preview </since_tizen>
91 [Obsolete("This has been deprecated in API12")]
92 public FlipSelectorItem SelectedItem
96 IntPtr handle = Interop.Elementary.elm_flipselector_selected_item_get(Handle);
97 return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
102 /// Gets the first item in the given flip selector widget's list of items.
104 /// <since_tizen> preview </since_tizen>
105 [Obsolete("This has been deprecated in API12")]
106 public FlipSelectorItem FirstItem
110 IntPtr handle = Interop.Elementary.elm_flipselector_first_item_get(Handle);
111 return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
116 /// Gets the last item in the given flip selector widget's list of items.
118 /// <since_tizen> preview </since_tizen>
119 [Obsolete("This has been deprecated in API12")]
120 public FlipSelectorItem LastItem
124 IntPtr handle = Interop.Elementary.elm_flipselector_last_item_get(Handle);
125 return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
130 /// Appends the (text) item to the flip selector widget.
132 /// <param name="text">text value</param>
134 /// A handle to the item added, or null on errors.
137 /// The widget's list of labels to show will be appended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when the same item is selected.
139 /// <since_tizen> preview </since_tizen>
140 [Obsolete("This has been deprecated in API12")]
141 public FlipSelectorItem Append(string text)
143 FlipSelectorItem item = new FlipSelectorItem(text, this);
144 item.Handle = Interop.Elementary.elm_flipselector_item_append(Handle, text, null, (IntPtr)item.Id);
149 /// Prepends the (text) item to a flip selector widget.
151 /// <param name="text">Prepend text</param>
152 /// <returns>A handle to the item added, or null on errors.</returns>
154 /// The widget's list of labels to show will be prepended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when the same item is selected.
156 /// <since_tizen> preview </since_tizen>
157 [Obsolete("This has been deprecated in API12")]
158 public FlipSelectorItem Prepend(string text)
160 FlipSelectorItem item = new FlipSelectorItem(text, this);
161 item.Handle = Interop.Elementary.elm_flipselector_item_prepend(Handle, text, null, (IntPtr)item.Id);
166 /// To remove the given item.
168 /// <param name="item">FlipSelector's item.</param>
169 /// <since_tizen> preview </since_tizen>
170 [Obsolete("This has been deprecated in API12")]
171 public void Remove(FlipSelectorItem item)
178 /// Programmatically select the next item of the flip selector widget.
181 /// The selection will be animated. Also, if it reaches the beginning of its list of member items, it will continue with the last one backwards.
183 /// <since_tizen> preview </since_tizen>
184 [Obsolete("This has been deprecated in API12")]
187 Interop.Elementary.elm_flipselector_flip_next(Handle);
191 /// Programmatically select the previous item of the flip selector widget.
193 /// <since_tizen> preview </since_tizen>
194 [Obsolete("This has been deprecated in API12")]
197 Interop.Elementary.elm_flipselector_flip_prev(Handle);
201 /// Creates a widget handle.
203 /// <param name="parent">Parent EvasObject.</param>
204 /// <returns>Handle IntPtr.</returns>
205 /// <since_tizen> preview </since_tizen>
206 [Obsolete("This has been deprecated in API12")]
207 protected override IntPtr CreateHandle(EvasObject parent)
209 return Interop.Elementary.elm_flipselector_add(parent.Handle);
212 void SelectedChanged(object sender, EventArgs e)
214 SelectedItem?.SendSelected();
215 Selected?.Invoke(this, EventArgs.Empty);
218 void OverflowedChanged(object sender, EventArgs e)
220 Overflowed?.Invoke(this, e);
223 void UnderflowedChanged(object sender, EventArgs e)
225 Underflowed?.Invoke(this, e);