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 FUiCtrlISectionTableViewItemProvider.h
20 * @brief This is the header file for the %ISectionTableViewItemProvider interface.
22 * This header file contains the declarations of the %ISectionTableViewItemProvider 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_ISECTION_TABLE_VIEW_ITEM_PROVIDER_H_
28 #define _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_H_
30 namespace Tizen { namespace Ui { namespace Controls
35 * @interface ISectionTableViewItemProvider
36 * @brief This interface implements the listener for events on %SectionTableView.
40 * The %ISectionTableViewItemProvider interface implements an item provider which generates items for SectionTableView. %SectionTableView calls the item provider
41 * to request an item which is about to be displayed on a screen. Applications which use %SectionTableView must implement the item provider.
42 * The class is registered with a %SectionTableView, using the SectionTableView::SetItemProvider() method.
44 class _OSP_EXPORT_ ISectionTableViewItemProvider
48 * This polymorphic destructor should be overridden if required.@n
49 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
53 virtual ~ISectionTableViewItemProvider(void) {}
56 * Gets the total number of sections.
60 * @return The total number of sections
61 * @remarks This method must be implemented so that it returns the total number of groups in the SectionTableView control.
63 virtual int GetSectionCount(void) = 0;
66 * Gets the total number of items in the specified section.
70 * @return The total number of items in the specified section
71 * @param[in] sectionIndex The index of the section
72 * @remarks This method must be implemented so that it returns the total number of items for the specified section in the %SectionTableView control.
74 virtual int GetItemCount(int sectionIndex) = 0;
77 * Creates the specified item.
81 * @return An item of the SectionTableView
82 * @param[in] sectionIndex The section index
83 * @param[in] itemIndex The item index
84 * @param[in] itemWidth The width of the item
86 * - An application that uses the SectionTableView control must implement this method.
87 * - This method is expected to return an item that is allocated on a heap memory.
88 * - The returned item can be a simple or custom item.
89 * - The returned item should not be a null pointer.
90 * - Note that when the item is not required, the %SectionTableView control calls ISectionTableViewItemProvider::DeleteItem() and the application
91 * deallocates the item.
94 virtual TableViewItem* CreateItem(int sectionIndex, int itemIndex, int itemWidth) = 0;
97 * Deletes the specified item.
101 * @return @c true if the item is deallocated by this method, @n
103 * @param[in] sectionIndex The section index
104 * @param[in] itemIndex The item index
105 * @param[in] pItem The pointer to TableViewItem to delete
107 * - An application that uses the SectionTableView control must implement this method.
108 * - Using this method, an application can deallocate the item.
109 * - If the application deallocates the item, this method must return true. This notifies the %SectionTableView control not to release the
110 * item. Otherwise, the item is deallocated by the %SectionTableView control.
113 virtual bool DeleteItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0;
116 * Updates the specified item.
120 * @param[in] sectionIndex The section index
121 * @param[in] itemIndex The item index
122 * @param[in] pItem The pointer to TableViewItem to update
124 * - An application that uses the SectionTableView control must implement this method.
125 * - This method is called when the modification of an item is requested.
126 * - The application can change @c pItem in this method, but should not keep @c pItem for later use.
128 virtual void UpdateItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0;
131 * Gets the header text of a specified section.
135 * @return The section header text of specified section
136 * @param[in] sectionIndex The index of the group
138 * - An application that uses the SectionTableView control must implement this method.
139 * - The header text will be aligned left
141 virtual Tizen::Base::String GetSectionHeader(int sectionIndex) = 0;
144 * Returns whether the section has the section header or not.
148 * @return @c true if the section has an header, @n
150 * @param[in] sectionIndex The index of the section
151 * @remarks An application that uses the SectionTableView control must implement this method.
153 virtual bool HasSectionHeader(int sectionIndex) = 0;
156 * Gets the footer text of a specified section.
160 * @return The footer text of specified section
161 * @param[in] sectionIndex The index of the section
163 * - An application that uses the SectionTableView control must implement this method.
164 * - The footer text will be aligned right.
166 virtual Tizen::Base::String GetSectionFooter(int sectionIndex) = 0;
169 * Returns whether the section has the footer or not.
173 * @return @c true, if the section has the footer @n
175 * @param[in] sectionIndex The index of the section
176 * @remarks An application that uses the SectionTableView control must implement this method.
178 virtual bool HasSectionFooter(int sectionIndex) = 0;
181 * Gets the default height of an item.
185 * @return The default height of an item
186 * @remarks This method must be implemented so that it returns the default height of items in the SectionTableView control.
188 virtual int GetDefaultItemHeight(void) = 0;
192 // This method is for internal use only. Using this method can cause behavioral, security-related,
193 // and consistency-related issues in the application.
195 // This method is reserved and may change its name at any time without prior notice.
199 virtual void ISectionTableViewItemProvider_Reserved1(void) {}
202 // This method is for internal use only. Using this method can cause behavioral, security-related,
203 // and consistency-related issues in the application.
205 // This method is reserved and may change its name at any time without prior notice.
209 virtual void ISectionTableViewItemProvider_Reserved2(void) {}
212 // This method is for internal use only. Using this method can cause behavioral, security-related,
213 // and consistency-related issues in the application.
215 // This method is reserved and may change its name at any time without prior notice.
219 virtual void ISectionTableViewItemProvider_Reserved3(void) {}
220 }; // ISectionTableViewItemProvider
222 }}} // Tizen::Ui::Controls
224 #endif // _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_H_