From: Qian Sui Date: Fri, 17 Mar 2017 02:28:21 +0000 (+0800) Subject: [GenGrid|GenGridItem|GenItem|GenItemClass]Add Comments. X-Git-Tag: submit/trunk/20170823.075128~110^2~135^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5569029a3b742c4b47336842c5040c9828316eb2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [GenGrid|GenGridItem|GenItem|GenItemClass]Add Comments. Change-Id: Ie9b8f87b646aa3ab0d2099ca6eff05c9a6d0b5dc Signed-off-by: Qian Sui --- diff --git a/src/ElmSharp/ElmSharp/GenGrid.cs b/src/ElmSharp/ElmSharp/GenGrid.cs old mode 100644 new mode 100755 index fe7b2d0..2d22658 --- a/src/ElmSharp/ElmSharp/GenGrid.cs +++ b/src/ElmSharp/ElmSharp/GenGrid.cs @@ -19,16 +19,43 @@ using System.Collections.Generic; namespace ElmSharp { + /// + /// Enumeration for setting selection mode for GenGird. + /// public enum GenGridSelectionMode { + /// + /// The item will only call their selection func and callback when first becoming selected. + /// Any further clicks will do nothing, unless you set Always select mode. + /// Default = 0, + /// + /// This means that, even if selected, every click will make the selected callbacks be called. + /// Always, + /// + /// This will turn off the ability to select the item entirely and they will neither appear selected nor call selected callback functions. + /// None, + /// + /// This will apply no-finger-size rule with DisplayOnly. + /// No-finger-size rule makes an item can be smaller than lower limit. + /// Clickable objects should be bigger than human touch point device (your finger) for some touch or small screen devices. + /// So it is enabled, the item can be shrink than predefined finger-size value. And the item will be updated. + /// DisplayOnly, } + /// + /// It inherits System.EventArgs. + /// It contains Item which is type. + /// All events of GenGrid contain GenGridItemEventArgs as a parameter. + /// public class GenGridItemEventArgs : EventArgs { + /// + /// Gets or sets GenGrid item.The return type is . + /// public GenGridItem Item { get; set; } internal static GenGridItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) @@ -38,6 +65,12 @@ namespace ElmSharp } } + /// + /// It inherits . + /// The GenGrid is a widget that aims to position objects in a grid layout while actually creating and rendering only the visible ones. + /// It has two direction in which a given GenGrid widget expands while placing its items, horizontal and vertical. + /// The GenGrid items are represented through definition field details. + /// public class GenGrid : Layout { HashSet _children = new HashSet(); @@ -52,21 +85,65 @@ namespace ElmSharp SmartEvent _unrealized; SmartEvent _longpressed; + /// + /// Creates and initializes a new instance of the GenGrid class. + /// + /// The parent is a given container which will be attached by GenGrid as a child. It's type. public GenGrid(EvasObject parent) : base(parent) { InitializeSmartEvent(); } + /// + /// ItemSelected is raised when a new gengrid item is selected. + /// public event EventHandler ItemSelected; + + /// + /// ItemUnselected is raised when the gengrid item is Unselected. + /// public event EventHandler ItemUnselected; + + /// + /// ItemPressed is raised when a new gengrid item is pressed. + /// public event EventHandler ItemPressed; + + /// + /// ItemReleased is raised when a new gengrid item is released. + /// public event EventHandler ItemReleased; + + /// + /// ItemActivated is raised when a new gengrid item is double clicked or pressed (enter|return|spacebar). + /// public event EventHandler ItemActivated; + + /// + /// ItemDoubleClicked is raised when a new gengrid item is double clicked. + /// public event EventHandler ItemDoubleClicked; + + /// + /// ItemRealized is raised when a gengrid item is implementing through . + /// public event EventHandler ItemRealized; + + /// + /// ItemUnrealized is raised when the gengrid item is deleted. + /// public event EventHandler ItemUnrealized; + + /// + /// ItemLongPressed is raised when a gengrid item is pressed for a certain amount of time. By default it's 1 second. + /// public event EventHandler ItemLongPressed; + /// + /// Gets or sets the item's grid alignment along x-axis within a given gengrid widget. + /// The range is less than or equal to 1,and greater than or equal to 0. + /// By default, value is 0.5, meaning that the gengrid has its items grid placed exactly in the middle along x-axis. + /// public double ItemAlignmentX { get @@ -82,6 +159,11 @@ namespace ElmSharp } } + /// + /// Gets or sets the item's grid alignment on y-axis within a given gengrid widget. + /// The range is less than or equal to 1, and greater than or equal to 0. + /// By default, value is 0.5, meaning that the gengrid has its items grid placed exactly in the middle along y-axis. + /// public double ItemAlignmentY { get @@ -97,6 +179,10 @@ namespace ElmSharp } } + /// + /// Gets or sets the manner in which the items grid is filled within a given gengrid widget. + /// It is filled if true, otherwise false. + /// public bool FillItems { get @@ -109,6 +195,15 @@ namespace ElmSharp } } + /// + /// Gets or sets whether multi-selection is enabled or disabled for a given gengrid widget. + /// + /// + /// Multi-selection is the ability to have more than one item selected, on a given gengrid, simultaneously. + /// When it is enabled, a sequence of clicks on different items makes them all selected, progressively. + /// A click on an already selected item unselects it. If interacting via the keyboard, multi-selection is enabled while holding the "Shift" key. + /// By default, multi-selection is disabled. + /// public bool MultipleSelection { get @@ -121,6 +216,14 @@ namespace ElmSharp } } + /// + /// Gets or sets the width for the items of a given gengrid widget. + /// + /// + /// A gengrid, after creation, still has no information on the size to give to each of its cells. + /// The default width and height just have one finger wide. + /// Use this property to force a custom width for your items, making them as big as you wish. + /// public int ItemWidth { get @@ -137,6 +240,14 @@ namespace ElmSharp } } + /// + /// Gets or sets the height for the items of a given gengrid widget. + /// + /// + /// A gengrid, after creation, still has no information on the size to give to each of its cells. + /// The default width and height just have one finger wide. + /// Use this property to force a custom height for your items, making them as big as you wish. + /// public int ItemHeight { get @@ -152,6 +263,9 @@ namespace ElmSharp } } + /// + /// Gets or sets the gengrid select mode by . + /// public GenGridSelectionMode SelectionMode { get @@ -164,6 +278,13 @@ namespace ElmSharp } } + /// + /// Gets or sets the direction for which a given gengrid widget expands while placing its items. + /// + /// + /// If true, items are placed in columns from top to bottom and when the space for a column is filled, another one is started on the right, thus expanding the grid horizontally. + /// If false, items are placed in rows from left to right, and when the space for a row is filled, another one is started below, thus expanding the grid vertically. + /// public bool IsHorizontal { get @@ -176,6 +297,9 @@ namespace ElmSharp } } + /// + /// Gets or sets whether the gengrid items should be highlighted when an item is selected. + /// public bool IsHighlight { get @@ -188,6 +312,14 @@ namespace ElmSharp } } + /// + /// Appends a new item to a given gengrid widget. This adds an item to the end of the gengrid. + /// + /// The itemClass defines how to display the data. + /// The item data. + /// Return a gengrid item that contains data and itemClass. + /// + /// public GenGridItem Append(GenItemClass itemClass, object data) { GenGridItem item = new GenGridItem(data, itemClass); @@ -197,6 +329,14 @@ namespace ElmSharp return item; } + /// + /// Prepends a new item to a given gengrid widget. This adds an item to the beginning of the gengrid. + /// + /// The itemClass defines how to display the data. + /// The item data. + /// Return a gengrid item that contains data and itemClass. + /// + /// public GenGridItem Prepend(GenItemClass itemClass, object data) { GenGridItem item = new GenGridItem(data, itemClass); @@ -206,6 +346,15 @@ namespace ElmSharp return item; } + /// + /// Inserts an item before another in a gengrid widget. This inserts an item before another in the gengrid. + /// + /// The itemClass defines how to display the data. + /// The item data. + /// The item before which to place this new one. + /// Return a gengrid item that contains data and itemClass./> + /// + /// public GenGridItem InsertBefore(GenItemClass itemClass, object data, GenGridItem before) { GenGridItem item = new GenGridItem(data, itemClass); @@ -215,6 +364,17 @@ namespace ElmSharp return item; } + /// + /// Shows a given item to the visible area of a gengrid. + /// + /// The gengrid item to display. + /// The position of the item in the viewport. + /// The type of how to show the item. + /// + /// If animated is true, the gengrid shows item by scrolling if it's not fully visible. + /// If animated is false, the gengrid shows item by jumping if it's not fully visible. + /// + /// public void ScrollTo(GenGridItem item, ScrollToPosition position, bool animated) { if (animated) @@ -227,11 +387,26 @@ namespace ElmSharp } } + /// + /// Updates the contents of all the realized items. + /// This updates all realized items by calling all the again to get the content, text, and states. + /// Use this when the original item data has changed and the changes are desired to reflect. + /// + /// + /// to update just one item. + /// public void UpdateRealizedItems() { Interop.Elementary.elm_gengrid_realized_items_update(RealHandle); } + /// + /// Removes all items from a given gengrid widget. + /// This removes(and deletes) all items in obj, making it empty. + /// + /// + /// to delete just one item. + /// public void Clear() { Interop.Elementary.elm_gengrid_clear(RealHandle); diff --git a/src/ElmSharp/ElmSharp/GenGridItem.cs b/src/ElmSharp/ElmSharp/GenGridItem.cs old mode 100644 new mode 100755 index fc79f0b..1ce34cd --- a/src/ElmSharp/ElmSharp/GenGridItem.cs +++ b/src/ElmSharp/ElmSharp/GenGridItem.cs @@ -18,12 +18,25 @@ using System; namespace ElmSharp { + /// + /// It inherits . + /// A instance to the gengrid item added. + /// It contains Update() method to update a gengrid item which is given. + /// public class GenGridItem : GenItem { internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass) { } + /// + /// Gets or sets whether a given gengrid item is selected. + /// If one gengrid item is selected, any other previously selected items get unselected in favor of this new one. + /// + /// + /// If true, it is selected. + /// If false, it is unselected. + /// public override bool IsSelected { get @@ -36,6 +49,14 @@ namespace ElmSharp } } + /// + /// Updates the content of a given gengrid item. + /// This updates an item by calling all the genitem class functions again to get the content, text, and states. + /// Use this when the original item data has changed and you want the changes to reflect. + /// + /// + /// to update the contents of all the realized items. + /// public override void Update() { Interop.Elementary.elm_gengrid_item_update(Handle); diff --git a/src/ElmSharp/ElmSharp/GenItem.cs b/src/ElmSharp/ElmSharp/GenItem.cs old mode 100644 new mode 100755 index e6f6c9d..3ac0335 --- a/src/ElmSharp/ElmSharp/GenItem.cs +++ b/src/ElmSharp/ElmSharp/GenItem.cs @@ -18,6 +18,11 @@ using System; namespace ElmSharp { + /// + /// It inherits . + /// A base class for and . + /// It contains genitem class and data to display data. + /// public abstract class GenItem : ItemObject { internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero) @@ -26,10 +31,29 @@ namespace ElmSharp ItemClass = itemClass; } + /// + /// Gets the item class that defines how to display data. It returns type. + /// public GenItemClass ItemClass { get; protected set; } + + /// + /// Gets item data that is added through calling , or methods. + /// public object Data { get; protected set; } + + /// + /// It's a abstract property. It's implemented by and . + /// public abstract bool IsSelected { get; set; } + + /// + /// It's a abstract method. It's implemented by and . + /// public abstract void Update(); + + /// + /// The override method for delete item class and item data. It's called when the item is deleting. + /// protected override void OnInvalidate() { ItemClass?.SendItemDeleted(Data); diff --git a/src/ElmSharp/ElmSharp/GenItemClass.cs b/src/ElmSharp/ElmSharp/GenItemClass.cs old mode 100644 new mode 100755 index 0ece261..d0343cb --- a/src/ElmSharp/ElmSharp/GenItemClass.cs +++ b/src/ElmSharp/ElmSharp/GenItemClass.cs @@ -20,18 +20,53 @@ using System.Runtime.InteropServices; namespace ElmSharp { + /// + /// It represents the GenGrid or GenList item class definition field details. + /// It has some display styles, such as "default", "full" and "group_index". + /// public class GenItemClass : IDisposable { private static Dictionary s_HandleToEvasObject = new Dictionary(); + + /// + /// The delegate to define . + /// + /// The item data. + /// The part where the data should be shown. + /// Return string that should be shown. public delegate string GetTextDelegate(object data, string part); + + /// + /// The delegate to define . + /// + /// The item data. + /// The part where the data should be shown. + /// Return content that should be shown. public delegate EvasObject GetContentDelegate(object data, string part); + + /// + /// The delegate to define . + /// + /// The item data. public delegate void DeleteDelegate(object data); + + /// + /// The delegate to define . + /// + /// The item data. + /// The part where the data should be shown. + /// The content has been added in gengrid. + /// Return content that should be shown. public delegate EvasObject GetReusableContentDelegate(object data, string part, EvasObject old); private ItemClass _itemClass; private IntPtr _unmanagedPtr = IntPtr.Zero; private string _style; + /// + /// Creates and initializes a new instance of the GenItemClass. + /// + /// The item display style. public GenItemClass(string style) { _style = style; @@ -52,10 +87,33 @@ namespace ElmSharp Dispose(false); } + /// + /// Gets the item style. + /// public string ItemStyle { get { return _style; } } + + /// + /// Gets or sets the callback that defines how to display item text. + /// If get, return . + /// public GetTextDelegate GetTextHandler { get; set; } + + /// + /// Gets or sets the callback that defines how to display item content. + /// If get, return . + /// public GetContentDelegate GetContentHandler { get; set; } + + /// + /// Gets or sets the callback that defines how to delete item text and content. + /// If get, return . + /// public DeleteDelegate DeleteHandler { get; set; } + + /// + /// Gets or sets the callback that defines how to reuse item content. + /// If get, return . + /// public GetReusableContentDelegate ReusableContentHandler { get; set; } internal IntPtr UnmanagedPtr @@ -80,9 +138,6 @@ namespace ElmSharp } } - /// - /// Releases all resources used by the class. - /// public void Dispose() { Dispose(true);