2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrlIIconListViewItemProvider.h
20 * @brief This is the header file for the %IIconListViewItemProvider interface.
22 * This header file contains the declarations of the %IIconListViewItemProvider interface. @n
23 * If the event is generated, a method of this interface is called. @n
24 * So, if applications performs tasks related to list events, use the methods of this interface.
27 #ifndef _FUI_CTRL_IICON_LIST_VIEW_ITEM_PROVIDER_H_
28 #define _FUI_CTRL_IICON_LIST_VIEW_ITEM_PROVIDER_H_
30 #include <FUiCtrlIconListViewItem.h>
32 namespace Tizen { namespace Ui { namespace Controls
38 * @interface IIconListViewItemProvider
39 * @brief This interface implements the provider for events on %IconListView.
43 * The %IIconListViewItemProvider interface is the interface for handling IconListView items.
44 * The class that handles list items implements this interface, and the instance created using the IconListView's Construct()
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
49 class _OSP_EXPORT_ IIconListViewItemProvider
54 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
58 virtual ~IIconListViewItemProvider(void) {}
61 * Called when the IconListView is about to be drawn and requests the listener to set the number of total items.
65 * @return The item count of the IconListView
66 * @remarks Applications which use IconListView must implement this method. This method is expected to return the number of total items in the
69 virtual int GetItemCount(void) = 0;
72 * Called when items need to be loaded.
76 * @return The item of the IconListView
77 * @param[in] index The index of the item
78 * @remarks Applications which use IconListView must implement this method. This method is expected to return an item which is allocated in a heap
79 * memory. The returned item can be IconListViewItem. Note that when the item becomes unnecessary, the %IconListView calls
80 * IIconListViewItemProvider::DeleteItem() and applications is in charge of deallocating the item.
84 virtual Tizen::Ui::Controls::IconListViewItem* CreateItem(int index) = 0;
87 * Called when an item becomes no longer used by the IconListView.
91 * @return @c true if the item is deallocated by this method, @n
94 * @param[in] index The index of the item
95 * @param[in] pItem The pointer to the item to be deleted
97 * @remark Applications which use IconListView must implement this method. In this method, the applications have the chance of deallocating the
98 * item. If the application deallocates the item, this method must return @c true, notifying the %IconListView not to free the item.
99 * Otherwise, the item will be deallocated by the %IconListView.
103 virtual bool DeleteItem(int index, Tizen::Ui::Controls::IconListViewItem* pItem) = 0;
106 // Following methods are reserved and may change its name at any time without prior notice.
107 virtual void IconListViewItemProvider_Reserved1(void) {}
108 virtual void IconListViewItemProvider_Reserved2(void) {}
109 virtual void IconListViewItemProvider_Reserved3(void) {}
110 }; // IIconListViewItemProvider
112 }}} // Tizen::Ui::Controls
114 #endif // _FUI_CTRL_IICON_LIST_VIEW_ITEM_PROVIDER_H_