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.ComponentModel;
23 /// The type of the item's part types.
25 /// <since_tizen> preview </since_tizen>
26 [Obsolete("This has been deprecated in API12")]
28 public enum GenListItemFieldType
36 /// The Text part type.
41 /// The Content part type.
46 /// The State part type.
57 /// It inherits <see cref="GenItem"/>.
58 /// A instance to the genlist item is added.
59 /// It contains the Update() method to update a genlist item which is given.
61 /// <since_tizen> preview </since_tizen>
62 [Obsolete("This has been deprecated in API12")]
63 public class GenListItem : GenItem
65 internal GenListItem(object data, GenItemClass itemClass) : base(data, itemClass)
69 internal GenListItem(object data, GenItemClass itemClass, EvasObject parent) : base(data, itemClass, parent)
74 /// Gets or sets whether a given genlist item is selected.
76 /// <since_tizen> preview </since_tizen>
77 [Obsolete("This has been deprecated in API12")]
78 public override bool IsSelected
82 return Interop.Elementary.elm_genlist_item_selected_get(Handle);
86 Interop.Elementary.elm_genlist_item_selected_set(Handle, value);
91 /// Gets or sets whether a given genlist item is expanded.
93 /// <since_tizen> preview </since_tizen>
94 [Obsolete("This has been deprecated in API12")]
95 public bool IsExpanded
99 return Interop.Elementary.elm_genlist_item_expanded_get(Handle);
103 Interop.Elementary.elm_genlist_item_expanded_set(Handle, value);
108 /// Updates the content of an item.
109 /// This updates an item by calling all <see cref="GenItemClass"/> again to get the content, text, and states.
110 /// Use this when the original item data has changed and the changes are desired to reflect.
111 /// To update the already realized items, use <see cref="GenList.UpdateRealizedItems"/>.
113 /// <seealso cref="GenList.UpdateRealizedItems"/>
114 /// <since_tizen> preview </since_tizen>
115 [Obsolete("This has been deprecated in API12")]
116 public override void Update()
118 Interop.Elementary.elm_genlist_item_update(Handle);
122 /// Updates the part of an item.
123 /// This updates an item's part by calling the item's fetching functions again to get the contents, texts, and states.
124 /// Use this when the original item data has changed and the changes are desired to be reflected.
125 /// To update an item's all property, use <see cref="GenList.UpdateRealizedItems"/>.
127 /// <param name="part">The part could be "elm.text", "elm.swalllow.icon", "elm.swallow.end", "elm.swallow.content", and so on. It is also used for globbing to match '*', '?', and '.'. It can be used for updating multi-fields.</param>
128 /// <param name="type">The type of the item's part type.</param>
129 /// <seealso cref="GenList.UpdateRealizedItems"/>
130 /// <since_tizen> preview </since_tizen>
131 [Obsolete("This has been deprecated in API12")]
132 public void UpdateField(string part, GenListItemFieldType type)
134 Interop.Elementary.elm_genlist_item_fields_update(Handle, part, (uint)type);
138 /// Demotes an item to the end of the list.
140 /// <since_tizen> preview </since_tizen>
141 [Obsolete("This has been deprecated in API12")]
142 public void DemoteItem()
144 Interop.Elementary.elm_genlist_item_demote(Handle);
148 /// Gets or sets the genlist item's select mode.
150 /// <since_tizen> preview </since_tizen>
151 [Obsolete("This has been deprecated in API12")]
152 public override GenItemSelectionMode SelectionMode
156 return (GenItemSelectionMode)Interop.Elementary.elm_genlist_item_select_mode_get(Handle);
160 Interop.Elementary.elm_genlist_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value);
165 /// Gets the next item in a genlist widget's internal list of items.
167 /// <seealso cref="Previous"/>
168 /// <since_tizen> preview </since_tizen>
169 [Obsolete("This has been deprecated in API12")]
170 public GenListItem Next
174 IntPtr next = Interop.Elementary.elm_genlist_item_next_get(Handle);
175 if (next == IntPtr.Zero)
178 return GetItemByHandle(next) as GenListItem;
183 /// Gets the previous item in a genlist widget's internal list of items.
185 /// <seealso cref="Next"/>
186 /// <since_tizen> preview </since_tizen>
187 [Obsolete("This has been deprecated in API12")]
188 public GenListItem Previous
192 IntPtr prev = Interop.Elementary.elm_genlist_item_prev_get(Handle);
193 if (prev == IntPtr.Zero)
196 return GetItemByHandle(prev) as GenListItem;
201 /// Sets or gets the content to be shown in the tooltip item.
203 /// <since_tizen> preview </since_tizen>
204 [Obsolete("This has been deprecated in API12")]
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 public override string Cursor
210 return Interop.Elementary.elm_genlist_item_cursor_get(Handle);
214 if (!string.IsNullOrEmpty(value))
216 Interop.Elementary.elm_genlist_item_cursor_set(Handle, value);
220 Interop.Elementary.elm_genlist_item_cursor_unset(Handle);
226 /// Sets or gets the style for this item cursor.
228 /// <since_tizen> preview </since_tizen>
229 [Obsolete("This has been deprecated in API12")]
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 public override string CursorStyle
235 return Interop.Elementary.elm_genlist_item_cursor_style_get(Handle);
239 Interop.Elementary.elm_genlist_item_cursor_style_set(Handle, value);
244 /// Sets or gets the cursor engine only usage for this item cursor.
246 /// <since_tizen> preview </since_tizen>
247 [Obsolete("This has been deprecated in API12")]
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public override bool IsUseEngineCursor
253 return Interop.Elementary.elm_genlist_item_cursor_engine_only_get(Handle);
257 Interop.Elementary.elm_genlist_item_cursor_engine_only_set(Handle, value);
262 /// Sets the text to be shown in the genlist item.
264 /// <param name="tooltip">The text to set in the content.</param>
265 /// <since_tizen> preview </since_tizen>
266 [Obsolete("This has been deprecated in API12")]
267 public override void SetTooltipText(string tooltip)
269 Interop.Elementary.elm_genlist_item_tooltip_text_set(Handle, tooltip);
273 /// Unsets the tooltip from the item.
275 /// <since_tizen> preview </since_tizen>
276 [Obsolete("This has been deprecated in API12")]
277 public override void UnsetTooltip()
279 Interop.Elementary.elm_genlist_item_tooltip_unset(Handle);
283 /// Gets or sets the style of the given genlist item's tooltip.
285 /// <since_tizen> preview </since_tizen>
286 [Obsolete("This has been deprecated in API12")]
287 public override string TooltipStyle
291 return Interop.Elementary.elm_genlist_item_tooltip_style_get(Handle);
295 Interop.Elementary.elm_genlist_item_tooltip_style_set(Handle, value);
300 /// Gets or sets the disable size restrictions on an object's tooltip.
302 /// <since_tizen> preview </since_tizen>
303 [Obsolete("This has been deprecated in API12")]
304 public bool IsTooltipWindowMode
308 return Interop.Elementary.elm_genlist_item_tooltip_window_mode_get(Handle);
312 Interop.Elementary.elm_genlist_item_tooltip_window_mode_set(Handle, value);
317 /// Gets the index of the item. It is only valid, once displayed.
319 /// <since_tizen> preview </since_tizen>
320 [Obsolete("This has been deprecated in API12")]
325 return Interop.Elementary.elm_genlist_item_index_get(Handle);
330 /// Gets the depth of the expanded item.
332 /// <since_tizen> preview </since_tizen>
333 [Obsolete("This has been deprecated in API12")]
334 public int ExpandedItemDepth
338 return Interop.Elementary.elm_genlist_item_expanded_depth_get(Handle);
343 /// Remove all the subitems (children) of the given item.
346 /// This removes the items that are the children (and their descendants) of the given item.
348 /// <since_tizen> preview </since_tizen>
349 [Obsolete("This has been deprecated in API12")]
350 public void ClearSubitems()
352 Interop.Elementary.elm_genlist_item_subitems_clear(Handle);
356 /// Updates the item class of the item.
357 /// This sets another class of the item, changing the way that it is displayed. After changing the item class, <see cref="Update"/> is called on the item.
359 /// <param name="itemClass">The item class for the item.</param>
360 /// <param name="data">The data for the item.</param>
361 /// <since_tizen> preview </since_tizen>
362 [Obsolete("This has been deprecated in API12")]
363 public void UpdateItemClass(GenItemClass itemClass, object data)
366 ItemClass = itemClass;
367 Interop.Elementary.elm_genlist_item_item_class_update((IntPtr)Handle, itemClass.UnmanagedPtr);
371 /// Sets the content to be shown in the tooltip item.
373 /// <since_tizen> preview </since_tizen>
374 [Obsolete("This has been deprecated in API12")]
375 protected override void UpdateTooltipDelegate()
377 Interop.Elementary.elm_genlist_item_tooltip_content_cb_set(Handle,
378 TooltipContentDelegate != null ? _tooltipCb : null,