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 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 an event is generated, a method of this interface is called. @n
24 * Applications that perform tasks related to the list events call 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::Construct(const Tizen::Graphics::Rectangle&, const Tizen::Graphics::Dimension&, IconListViewStyle, IconListViewScrollDirection, IconListViewScrollStyle) method.
46 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
48 class _OSP_EXPORT_ IIconListViewItemProvider
53 * 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.
57 virtual ~IIconListViewItemProvider(void) {}
60 * Called when the IconListView is about to be drawn and requests the listener to set the number of total items.
64 * @return The item count of the IconListView
65 * @remarks Applications that use IconListView must implement this method. This method is expected to return the number of total items in the
68 virtual int GetItemCount(void) = 0;
71 * Called when items need to be loaded.
75 * @return The item of the IconListView
76 * @param[in] index The index of the item
77 * @remarks Applications that use IconListView must implement this method. This method is expected to return an item that is allocated in a heap
78 * memory. The returned item can be IconListViewItem. Note that, when the item becomes unnecessary, the %IconListView calls
79 * DeleteItem() and applications are in charge of deallocating the item. @n
80 * The returned item should not be a null pointer.
83 virtual Tizen::Ui::Controls::IconListViewItem* CreateItem(int index) = 0;
86 * Called when an item is no longer used by the IconListView.
90 * @return @c true if the item is deallocated by this method, @n
93 * @param[in] index The index of the item
94 * @param[in] pItem The pointer to the item to delete
96 * @remarks Applications that use IconListView must implement this method. In this method, the applications have the chance of deallocating the
97 * item. If the application deallocates the item, this method must return @c true, notifying the %IconListView not to free the item.
98 * Otherwise, the item will be deallocated by the %IconListView.
102 virtual bool DeleteItem(int index, Tizen::Ui::Controls::IconListViewItem* pItem) = 0;
105 // The following methods are reserved and may change its name at any time without prior notice.
106 virtual void IconListViewItemProvider_Reserved1(void) {}
107 virtual void IconListViewItemProvider_Reserved2(void) {}
108 virtual void IconListViewItemProvider_Reserved3(void) {}
109 }; // IIconListViewItemProvider
111 }}} // Tizen::Ui::Controls
113 #endif // _FUI_CTRL_IICON_LIST_VIEW_ITEM_PROVIDER_H_