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 /// It inherits <see cref="GenItem"/>.
24 /// An instance to the gengrid item is added.
25 /// It contains the Update() method to update a gengrid item which is given.
27 /// <since_tizen> preview </since_tizen>
28 public class GenGridItem : GenItem
30 internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass)
34 internal GenGridItem(object data, GenItemClass itemClass, EvasObject parent) : base(data, itemClass, parent)
39 /// Gets or sets whether a given gengrid item is selected.
40 /// If one gengrid item is selected, any other previously selected items get unselected in favor of this new one.
43 /// If true, it is selected.
44 /// If false, it is unselected.
46 /// <since_tizen> preview </since_tizen>
47 public override bool IsSelected
51 return Interop.Elementary.elm_gengrid_item_selected_get(Handle);
55 Interop.Elementary.elm_gengrid_item_selected_set(Handle, value);
60 /// Sets or gets the cursor to be shown when the mouse is over the gengrid item.
62 /// <since_tizen> preview </since_tizen>
63 [EditorBrowsable(EditorBrowsableState.Never)]
64 public override string Cursor
68 return Interop.Elementary.elm_gengrid_item_cursor_get(Handle);
72 if (!string.IsNullOrEmpty(value))
74 Interop.Elementary.elm_gengrid_item_cursor_set(Handle, value);
78 Interop.Elementary.elm_gengrid_item_cursor_unset(Handle);
84 /// Sets or gets the style for this item cursor.
86 /// <since_tizen> preview </since_tizen>
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 public override string CursorStyle
92 return Interop.Elementary.elm_gengrid_item_cursor_style_get(Handle);
96 Interop.Elementary.elm_gengrid_item_cursor_style_set(Handle, value);
101 /// Sets or gets the cursor engine only usage for this item cursor.
103 /// <since_tizen> preview </since_tizen>
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 public override bool IsUseEngineCursor
109 return Interop.Elementary.elm_gengrid_item_cursor_engine_only_get(Handle);
113 Interop.Elementary.elm_gengrid_item_cursor_engine_only_set(Handle, value);
118 /// Sets or gets, or sets the style of the given gengrid item's tooltip.
120 /// <since_tizen> preview </since_tizen>
121 public override string TooltipStyle
125 return Interop.Elementary.elm_gengrid_item_tooltip_style_get(Handle);
129 Interop.Elementary.elm_gengrid_item_tooltip_style_set(Handle, value);
134 /// Gets the gengrid item's select mode.
136 /// <since_tizen> preview </since_tizen>
137 public override GenItemSelectionMode SelectionMode
141 return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_item_select_mode_get(Handle);
145 Interop.Elementary.elm_gengrid_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value);
150 /// Gets or sets the gengrid item's row position, relative to the whole gengrid's grid area.
152 /// <since_tizen> preview </since_tizen>
158 Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
164 /// Gets or sets the gengrid item's column position, relative to the whole gengrid's grid area.
166 /// <since_tizen> preview </since_tizen>
172 Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
178 /// Sets the text to be shown in the gengrid item.
180 /// <param name="tooltip">The text to set.</param>
181 /// <since_tizen> preview </since_tizen>
182 public override void SetTooltipText(string tooltip)
184 Interop.Elementary.elm_gengrid_item_tooltip_text_set(Handle, tooltip);
188 /// Unsets the tooltip from item.
190 /// <since_tizen> preview </since_tizen>
191 public override void UnsetTooltip()
193 Interop.Elementary.elm_gengrid_item_tooltip_unset(Handle);
197 /// Updates the content of a given gengrid item.
198 /// This updates an item by calling all the GenItem class functions again to get the content, text, and states.
199 /// Use this when the original item data has changed and you want the changes to reflect.
202 /// <see cref="GenGrid.UpdateRealizedItems"/> to update the contents of all the realized items.
204 /// <since_tizen> preview </since_tizen>
205 public override void Update()
207 Interop.Elementary.elm_gengrid_item_update(Handle);
211 /// Sets the content to be shown in the tooltip item.
213 /// <since_tizen> preview </since_tizen>
214 protected override void UpdateTooltipDelegate()
216 Interop.Elementary.elm_gengrid_item_tooltip_content_cb_set(Handle,
217 TooltipContentDelegate != null ? _tooltipCb : null,