diff options
Diffstat (limited to 'ElmSharp/ElmSharp/GenItem.cs')
-rw-r--r--[-rwxr-xr-x] | ElmSharp/ElmSharp/GenItem.cs | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/ElmSharp/ElmSharp/GenItem.cs b/ElmSharp/ElmSharp/GenItem.cs index 3ac0335..ac609b0 100755..100644 --- a/ElmSharp/ElmSharp/GenItem.cs +++ b/ElmSharp/ElmSharp/GenItem.cs @@ -18,6 +18,29 @@ using System; namespace ElmSharp { + public enum GenItemSelectionMode + { + /// <summary> + /// Default select mode. + /// </summary> + Default, + + /// <summary> + /// Always select mode. + /// </summary> + Always, + + /// <summary> + /// No select mode. + /// </summary> + None, + + /// <summary> + /// No select mode with no finger size rule. + /// </summary> + DisplayOnly + } + /// <summary> /// It inherits <see cref="ItemObject"/>. /// A base class for <see cref="GenGridItem"/> and <see cref="GenListItem"/>. @@ -25,10 +48,19 @@ namespace ElmSharp /// </summary> public abstract class GenItem : ItemObject { + internal Interop.Elementary.Elm_Tooltip_Item_Content_Cb _tooltipCb; + GetTooltipContentDelegate _tooltipContentDelegate = null; + + /// <summary> + /// The delegate returning the tooltip contents. + /// </summary> + public delegate EvasObject GetTooltipContentDelegate(); + internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero) { Data = data; ItemClass = itemClass; + _tooltipCb = (d, obj, tooltip, item) => { return TooltipContentDelegate(); }; } /// <summary> @@ -37,6 +69,29 @@ namespace ElmSharp public GenItemClass ItemClass { get; protected set; } /// <summary> + /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipContent"/> and <see cref="GenListItem.TooltipContent"/>. + /// </summary> + public GetTooltipContentDelegate TooltipContentDelegate + { + get + { + return _tooltipContentDelegate; + } + set + { + _tooltipContentDelegate = value; + UpdateTooltipDelegate(); + } + } + + public abstract GenItemSelectionMode SelectionMode { get; set; } + + public abstract string Cursor { get; set; } + public abstract string CursorStyle { get; set; } + + public abstract bool IsUseEngineCursor { get; set; } + + /// <summary> /// 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. /// </summary> public object Data { get; protected set; } @@ -47,6 +102,14 @@ namespace ElmSharp public abstract bool IsSelected { get; set; } /// <summary> + /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipStyle"/> and <see cref="GenListItem.TooltipStyle"/>. + /// </summary> + public abstract string TooltipStyle { get; set; } + + public abstract void SetTooltipText(string tooltip); + public abstract void UnsetTooltip(); + + /// <summary> /// It's a abstract method. It's implemented by <see cref="GenGridItem.Update"/> and <see cref="GenListItem.Update"/>. /// </summary> public abstract void Update(); @@ -60,5 +123,7 @@ namespace ElmSharp Data = null; ItemClass = null; } + + protected abstract void UpdateTooltipDelegate(); } -} +}
\ No newline at end of file |