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 FUiCtrlISectionTableViewItemProviderF.h
20 * @brief This is the header file for the %ISectionTableViewItemProviderF interface.
22 * This header file contains the declarations of the %ISectionTableViewItemProviderF interface.
23 * If the event is generated, a method of this interface is called.
24 * So, when applications do jobs related to item events, use the methods of this interface.
27 #ifndef _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_F_H_
28 #define _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_F_H_
30 namespace Tizen { namespace Ui { namespace Controls
35 * @interface ISectionTableViewItemProviderF
36 * @brief This interface implements the listener for events on SectionTableView.
40 * The %ISectionTableViewItemProviderF 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's SetSectionStyleItemProvider() method.
44 class _OSP_EXPORT_ ISectionTableViewItemProviderF
48 * 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.
52 virtual ~ISectionTableViewItemProviderF(void) {}
55 * Gets the total number of groups in the SectionTableView control.
59 * @return The total number of groups
60 * @remarks This method must be implemented so that it returns the total number of groups in the SectionTableView control.
62 virtual int GetSectionCount(void) = 0;
65 * Gets the total number of items in a specified group.
69 * @return The total number of items in a specified group
70 * @param[in] sectionIndex The index of the section
71 * @remarks This method must be implemented so that it returns the total number of items for the specified section in the %SectionTableView control.
73 virtual int GetItemCount(int sectionIndex) = 0;
76 * Creates the specified item.
80 * @return An item of the SectionTableView
81 * @param[in] sectionIndex The section index
82 * @param[in] itemIndex The item index
83 * @param[in] itemWidth The width of the item
84 * @remarks An application that uses the SectionTableView control must implement this method.
85 * This method is expected to return an item that is allocated on a heap memory.
86 * The returned item can be a simple or custom item.
87 * Note that when the item is not required, the %SectionTableView control calls ISectionTableViewItemProviderF::DeleteItem() and the application
88 * deallocates the item.
91 virtual TableViewItem* CreateItem(int sectionIndex, int itemIndex, float itemWidth) = 0;
94 * Deletes the specified item.
98 * @return @c true if the item is deallocated by this method, @n
100 * @param[in] sectionIndex The section index
101 * @param[in] itemIndex The item index
102 * @param[in] pItem The pointer to TableViewItem to delete
103 * @remarks An application that uses the SectionTableView control must implement this method.
104 * Using this method, an application can deallocate the item.
105 * If the application deallocates the item, this method must return @c true. This notifies the %SectionTableView control not to release the
106 * item. Otherwise, the item is deallocated by the %SectionTableView control.
109 virtual bool DeleteItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0;
112 * Updates the specified item.
116 * @param[in] sectionIndex The section index
117 * @param[in] itemIndex The item index
118 * @param[in] pItem The pointer to TableViewItem to update
119 * @remarks An application that uses the SectionTableView control must implement this method.
120 * This method is called when the modification of an item is requested.
121 * The application can change @c pItem using this method, so the user should consider this when using @c pItem in future.
123 virtual void UpdateItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0;
126 * Gets the header text of a specified section.
130 * @return The section header text of a specified section
131 * @param[in] sectionIndex The index of the group
132 * @remarks An application that uses the SectionTableView control must implement this method. @n
133 * The header text will be left aligned.
135 virtual Tizen::Base::String GetSectionHeader(int sectionIndex) = 0;
138 * Checks whether the group has the section header or not.
142 * @return @c true if the section has a header, @n
144 * @param[in] sectionIndex The index of the section
145 * @remarks An application that uses the SectionTableView control must implement this method.
147 virtual bool HasSectionHeader(int sectionIndex) = 0;
150 * Gets the footer text of a specified section.
154 * @return The footer text of specified section
155 * @param[in] sectionIndex The index of the section
156 * @remarks An application that uses the SectionTableView control must implement this method. @n
157 * The footer text will be right aligned.
159 virtual Tizen::Base::String GetSectionFooter(int sectionIndex) = 0;
162 * Checks whether the section has the footer or not.
166 * @return @c true, if the section has a footer @n
168 * @param[in] sectionIndex The index of the section
169 * @remarks An application that uses the SectionTableView control must implement this method.
171 virtual bool HasSectionFooter(int sectionIndex) = 0;
174 * Gets the default height of an item.
178 * @return The default height of an item
179 * @remarks This method must be implemented so that it returns the default height of items in the SectionTableView control.
181 virtual float GetDefaultItemHeight(void) = 0;
185 // This method is for internal use only. Using this method can cause behavioral, security-related,
186 // and consistency-related issues in the application.
188 // The following method is reserved, and its name can be changed at any time without prior notice.
192 virtual void ISectionTableViewItemProviderF_Reserved1(void) {}
195 // This method is for internal use only. Using this method can cause behavioral, security-related,
196 // and consistency-related issues in the application.
198 // The following method is reserved, and its name can be changed at any time without prior notice.
202 virtual void ISectionTableViewItemProviderF_Reserved2(void) {}
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 ISectionTableViewItemProviderF_Reserved3(void) {}
213 }; // ISectionTableViewItemProviderF
215 }}} // Tizen::Ui::Controls
217 #endif // _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_F_H_