Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiCtrlIGroupedTableViewItemProviderF.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19 * @file FUiCtrlIGroupedTableViewItemProviderF.h
20 * @brief This is the header file for the %IGroupedTableViewItemProviderF interface.
21 *
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.
25 *
26 */
27 #ifndef _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_
28 #define _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_
29
30 namespace Tizen { namespace Ui { namespace Controls
31 {
32 class TableViewItem;
33 class TableViewGroupItem;
34
35 /**
36 * @interface IGroupedTableViewItemProviderF
37 * @brief  This interface implements the listener for events on GroupedTableView.
38 *
39 * @since 2.1
40 *
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.
44 */
45 class _OSP_EXPORT_ IGroupedTableViewItemProviderF
46 {
47 public:
48         /**
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.
50         *
51         * @since 2.1
52         */
53         virtual ~IGroupedTableViewItemProviderF(void) {}
54
55         /**
56         * Gets the total number of groups.
57         *
58         * @since 2.1
59         *
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.
62         */
63         virtual int GetGroupCount(void) = 0;
64
65         /**
66         * Gets the total number of items in the specified group.
67         *
68         * @since 2.1
69         *
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.
73         */
74         virtual int GetItemCount(int groupIndex) = 0;
75
76         /**
77         * Gets the group item for the specified index from the item provider.
78         *
79         * @since 2.1
80         *
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.
88         */
89         virtual TableViewGroupItem* CreateGroupItem(int groupIndex, float itemWidth) = 0;
90
91         /**
92         * Deletes the specified group item.
93         *
94         * @since 2.1
95         *
96         * @return  @c true if the group item is deallocated by this method,
97         *          else @c false
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()
105         */
106         virtual bool DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0;
107
108         /**
109         * Updates the specified group item.
110         *
111         * @since 2.1
112         *
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.
118         */
119         virtual void UpdateGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0;
120
121         /**
122         * Creates the specified item.
123         *
124         * @since 2.1
125         *
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.
135         * @see     DeleteItem()
136         */
137         virtual TableViewItem* CreateItem(int groupIndex, int itemIndex, float itemWidth) = 0;
138
139         /**
140         * Deletes the specified item.
141         *
142         * @since 2.1
143         *
144         * @return @c true if the item is deallocated by this method, @n
145         *   else @c false
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.
153         * @see     CreateItem()
154         */
155         virtual bool DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0;
156
157         /**
158         * Updates the specified item.
159         *
160         * @since 2.1
161         *
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.
168         */
169         virtual void UpdateItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0;
170
171         /**
172         * Gets the default height of an group item.
173         *
174         * @since 2.1
175         *
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.
178         */
179         virtual float GetDefaultGroupItemHeight(void) = 0;
180
181
182         /**
183         * Gets the default height of an item.
184         *
185         * @since 2.1
186         *
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.
189         */
190         virtual float GetDefaultItemHeight(void) = 0;
191
192         /**
193         * Checks whether the item can be reordered.
194         *
195         * @since                        2.1
196         *
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
200         */
201         virtual bool IsReorderable(int groupIndexFrom, int groupIndexTo) { return false; }
202
203 protected:
204         //
205         // This method is for internal use only. Using this method can cause behavioral, security-related,
206         // and consistency-related issues in the application.
207         //
208         // The following method is reserved, and its name can be changed at any time without prior notice.
209         //
210         // @since 2.1
211         //
212         virtual void IGroupedTableViewItemProviderF_Reserved1(void) {}
213
214         //
215         // This method is for internal use only. Using this method can cause behavioral, security-related,
216         // and consistency-related issues in the application.
217         //
218         // The following method is reserved, and its name can be changed at any time without prior notice.
219         //
220         // @since 2.1
221         //
222         virtual void IGroupedTableViewItemProviderF_Reserved2(void) {}
223
224 }; // IGroupedTableViewItemProviderF
225
226 }}} // Tizen::Ui::Controls
227
228 #endif // _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_