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 FUiCtrlITableViewItemProvider.h
20 * @brief This is the header file for the %ITableViewItemProvider interface.
22 * This header file contains the declarations of the %ITableViewItemProvider interface.
23 * If the event is generated, a method of this interface is called.
24 * So, if applications do jobs related to item events, use the methods of this interface.
28 #ifndef _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_H_
29 #define _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_H_
31 namespace Tizen { namespace Ui { namespace Controls
36 * @interface ITableViewItemProvider
37 * @brief This interface implements the listener for events on TableView.
41 * The %ITableViewItemProvider interface implements an item provider which generates items for TableView. %TableView calls the item provider
42 * to request an item which is about to be displayed on a screen. Applications which use %TableView must implement the item provider.
43 * The class is registered with a %TableView, using the TableView's SetSimpleStyleItemProvider() method.
45 class _OSP_EXPORT_ ITableViewItemProvider
49 * 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.
53 virtual ~ITableViewItemProvider(void) {}
56 * Gets the total number of items in the specified group.
60 * @return The total number of items
61 * @remarks This method must be implemented so that it returns the total number of items for the specified group in the TableView control.
63 virtual int GetItemCount(void) = 0;
66 * Creates the specified item.
70 * @return An item of the TableView
71 * @param[in] itemIndex The item index
72 * @param[in] itemWidth The width of the item
73 * @remarks An application that uses the TableView control must implement this method.
74 * This method is expected to return an item that is allocated on a heap memory.
75 * The returned item can be a %TableViewItem or a class derived from TableViewItem.
76 * Note that when the item is not required, the %TableView control calls ITableViewItemProvider::DeleteItem(), allowing the application to deallocate the item.
79 virtual TableViewItem* CreateItem(int itemIndex, int itemWidth) = 0;
82 * Deletes the specified item.
86 * @return @c true if the item is deallocated by this method, @n
88 * @param[in] itemIndex The item index
89 * @param[in] pItem The pointer to TableViewItem to delete
90 * @remarks An application that uses the TableView control must implement this method.
91 * Using this method, an application can deallocate the item.
92 * If the application deallocates the item, this method must return @c true. This notifies the %TableView not to release the
93 * item. Otherwise, the item is deallocated by the %TableView.
96 virtual bool DeleteItem(int itemIndex, TableViewItem* pItem) = 0;
99 * Updates the specified item.
103 * @param[in] itemIndex The item index
104 * @param[in] pItem The pointer to TableViewItem to update
105 * @remarks An application that uses the TableView control must implement this method.
106 * This method is called when the modification of an item is requested.
107 * The application can change @c pItem in this method, but should not keep @c pItem for later use.
109 virtual void UpdateItem(int itemIndex, TableViewItem* pItem) = 0;
112 * Gets the default height of an item.
116 * @return The default height of an item
117 * @remarks This method must be implemented so that it returns the default height of items in the TableView control.
119 virtual int GetDefaultItemHeight(void) = 0;
123 // This method is for internal use only. Using this method can cause behavioral, security-related,
124 // and consistency-related issues in the application.
126 // The following method is reserved, and its name can be changed at any time without prior notice.
130 virtual void ITableViewItemProvider_Reserved1(void) {}
133 // This method is for internal use only. Using this method can cause behavioral, security-related,
134 // and consistency-related issues in the application.
136 // The following method is reserved, and its name can be changed at any time without prior notice.
140 virtual void ITableViewItemProvider_Reserved2(void) {}
143 // This method is for internal use only. Using this method can cause behavioral, security-related,
144 // and consistency-related issues in the application.
146 // The following method is reserved, and its name can be changed at any time without prior notice.
150 virtual void ITableViewItemProvider_Reserved3(void) {}
151 }; // ITableViewItemProvider
153 }}} // Tizen::Ui::Controls
155 #endif // _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_H_