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 /// A instance to the gengrid item added.
25 /// It contains Update() method to update a gengrid item which is given.
27 public class GenGridItem : GenItem
29 internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass)
34 /// Gets or sets whether a given gengrid item is selected.
35 /// If one gengrid item is selected, any other previously selected items get unselected in favor of this new one.
38 /// If true, it is selected.
39 /// If false, it is unselected.
41 public override bool IsSelected
45 return Interop.Elementary.elm_gengrid_item_selected_get(Handle);
49 Interop.Elementary.elm_gengrid_item_selected_set(Handle, value);
54 /// Sets or gets the cursor to be shown when mouse is over the gengrid item.
56 [EditorBrowsable(EditorBrowsableState.Never)]
57 public override string Cursor
61 return Interop.Elementary.elm_gengrid_item_cursor_get(Handle);
65 if (!string.IsNullOrEmpty(value))
67 Interop.Elementary.elm_gengrid_item_cursor_set(Handle, value);
71 Interop.Elementary.elm_gengrid_item_cursor_unset(Handle);
77 /// Sets or gets the style for this item cursor.
79 [EditorBrowsable(EditorBrowsableState.Never)]
80 public override string CursorStyle
84 return Interop.Elementary.elm_gengrid_item_cursor_style_get(Handle);
88 Interop.Elementary.elm_gengrid_item_cursor_style_set(Handle, value);
93 /// Sets or gets the cursor engine only usage for this item cursor.
95 [EditorBrowsable(EditorBrowsableState.Never)]
96 public override bool IsUseEngineCursor
100 return Interop.Elementary.elm_gengrid_item_cursor_engine_only_get(Handle);
104 Interop.Elementary.elm_gengrid_item_cursor_engine_only_set(Handle, value);
109 /// Sets or gets or sets the style of given gengrid item's tooltip.
111 public override string TooltipStyle
115 return Interop.Elementary.elm_gengrid_item_tooltip_style_get(Handle);
119 Interop.Elementary.elm_gengrid_item_tooltip_style_set(Handle, value);
124 /// Get the gengrid item's select mode.
126 public override GenItemSelectionMode SelectionMode
130 return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_item_select_mode_get(Handle);
134 Interop.Elementary.elm_gengrid_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value);
139 /// Gets or sets gengrid item's row position, relative to the whole gengrid's grid area.
146 Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
152 /// Gets or sets gengrid item's column position, relative to the whole gengrid's grid area.
159 Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
165 /// Set the text to be shown in the gengrid item.
167 /// <param name="tooltip">The text to set.</param>
168 public override void SetTooltipText(string tooltip)
170 Interop.Elementary.elm_gengrid_item_tooltip_text_set(Handle, tooltip);
174 /// Unset tooltip from item.
176 public override void UnsetTooltip()
178 Interop.Elementary.elm_gengrid_item_tooltip_unset(Handle);
182 /// Updates the content of a given gengrid item.
183 /// This updates an item by calling all the genitem class functions again to get the content, text, and states.
184 /// Use this when the original item data has changed and you want the changes to reflect.
187 /// <see cref="GenGrid.UpdateRealizedItems"/> to update the contents of all the realized items.
189 public override void Update()
191 Interop.Elementary.elm_gengrid_item_update(Handle);
195 /// Set the content to be shown in the tooltip item.
197 protected override void UpdateTooltipDelegate()
199 Interop.Elementary.elm_gengrid_item_tooltip_content_cb_set(Handle,
200 TooltipContentDelegate != null ? _tooltipCb : null,