2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 FUiCtrlIListViewItemProvider.h
20 * @brief This is the header file for the %IListViewItemProvider interface.
22 * This header file contains the declarations of the %IListViewItemProvider interface. @n
23 * If the event is generated, a method of this interface is called. @n
24 * So, if applications do jobs related to item events, use the methods of this interface.
27 #ifndef _FUI_CTRL_ILIST_VIEW_ITEM_PROVIDER_H_
28 #define _FUI_CTRL_ILIST_VIEW_ITEM_PROVIDER_H_
30 #include <FUiCtrlListItemBase.h>
32 namespace Tizen {namespace Ui { namespace Controls
36 * @interface IListViewItemProvider
37 * @brief This interface implements the listener for events on %ListView.
41 * The %IListViewItemProvider interface is the interface for handling ListView items.
42 * The class that handles list items implements this interface, and the instance created using the ListView's Construct() method.
44 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
46 class _OSP_EXPORT_ IListViewItemProvider
51 * This polymorphic destructor should be overridden if required. @n
52 * This way, the destructors of the derived classes are called
53 * when the destructor of this interface is called.
57 virtual ~IListViewItemProvider(void) {}
60 * Gets the total number of items in a specified group.
64 * @return The count of all items of the list
65 * @remarks This method must be implemented so that it returns the number of total items in the list.
68 virtual int GetItemCount(void) = 0;
71 * Creates a specified item.
75 * @return An item of the ListView
76 * @param[in] index The index of the item
77 * @param[in] itemWidth The width of the item
79 * - The applications that use ListView must implement this method.
80 * - This method is expected to return an item which is allocated in a heap memory.
81 * - The returned item can be a SimpleItem or CustomItem.
82 * - The returned item should not be a null pointer.
83 * - Note that when the item becomes unnecessary, the ListView calls IListViewItemProvider::DeleteItem() and the application is in charge of
84 * deallocating the item.
87 virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth) = 0;
90 * Deletes a specified item.
94 * @return @c true, if the item is deallocated by this method, @n
96 * @param[in] index The index of the item
97 * @param[in] pItem The pointer to the item to delete
98 * @param[in] itemWidth The width of the item
100 * - Applications which use ListView must implement this method.
101 * - In this method, the applications have the chance of deallocating the item.
102 * - If the application deallocates the item, this method returns @c true, notifying the %ListView not to free the item. @n
103 * Otherwise, the item will be deallocated by %ListView.
106 virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth) = 0;
110 // The following methods are reserved and may change its name at any time without prior notice.
112 virtual void IListViewItemProvider_Reserved1(void) {}
113 virtual void IListViewItemProvider_Reserved2(void) {}
114 virtual void IListViewItemProvider_Reserved3(void) {}
115 }; // IListViewItemProvider
117 }}} // Tizen::Ui::Controls
119 #endif // _FUI_CTRL_ILIST_VIEW_ITEM_PROVIDER_H_