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 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::SetItemProvider() method.
45 class _OSP_EXPORT_ ITableViewItemProvider
49 * This polymorphic destructor should be overridden if required.@n
50 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
54 virtual ~ITableViewItemProvider(void) {}
57 * Gets the total number of items in the specified group.
61 * @return The total number of items
62 * @remarks This method must be implemented so that it returns the total number of items for the specified group in the TableView control.
64 virtual int GetItemCount(void) = 0;
67 * Creates the specified item.
71 * @return An item of the TableView
72 * @param[in] itemIndex The item index
73 * @param[in] itemWidth The width of the item
75 * - An application that uses the TableView control must implement this method.
76 * - This method is expected to return an item that is allocated on a heap memory.
77 * - The returned item can be a %TableViewItem or a class derived from TableViewItem.
78 * - The returned item should not be a null pointer.
79 * - Note that when the item is not required, the %TableView control calls ITableViewItemProvider::DeleteItem(),
80 * allowing the application to deallocate the item.
83 virtual TableViewItem* CreateItem(int itemIndex, int itemWidth) = 0;
86 * Deletes the specified item.
90 * @return @c true if the item is deallocated by this method, @n
92 * @param[in] itemIndex The item index
93 * @param[in] pItem The pointer to TableViewItem to delete
95 * - An application that uses the TableView control must implement this method.
96 * - Using this method, an application can deallocate the item.
97 * - If the application deallocates the item, this method must return @c true. This notifies the %TableView not to release the
98 * item. Otherwise, the item is deallocated by the %TableView.
101 virtual bool DeleteItem(int itemIndex, TableViewItem* pItem) = 0;
104 * Updates the specified item.
108 * @param[in] itemIndex The item index
109 * @param[in] pItem The pointer to TableViewItem to update
111 * - An application that uses the TableView control must implement this method.
112 * - This method is called when the modification of an item is requested.
113 * - The application can change @c pItem in this method, but should not keep @c pItem for later use.
115 virtual void UpdateItem(int itemIndex, TableViewItem* pItem) = 0;
118 * Gets the default height of an item.
122 * @return The default height of an item
123 * @remarks This method must be implemented so that it returns the default height of items in the TableView control.
125 virtual int GetDefaultItemHeight(void) = 0;
129 // This method is for internal use only. Using this method can cause behavioral, security-related,
130 // and consistency-related issues in the application.
132 // This method is reserved and may change its name at any time without prior notice.
136 virtual void ITableViewItemProvider_Reserved1(void) {}
139 // This method is for internal use only. Using this method can cause behavioral, security-related,
140 // and consistency-related issues in the application.
142 // This method is reserved and may change its name at any time without prior notice.
146 virtual void ITableViewItemProvider_Reserved2(void) {}
149 // This method is for internal use only. Using this method can cause behavioral, security-related,
150 // and consistency-related issues in the application.
152 // This method is reserved and may change its name at any time without prior notice.
156 virtual void ITableViewItemProvider_Reserved3(void) {}
157 }; // ITableViewItemProvider
159 }}} // Tizen::Ui::Controls
161 #endif // _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_H_