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 FUiCtrlIGroupedTableViewItemProviderF.h
20 * @brief This is the header file for the %IGroupedTableViewItemProviderF interface.
22 * This header file contains the declarations of the %IGroupedTableViewItemProviderF 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.
27 #ifndef _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_
28 #define _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_
30 namespace Tizen { namespace Ui { namespace Controls
33 class TableViewGroupItem;
36 * @interface IGroupedTableViewItemProviderF
37 * @brief This interface implements the listener for events on GroupedTableView.
41 * The %IGroupedTableViewItemProviderF interface implements an item provider which generates items for GroupedTableView. %GroupedTableView calls the item provider
42 * to request an item which is about to be displayed on a screen. Applications which use %GroupedTableView must implement the item provider.
43 * The class is registered with a %GroupedTableView, using the GroupedTableView's SetGroupedStyleItemProvider() method.
45 class _OSP_EXPORT_ IGroupedTableViewItemProviderF
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 ~IGroupedTableViewItemProviderF(void) {}
56 * Gets the total number of groups.
60 * @return The total number of groups
61 * @remarks This method must be implemented so that it returns the total number of groups in the GroupedTableView control.
63 virtual int GetGroupCount(void) = 0;
66 * Gets the total number of items in the specified group.
70 * @return The total number of items in the specified group
71 * @param[in] groupIndex The index of the group
72 * @remarks This method must be implemented so that it returns the total number of items for the specified group in the GroupedTableView control.
74 virtual int GetItemCount(int groupIndex) = 0;
77 * Gets the group item for the specified index from the item provider.
81 * @return A group item of the GroupedTableView control
82 * @param[in] groupIndex The index of the group
83 * @param[in] itemWidth The width of the item
84 * @remarks An application that uses the GroupedTableView control must implement this method. This method is expected to return a group item that is
85 * allocated on a heap memory.
86 * Note that when the group item is not required, the %GroupedTableView control calls IGroupedTableViewItemProviderF::DeleteGroupItem() and the
87 * application deallocates the item.
89 virtual TableViewGroupItem* CreateGroupItem(int groupIndex, float itemWidth) = 0;
92 * Deletes the specified group item.
96 * @return @c true if the group item is deallocated by this method,
98 * @param[in] groupIndex The index of the group
99 * @param[in] pItem The pointer to TableViewGroupItem to delete
100 * @remarks An application that uses the GroupedTableView control must implement this method.
101 * Using this method, an application can deallocate the item.
102 * If an application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the
103 * item. Otherwise, the item is deallocated by the %GroupedTableView control.
104 * @see CreateGroupItem()
106 virtual bool DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0;
109 * Updates the specified group item.
113 * @param[in] groupIndex The group index
114 * @param[in] pItem The pointer to TableViewGroupItem to update
115 * @remarks An application that uses the GroupedTableView control must implement this method.
116 * This method is called when the modification of an group item is requested.
117 * The application can change @c pItem in this method, but should not keep @c pItem for later use.
119 virtual void UpdateGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0;
122 * Creates the specified item.
126 * @return An item of the GroupedTableView
127 * @param[in] groupIndex The group index
128 * @param[in] itemIndex The item index
129 * @param[in] itemWidth The width of the item
130 * @remarks An application that uses the GroupedTableView control must implement this method.
131 * This method is expected to return an item that is allocated on a heap memory.
132 * The returned item can be a simple or custom item.
133 * Note that when the item is not required, the %GroupedTableView control calls IGroupedTableViewItemProviderF::DeleteItem() and the application
134 * deallocates the item.
137 virtual TableViewItem* CreateItem(int groupIndex, int itemIndex, float itemWidth) = 0;
140 * Deletes the specified item.
144 * @return @c true if the item is deallocated by this method, @n
146 * @param[in] groupIndex The group index
147 * @param[in] itemIndex The item index
148 * @param[in] pItem The pointer to TableViewItem to delete
149 * @remarks An application that uses the GroupedTableView control must implement this method.
150 * Using this method, an application can deallocate the item.
151 * If the application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the
152 * item. Otherwise, the item is deallocated by the %GroupedTableView control.
155 virtual bool DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0;
158 * Updates the specified item.
162 * @param[in] groupIndex The group index
163 * @param[in] itemIndex The item index
164 * @param[in] pItem The pointer to TableViewItem to update
165 * @remarks An application that uses the GroupedTableView control must implement this method.
166 * This method is called when the modification of an item is requested.
167 * The application can change @c pItem in this method, but should not keep @c pItem for later use.
169 virtual void UpdateItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0;
172 * Gets the default height of an group item.
176 * @return The default height of an group item
177 * @remarks This method must be implemented so that it returns the default height of group items in the GroupedTableView control.
179 virtual float GetDefaultGroupItemHeight(void) = 0;
183 * Gets the default height of an item.
187 * @return The default height of an item
188 * @remarks This method must be implemented so that it returns the default height of items in the GroupedTableView control.
190 virtual float GetDefaultItemHeight(void) = 0;
193 * Checks whether the item can be reordered.
197 * @return @c true if the item can be reordered, else @c false
198 * @param[in] groupIndexFrom The source group index of the item
199 * @param[in] groupIndexTo The target group index of the item
201 virtual bool IsReorderable(int groupIndexFrom, int groupIndexTo) { return false; }
205 // This method is for internal use only. Using this method can cause behavioral, security-related,
206 // and consistency-related issues in the application.
208 // The following method is reserved, and its name can be changed at any time without prior notice.
212 virtual void IGroupedTableViewItemProviderF_Reserved1(void) {}
215 // This method is for internal use only. Using this method can cause behavioral, security-related,
216 // and consistency-related issues in the application.
218 // The following method is reserved, and its name can be changed at any time without prior notice.
222 virtual void IGroupedTableViewItemProviderF_Reserved2(void) {}
224 }; // IGroupedTableViewItemProviderF
226 }}} // Tizen::Ui::Controls
228 #endif // _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_