Beispiel #1
0
        /// <summary>
        /// Inserts an item in a GenList widget using a user-defined sort function.
        /// </summary>
        /// <param name="itemClass">The itemClass defines how to display the data.</param>
        /// <param name="data">The item data.</param>
        /// <param name="comparison">User-defined comparison function that defines the sort order based on the genlist item and its data.</param>
        /// <param name="type">The genlist item type.</param>
        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
        /// <returns>Return a genlist item that contains the data and itemClass.</returns>
        /// <since_tizen> preview </since_tizen>
        public GenListItem InsertSorted(GenItemClass itemClass, object data, Comparison <object> comparison, GenListItemType type, GenListItem parent)
        {
            GenListItem item = new GenListItem(data, itemClass);

            Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
            {
                GenListItem first  = (ItemObject.GetItemByHandle(handle1) as GenListItem) ?? item;
                GenListItem second = (ItemObject.GetItemByHandle(handle2) as GenListItem) ?? item;
                return(comparison(first.Data, second.Data));
            };

            IntPtr handle = Interop.Elementary.elm_genlist_item_sorted_insert(
                RealHandle,             // genlist handle
                itemClass.UnmanagedPtr, // item clas
                (IntPtr)item.Id,        // data
                parent,                 // parent
                (int)type,              // item type
                compareCallback,        // compare callback
                null,                   //select callback
                (IntPtr)item.Id);       // callback data

            item.Handle = handle;
            AddInternal(item);
            return(item);
        }
Beispiel #2
0
        /// <summary>
        /// Prepends a new item with <see cref="GenListItemType"/> to the beginning of a given GenList widget or the beginning of the children list, if the parent is given.
        /// </summary>
        /// <param name="itemClass">The itemClass defines how to display the data.</param>
        /// <param name="data">The item data.</param>
        /// <param name="type">The genlist item type.</param>
        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
        /// <returns>Return a newly added genlist item that contains the data and itemClass.</returns>
        /// <since_tizen> preview </since_tizen>
        public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
        {
            GenListItem item = new GenListItem(data, itemClass, this);

            item.Handle = Interop.Elementary.elm_genlist_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
            AddInternal(item);
            return(item);
        }
Beispiel #3
0
        /// <summary>
        /// Inserts an item after another in a GenGrid widget. This inserts an item after another in the gengrid.
        /// </summary>
        /// <param name="itemClass">The itemClass defines how to display the data.</param>
        /// <param name="data">The item data.</param>
        /// <param name="after">The item after which to place this new one.</param>
        /// <returns>Return a gengrid item that contains the data and itemClass.</returns>
        /// <seealso cref="GenItemClass"/>
        /// <seealso cref="GenGridItem"/>
        /// <since_tizen> preview </since_tizen>
        public GenGridItem InsertAfter(GenItemClass itemClass, object data, GenGridItem after)
        {
            GenGridItem item = new GenGridItem(data, itemClass, this);

            item.Handle = Interop.Elementary.elm_gengrid_item_insert_after(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, after, null, (IntPtr)item.Id);
            AddInternal(item);
            return(item);
        }
Beispiel #4
0
        /// <summary>
        /// Prepends a new item to a given GenGrid widget. This adds an item to the beginning of the gengrid.
        /// </summary>
        /// <param name="itemClass">The itemClass defines how to display the data.</param>
        /// <param name="data">The item data.</param>
        /// <returns>Return a gengrid item that contains the data and itemClass.</returns>
        /// <seealso cref="GenItemClass"/>
        /// <seealso cref="GenGridItem"/>
        /// <since_tizen> preview </since_tizen>
        public GenGridItem Prepend(GenItemClass itemClass, object data)
        {
            GenGridItem item = new GenGridItem(data, itemClass, this);

            item.Handle = Interop.Elementary.elm_gengrid_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
            AddInternal(item);
            return(item);
        }
Beispiel #5
0
        /// <summary>
        /// Inserts an item before another in a GenGrid widget. This inserts an item before another in the gengrid.
        /// </summary>
        /// <param name="itemClass">The itemClass defines how to display the data.</param>
        /// <param name="data">The item data.</param>
        /// <param name="before">The item before which to place this new one.</param>
        /// <returns>Return a gengrid item that contains the data and itemClass.</returns>
        /// <seealso cref="GenItemClass"/>
        /// <seealso cref="GenGridItem"/>
        /// <since_tizen> preview </since_tizen>
        public GenGridItem InsertBefore(GenItemClass itemClass, object data, GenGridItem before)
        {
            GenGridItem item   = new GenGridItem(data, itemClass);
            IntPtr      handle = Interop.Elementary.elm_gengrid_item_insert_before(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, before, null, (IntPtr)item.Id);

            item.Handle = handle;
            AddInternal(item);
            return(item);
        }
Beispiel #6
0
        /// <summary>
        /// Inserts an item in a GenGrid widget using a user-defined sort function.
        /// </summary>
        /// <param name="itemClass">The itemClass defines how to display the data.</param>
        /// <param name="data">The item data.</param>
        /// <param name="comparison">User defined comparison function that defines the sort order based on the gengrid item and its data.</param>
        /// <returns>Return a gengrid item that contains the data and itemClass.</returns>
        /// <since_tizen> preview </since_tizen>
        public GenGridItem InsertSorted(GenItemClass itemClass, object data, Comparison <object> comparison)
        {
            GenGridItem item = new GenGridItem(data, itemClass, this);

            Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
            {
                GenGridItem first  = (ItemObject.GetItemByHandle(handle1) as GenGridItem) ?? item;
                GenGridItem second = (ItemObject.GetItemByHandle(handle2) as GenGridItem) ?? item;
                return(comparison(first.Data, second.Data));
            };

            item.Handle = Interop.Elementary.elm_gengrid_item_sorted_insert(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, compareCallback, null, (IntPtr)item.Id);
            AddInternal(item);
            return(item);
        }
Beispiel #7
0
        /// <summary>
        /// Inserts an item with <see cref="GenListItemType"/> after another item under a parent in a GenList widget.
        /// </summary>
        /// <param name="itemClass">The itemClass defines how to display the data.</param>
        /// <param name="data">The item data.</param>
        /// <param name="after">The item after which to place this new one.</param>
        /// <param name="type">The genlist item type.</param>
        /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
        /// <returns>Return a newly added genlist item that contains data and itemClass.</returns>
        /// <since_tizen> preview </since_tizen>
        public GenListItem InsertAfter(GenItemClass itemClass, object data, GenListItem after, GenListItemType type, GenListItem parent)
        {
            GenListItem item = new GenListItem(data, itemClass, this);

            // insert before the `before` list item
            item.Handle = Interop.Elementary.elm_genlist_item_insert_before(
                RealHandle,             // genlist handle
                itemClass.UnmanagedPtr, // item class
                (IntPtr)item.Id,        // data
                parent,                 // parent
                after,                  // after
                (int)type,              // item type
                null,                   // select callback
                (IntPtr)item.Id);       // callback data
            AddInternal(item);
            return(item);
        }
Beispiel #8
0
 /// <summary>
 /// Inserts an item with <see cref="GenListItemType"/> before another item in a GenList widget.
 /// It is the same tree level or group as the item before which it is inserted.
 /// </summary>
 /// <param name="itemClass">The itemClass defines how to display the data.</param>
 /// <param name="data">The item data.</param>
 /// <param name="before">The item before which to place this new one.</param>
 /// <param name="type">The genlist item type.</param>
 /// <returns>Return a newly added genlist item that contains data and itemClass.</returns>
 /// <since_tizen> preview </since_tizen>
 public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type)
 {
     return(InsertBefore(itemClass, data, before, type, null));
 }
Beispiel #9
0
 /// <summary>
 /// Inserts an item before another item in a genlist widget.
 /// It is the same tree level or group as the item before which it is inserted.????
 /// </summary>
 /// <param name="itemClass">The itemClass defines how to display the data.</param>
 /// <param name="data">The item data.</param>
 /// <param name="before">The item before which to place this new one.</param>
 /// <returns>Return a newly added genlist item that contains data and itemClass.</returns>
 /// <since_tizen> preview </since_tizen>
 public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before)
 {
     return(InsertBefore(itemClass, data, before, GenListItemType.Normal));
 }
Beispiel #10
0
 /// <summary>
 /// Prepends a new item with <see cref="GenListItemType"/> to the beginning of a given genlist widget.
 /// </summary>
 /// <param name="itemClass">The itemClass defines how to display the data.</param>
 /// <param name="data">The item data.</param>
 /// <param name="type">The genlist item type.</param>
 /// <returns>Return a newly added genlist item that contains data and itemClass.</returns>
 /// <since_tizen> preview </since_tizen>
 public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type)
 {
     return(Prepend(itemClass, data, type, null));
 }
Beispiel #11
0
 /// <summary>
 /// Prepends a new item to the beginning of a given GenList widget.
 /// </summary>
 /// <param name="itemClass">The itemClass defines how to display the data.</param>
 /// <param name="data">The item data.</param>
 /// <returns>Return a newly added genlist item that contains data and itemClass.</returns>
 /// <since_tizen> preview </since_tizen>
 public GenListItem Prepend(GenItemClass itemClass, object data)
 {
     return(Prepend(itemClass, data, GenListItemType.Normal));
 }
Beispiel #12
0
 internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass)
 {
 }
Beispiel #13
0
 internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero)
 {
     Data       = data;
     ItemClass  = itemClass;
     _tooltipCb = (d, obj, tooltip, item) => { return(TooltipContentDelegate()); };
 }
Beispiel #14
0
 internal GenGridItem(object data, GenItemClass itemClass, EvasObject parent) : base(data, itemClass, parent)
 {
 }
Beispiel #15
0
 /// <summary>
 /// Updates the item class of the item.
 /// This sets another class of the item, changing the way that it is displayed. After changing the item class, <see cref="Update"/> is called on the item.
 /// </summary>
 /// <param name="itemClass">The item class for the item.</param>
 /// <param name="data">The data for the item.</param>
 /// <since_tizen> preview </since_tizen>
 public void UpdateItemClass(GenItemClass itemClass, object data)
 {
     Data      = data;
     ItemClass = itemClass;
     Interop.Elementary.elm_genlist_item_item_class_update((IntPtr)Handle, itemClass.UnmanagedPtr);
 }