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.
22 /// Enumeration for select mode of GenItem.
24 public enum GenItemSelectionMode
27 /// Default select mode.
32 /// Always select mode.
42 /// No select mode with no finger size rule.
48 /// It inherits <see cref="ItemObject"/>.
49 /// A base class for <see cref="GenGridItem"/> and <see cref="GenListItem"/>.
50 /// It contains genitem class and data to display data.
52 public abstract class GenItem : ItemObject
54 internal Interop.Elementary.Elm_Tooltip_Item_Content_Cb _tooltipCb;
55 GetTooltipContentDelegate _tooltipContentDelegate = null;
58 /// The delegate returning the tooltip contents.
60 public delegate EvasObject GetTooltipContentDelegate();
62 internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero)
65 ItemClass = itemClass;
66 _tooltipCb = (d, obj, tooltip, item) => { return TooltipContentDelegate(); };
70 /// Gets the item class that defines how to display data. It returns <see cref="GenItemClass"/> type.
72 public GenItemClass ItemClass { get; protected set; }
75 /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipContent"/> and <see cref="GenListItem.TooltipContent"/>.
77 public GetTooltipContentDelegate TooltipContentDelegate
81 return _tooltipContentDelegate;
85 _tooltipContentDelegate = value;
86 UpdateTooltipDelegate();
90 public abstract GenItemSelectionMode SelectionMode { get; set; }
92 public abstract string Cursor { get; set; }
93 public abstract string CursorStyle { get; set; }
95 public abstract bool IsUseEngineCursor { get; set; }
98 /// Gets item data that is added through calling <see cref="GenGrid.Append(GenItemClass, object)"/>, <see cref="GenGrid.Prepend(GenItemClass, object)"/> or <see cref="GenGrid.InsertBefore(GenItemClass, object, GenGridItem)"/> methods.
100 public object Data { get; protected set; }
103 /// It's a abstract property. It's implemented by <see cref="GenGridItem.IsSelected"/> and <see cref="GenListItem.IsSelected"/>.
105 public abstract bool IsSelected { get; set; }
108 /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipStyle"/> and <see cref="GenListItem.TooltipStyle"/>.
110 public abstract string TooltipStyle { get; set; }
112 public abstract void SetTooltipText(string tooltip);
113 public abstract void UnsetTooltip();
116 /// It's a abstract method. It's implemented by <see cref="GenGridItem.Update"/> and <see cref="GenListItem.Update"/>.
118 public abstract void Update();
121 /// The override method for delete item class and item data. It's called when the item is deleting.
123 protected override void OnInvalidate()
125 ItemClass?.SendItemDeleted(Data);
130 protected abstract void UpdateTooltipDelegate();