Merge "fix klocwork issue" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiCtrlGroupedList.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
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  * @if OSPDEPREC
20  * @file        FUiCtrlGroupedList.h
21  * @brief       This is the header file for the %GroupedList class.
22  *
23  * This header file contains the declarations of the %GroupedList class and its helper classes.
24  * @endif
25  */
26
27 #ifndef _FUI_CTRL_GROUPED_LIST_H_
28 #define _FUI_CTRL_GROUPED_LIST_H_
29
30 #include <FBaseObject.h>
31 #include <FBaseTypes.h>
32 #include <FGrpRectangle.h>
33 #include <FUiControl.h>
34 #include <FUiContainer.h>
35 #include <FUiCtrlCustomList.h>
36 #include <FUiCtrlControlsTypes.h>
37 #include <FUiIFastScrollEventListener.h>
38 #include <FUiIGroupedItemEventListener.h>
39 #include <FUiCtrlListTypes.h>
40
41 namespace Tizen { namespace Ui { namespace Controls {
42
43 /**
44  * @if OSPDEPREC
45  * @class               GroupedList
46  * @brief       <i> [Deprecated] </i> This class defines the common behavior of a %GroupedList control.
47  *
48  * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
49  * @since               2.0
50  *
51  * The %GroupedList class represents grouped items in a list. List items of
52  * %GroupedList consist of groups and items. A group represents grouped items and is
53  * inserted into the first level as items are inserted into List. Items which are
54  * CustomListItem are inserted under related groups. So, items are uniquely identified
55  * with two indices: group index and item index.
56  *
57  * If an application wants to perform tasks when the state of a list item is changed,
58  * it must implement IGroupedItemEventListener and register it to the grouped list,
59  * It will then receive related events from %GroupedList.
60  *
61  * Unlike ExpandableList which is also a list with a hierarchy of depth 2, group
62  * item itself does not have many functions.
63  *
64  * A typical use case of %GroupedList would be a list which groups all items alphabetically.
65  *
66  * Note that CustomListItem and CustomListItemFormat need to be created on a heap. CustomListItems will be deleted automatically
67  * when the %GroupedList itself is destroyed. If you want to remove certain list items, you must use RemoveItemAt(). CustomListItemFormat
68  * must be deleted by the application.
69  *
70  * Refer to CustomListItem and CustomListItemFormat.
71  *
72  * Example:
73  *
74  * @image html ui_controls_groupedlist.png
75  *
76  * This is the simple UI application that uses a %GroupedList control.
77  *
78  * @code
79 // Sample code for GroupedListSample.h
80 #include <FApp.h>
81 #include <FUi.h>
82
83 class GroupedListSample
84         :public Tizen::Ui::Controls::Form
85         , public Tizen::Ui::ICustomItemEventListener
86 {
87 public:
88         GroupedListSample(void)
89         : __pGroupedList(null)
90         , __pCustomListItemFormat(null){}
91
92         bool Initialize(void);
93         result AddListItem(Tizen::Ui::Controls::GroupedList& groupedList, int groupId, Tizen::Base::String itemText,
94                         Tizen::Graphics::Bitmap* pBitmapNormal, Tizen::Graphics::Bitmap* pBitmapFocused);
95
96         virtual result OnInitializing(void);
97         virtual result OnTerminating(void);
98
99         // ICustomItemEventListener
100         virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, Tizen::Ui::ItemStatus status);
101         virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, int elementId, Tizen::Ui::ItemStatus status);
102
103 private:
104         static const int ID_LIST_          = 101;
105         static const int ID_LIST_TEXT   = 102;
106         static const int ID_LIST_BITMAP = 103;
107
108         Tizen::Ui::Controls::GroupedList* __pGroupedList;
109         Tizen::Ui::Controls::CustomListItemFormat* __pCustomListItemFormat;
110 };
111  *      @endcode
112  *
113  *      @code
114 // Sample code for CutomListSample.cpp
115 #include <FApp.h>
116 #include <FGraphics.h>
117
118 #include "GroupedListSample.h"
119
120 using namespace Tizen::App;
121 using namespace Tizen::Base;
122 using namespace Tizen::Graphics;
123 using namespace Tizen::Ui;
124 using namespace Tizen::Ui::Controls;
125
126 bool
127 GroupedListSample::Initialize(void)
128 {
129         Construct(FORM_STYLE_NORMAL);
130         return true;
131 }
132
133 result
134 GroupedListSample::OnInitializing(void)
135 {
136         result r = E_SUCCESS;
137
138         // Creates an instance of GroupedList
139         __pGroupedList = new GroupedList();
140         __pGroupedList->Construct(Rectangle(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height), CUSTOM_LIST_STYLE_NORMAL);
141
142         // Creates an instance of CustomListItemFormat of the grouped list
143         __pCustomListItemFormat = new CustomListItemFormat();
144         __pCustomListItemFormat->Construct();
145         __pCustomListItemFormat->AddElement(ID_LIST_TEXT, Rectangle(10, 25, 200, 80));
146         __pCustomListItemFormat->AddElement(ID_LIST_BITMAP, Rectangle(220, 10, 70, 80));
147
148         // Adds the groups to the grouped list
149         __pGroupedList->AddGroup(L"Group_1", null);
150         __pGroupedList->AddGroup(L"Group_2", null);
151         __pGroupedList->AddGroup(L"Group_3", null);
152
153         // Gets instances of Bitmap
154         AppResource *pAppResource = Application::GetInstance()->GetAppResource();
155         Bitmap *pBitmapNormal  = pAppResource->GetBitmapN(L"tizen.png");
156         Bitmap *pBitmapFocused = pAppResource->GetBitmapN(L"tizen.png");
157
158         // Adds the items to the grouped list
159         for (int i = 0; i < __pGroupedList->GetGroupCount(); i++ )
160         {
161                 AddListItem(*__pGroupedList, i, L"SubItem1", pBitmapNormal, pBitmapFocused);
162                 AddListItem(*__pGroupedList, i, L"SubItem2", pBitmapNormal, pBitmapFocused);
163                 AddListItem(*__pGroupedList, i, L"SubItem3", pBitmapNormal, pBitmapFocused);
164                 AddListItem(*__pGroupedList, i, L"SubItem4", pBitmapNormal, pBitmapFocused);
165         }
166
167         // Adds the grouped list to the form
168         AddControl(__pGroupedList);
169
170         // Deallocates bitmaps
171         delete pBitmapNormal;
172         delete pBitmapFocused;
173
174         return r;
175 }
176
177 result
178 GroupedListSample::OnTerminating(void)
179 {
180         result r = E_SUCCESS;
181
182         // Deallocates the item format
183         delete __pCustomListItemFormat;
184
185         return r;
186 }
187
188 result
189 GroupedListSample::AddListItem(GroupedList& groupedList, int groupId, String itemText, Bitmap* pBitmapNormal, Bitmap* pBitmapFocused)
190 {
191         result r = E_SUCCESS;
192
193         // Creates an instance of CustomListItem of the grouped list
194         CustomListItem* pItem = new CustomListItem();
195         pItem->Construct(100);
196         pItem->SetItemFormat(*__pCustomListItemFormat);
197         pItem->SetElement(ID_LIST_TEXT, itemText);
198         pItem->SetElement(ID_LIST_BITMAP, *pBitmapNormal, pBitmapFocused);
199
200         // Adds the item to the grouped list
201         groupedList.AddItem(groupId, *pItem, ID_LIST_);
202
203         return r;
204 }
205
206 // ICustomItemEventListener implementation
207 void
208 GroupedListSample::OnItemStateChanged(const Control& source, int index, int itemId, ItemStatus status)
209 {
210         switch (itemId)
211         {
212         case ID_LIST_:
213                 {
214                         // ....
215                 }
216                 break;
217         default:
218                 break;
219         }
220 }
221
222 void
223 GroupedListSample::OnItemStateChanged(const Control& source, int index, int itemId, int elementId, ItemStatus status)
224 {
225         switch (itemId)
226         {
227         case ID_LIST_:
228                 {
229                         switch (elementId)
230                         {
231                         case ID_LIST_TEXT:
232                                 {
233                                         // ....
234                                 }
235                                 break;
236                         case ID_LIST_BITMAP:
237                                 {
238                                         // ....
239                                 }
240                                 break;
241                         default:
242                                 break;
243                         }
244                 }
245                 break;
246         default:
247                 break;
248         }
249 }
250  * @endcode
251  * @endif
252  */
253 class _OSP_EXPORT_ GroupedList
254         : public Tizen::Ui::Control
255 {
256 public:
257         /**
258          * @if OSPDEPREC
259          * The object is not fully constructed after this constructor is called. @n
260          * For full construction, the GroupedList::Construct() method must be called right after calling this constructor.
261          *
262          * @brief       <i> [Deprecated] </i>
263          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
264          * @since               2.0
265          * @endif
266          */
267         GroupedList(void);
268
269         /**
270          * @if OSPDEPREC
271          * This polymorphic destructor should be overridden if required. @n
272          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
273          *
274          * @brief       <i> [Deprecated] </i>
275          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
276          * @since               2.0
277          * @endif
278          */
279         virtual ~GroupedList(void);
280
281         /**
282          * @if OSPDEPREC
283          * Initializes this instance of %GroupedList with the specified parameters.
284          *
285          * @brief       <i> [Deprecated] </i>
286          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
287          * @since                       2.0
288          *
289          * @return              An error code
290          * @param[in]   rect                    An instance of the Graphics::Rectangle class @n
291          *                                      This instance represents the X, Y coordinates of the top-left corner of the created %GroupedList along with the width and
292          *                                                              height.
293          * @param[in]   style                   The style of the %GroupedList control
294          * @param[in]   itemDivider             Set to @c true to display an item divider, @n
295          *                                                              else @c false
296          * @param[in]   fastScroll              Set to @c true if to use a fast scroll, @n
297          *                                                              else @c false
298          * @exception   E_SUCCESS               The method is successful.
299          * @exception   E_INVALID_ARG   A specified input parameter is invalid.
300          * @exception   E_SYSTEM                A system error has occurred.
301          * @remarks
302          *                      - The size of the control must be within the range as defined by the minimum and maximum size.
303          *                      - The minimum size of this control is 274 x 148 on a WVGA screen, 180 x 96 on a HVGA screen and 137 x 74 on a WQVGA screen.
304          * @endif
305          */
306         result Construct(const Tizen::Graphics::Rectangle& rect, CustomListStyle style, bool itemDivider = true, bool fastScroll = false);
307
308         /**
309          * @if OSPDEPREC
310          * Adds the group to the %GroupedList control.
311          *
312          * @brief       <i> [Deprecated] </i>
313          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
314          * @since               2.0
315          *
316          * @return              An error code
317          * @param[in]   text                            The string of the group to append
318          * @param[in]   pBackgroundBitmap       The background bitmap of the group
319          * @param[in]   groupId                         The ID of the group
320          * @exception   E_SUCCESS                       The method is successful.
321          * @exception   E_SYSTEM                    A system error has occurred.
322          * @endif
323          */
324         result AddGroup(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBackgroundBitmap, int groupId = LIST_ITEM_UNSPECIFIED_ID);
325
326         /**
327          * @if OSPDEPREC
328          * Inserts the group of the %GroupedList control at the specified index.
329          *
330          * @brief       <i> [Deprecated] </i>
331          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
332          * @since               2.0
333          *
334          * @return              An error code
335          * @param[in]   groupIndex                      The group index
336          * @param[in]   text                            The name of the group item
337          * @param[in]   pBackgroundBitmap       The background bitmap of the group item
338          * @param[in]   groupId                         The ID of the group item
339          * @exception   E_SUCCESS                       The method is successful.
340          * @exception   E_INVALID_ARG           The @c groupIndex is out of bounds.
341          * @exception   E_SYSTEM                        A system error has occurred.
342          * @endif
343          */
344         result InsertGroupAt(int groupIndex, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBackgroundBitmap, int groupId = LIST_ITEM_UNSPECIFIED_ID);
345
346         /**
347          * @if OSPDEPREC
348          * Sets the contents of the group of the %GroupedList control at the index.
349          *
350          * @brief       <i> [Deprecated] </i>
351          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
352          * @since               2.0
353          *
354          * @return              An error code
355          * @param[in]   groupIndex                  The group index
356          * @param[in]   text                        The string of the group to append
357          * @param[in]   pBackgroundBitmap       The bitmap of the group
358          * @param[in]   groupId                         The ID of the group
359          * @exception   E_SUCCESS                   The method is successful.
360          * @exception   E_INVALID_ARG           The specified @c groupIndex is invalid.
361          * @exception   E_SYSTEM                    A system error has occurred.
362          * @endif
363          */
364         result SetGroupAt(int groupIndex, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBackgroundBitmap, int groupId = LIST_ITEM_UNSPECIFIED_ID);
365
366         /**
367          * @if OSPDEPREC
368          * Removes the group of the %GroupedList control at the index.
369          *
370          * @brief       <i> [Deprecated] </i>
371          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
372          * @since               2.0
373          *
374          * @return              An error code
375          * @param[in]   groupIndex              The group index
376          * @exception   E_SUCCESS               The method is successful.
377          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
378          * @exception   E_SYSTEM                A system error has occurred.
379          * @remarks
380          *                      - When the specified group is removed, all the items in the group are also removed.
381          *                      - The removed list items are deleted from the memory.
382          * @endif
383          */
384         result RemoveGroupAt(int groupIndex);
385
386         /**
387          * @if OSPDEPREC
388          * Removes all the groups of the %GroupedList control.
389          *
390          * @brief       <i> [Deprecated] </i>
391          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
392          * @since               2.0
393          *
394          * @return              An error code
395          * @exception   E_SUCCESS               The method is successful.
396          * @exception   E_SYSTEM                A system error has occurred.
397          * @remarks
398          *                      - When the specified group is removed, all the items in the group are also removed.
399          *                      - The removed list items are deleted from the memory.
400          * @endif
401          */
402         result RemoveAllGroups(void);
403
404         /**
405          * @if OSPDEPREC
406          * Counts all the groups of the %GroupedList control.
407          *
408          * @brief       <i> [Deprecated] </i>
409          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
410          * @since               2.0
411          *
412          * @return              The count of all the groups
413          * @endif
414          */
415         int GetGroupCount(void) const;
416
417         /**
418          * @if OSPDEPREC
419          * Adds the item to the specified group.
420          *
421          * @brief       <i> [Deprecated] </i>
422          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
423          * @since               2.0
424          *
425          * @return              An error code
426          * @param[in]   groupIndex              The group index
427          * @param[in]   item                    The custom list item object to add
428          * @param[in]   itemId                  The specified item ID for this item
429          * @exception   E_SUCCESS               The method is successful.
430          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemId is invalid.
431          * @exception   E_SYSTEM                A system error has occurred.
432          * @remarks
433          *                      - The added item is deleted automatically when the list is destroyed.
434          *                      - Do not add, insert, or set an item that already belongs to a %GroupedList control.
435          * @endif
436          */
437         result AddItem(int groupIndex, const CustomListItem& item, int itemId = LIST_ITEM_UNSPECIFIED_ID);
438
439         /**
440          * @if OSPDEPREC
441          * Inserts the item to the specified group.
442          *
443          * @brief       <i> [Deprecated] </i>
444          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
445          * @since               2.0
446          *
447          * @return              An error code
448          * @param[in]   groupIndex              The group index
449          * @param[in]   itemIndex               The item index in the specified group
450          * @param[in]   item            The custom list item to insert
451          * @param[in]   itemId                  The item ID for this item
452          * @exception   E_SUCCESS               The method is successful.
453          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemId is invalid.
454          * @exception   E_SYSTEM                A system error has occurred.
455          * @remarks
456          *                      - The inserted item is deleted automatically when the list is destroyed.
457          *                      - Do not add, insert, or set an item that already belongs to a %GroupedList control.
458          * @endif
459          */
460         result InsertItemAt(int groupIndex, int itemIndex, const CustomListItem& item, int itemId = LIST_ITEM_UNSPECIFIED_ID);
461
462         /**
463          * @if OSPDEPREC
464          * Sets the contents of the item in the specified group.
465          *
466          * @brief       <i> [Deprecated] </i>
467          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
468          * @since               2.0
469          *
470          * @return              An error code
471          * @param[in]   groupIndex              The group index
472          * @param[in]   itemIndex               The item index in the specified group
473          * @param[in]   item                    The custom list item to set
474          * @param[in]   itemId                  The item ID for this item
475          * @exception   E_SUCCESS               The method is successful.
476          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemId is invalid.
477          * @exception   E_SYSTEM                A system error has occurred.
478          * @remarks             Do not add, insert, or set an item that already belongs to a %GroupedList control.
479          * @endif
480          */
481         result SetItemAt(int groupIndex, int itemIndex, const CustomListItem& item, int itemId = LIST_ITEM_UNSPECIFIED_ID);
482
483         /**
484          * @if OSPDEPREC
485          * Sets the checked status for the specified item.
486          *
487          * @brief       <i> [Deprecated] </i>
488          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
489          * @since                       2.0
490          *
491          * @return                                              An error code
492          * @param[in]   groupIndex              The group index of the item
493          * @param[in]   itemIndex               The item index
494          * @param[in]   check                   Set to @c true to check the item, @n
495          *                                                              else @c false
496          * @exception   E_SUCCESS               The method is successful.
497          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemIndex is invalid.
498          * @exception   E_SYSTEM                A system error has occurred.
499          * @endif
500          */
501         result SetItemChecked(int groupIndex, int itemIndex, bool check);
502
503         /**
504          * @if OSPDEPREC
505          * Enables or disables the item at the specified index of the %GroupedList.
506          *
507          * @brief       <i> [Deprecated] </i>
508          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
509          * @since               2.0
510          *
511          * @return              An error code
512          * @param[in]   groupIndex              The group index of the item
513          * @param[in]   itemIndex               The item index
514          * @param[in]   enable                  Set to @c true to enable the item, @n
515          *                                                              else @c false
516          * @exception   E_SUCCESS               The method is successful.
517          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemIndex is invalid.
518          * @exception   E_SYSTEM                A system error has occurred.
519          * @endif
520          */
521         result SetItemEnabled(int groupIndex, int itemIndex, bool enable);
522
523         /**
524          * @if OSPDEPREC
525          * Sets the background color of this control.
526          *
527          * @brief       <i> [Deprecated] </i>
528          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
529          * @since       2.0
530          *
531          * @param[in]   color   The background color
532          * @endif
533          */
534         void SetBackgroundColor(const Tizen::Graphics::Color& color);
535
536         /**
537          * @if OSPDEPREC
538          * Sets the text that is displayed when %GroupedList is empty.
539          *
540          * @brief       <i> [Deprecated] </i>
541          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
542          * @since               2.0
543          *
544          * @param[in]   text    The empty list test
545          * @endif
546          */
547         void SetTextOfEmptyList(const Tizen::Base::String& text);
548
549         /**
550          * @if OSPDEPREC
551          * Sets the color of the text that is displayed when %GroupedList is empty.
552          *
553          * @brief       <i> [Deprecated] </i>
554          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
555          * @since     2.0
556          *
557          * @param[in]   color   The color of the text to display
558          * @endif
559          */
560         void SetTextColorOfEmptyList(const Tizen::Graphics::Color& color);
561
562         /**
563          * @if OSPDEPREC
564          * Gets the color of the text that is displayed when %GroupedList is empty.
565          *
566          * @brief       <i> [Deprecated] </i>
567          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
568          * @since       2.0
569          *
570          * @return      The color of the text to be displayed
571          * @endif
572          */
573         Tizen::Graphics::Color GetTextColorOfEmptyList(void) const;
574
575         /**
576          * @if OSPDEPREC
577          * Checks whether the item at the specified index of this grouped list is checked.
578          *
579          * @brief       <i> [Deprecated] </i>
580          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
581          * @since               2.0
582          *
583          * @return              @c true if the item is checked, @n
584          *              else @c false
585          * @param[in]   groupIndex              The group index of the item
586          * @param[in]   itemIndex               The item index
587          * @exception   E_SUCCESS               The method is successful.
588          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemIndex is invalid.
589          * @exception   E_SYSTEM                A system error has occurred.
590          * @remarks             This method can only be used when the style of the list allows selection.
591          * @endif
592          */
593         bool IsItemChecked(int groupIndex, int itemIndex) const;
594
595         /**
596          * @if OSPDEPREC
597          * Checks whether the item at the specified index is enabled.
598          *
599          * @brief       <i> [Deprecated] </i>
600          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
601          * @since               2.0
602          *
603          * @return              @c true if the item is enabled, @n
604          *                              else @c false
605          * @param[in]   groupIndex              The group index of the item
606          * @param[in]   itemIndex               The item index
607          * @exception   E_SUCCESS               The method is successful.
608          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemIndex is invalid.
609          * @exception   E_SYSTEM                A system error has occurred.
610          * @endif
611          */
612         bool IsItemEnabled(int groupIndex, int itemIndex) const;
613
614         /**
615          * @if OSPDEPREC
616          * Removes an item in the specified group.
617          *
618          * @brief       <i> [Deprecated] </i>
619          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
620          * @since               2.0
621          *
622          * @return              An error code
623          * @param[in]   groupIndex              The group index
624          * @param[in]   itemIndex               The item index
625          * @exception   E_SUCCESS               The method is successful.
626          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemIndex is invalid.
627          * @exception   E_SYSTEM                A system error has occurred.
628          * @remarks     The removed list item is deleted from the memory.
629          * @endif
630          */
631         result RemoveItemAt(int groupIndex, int itemIndex);
632
633         /**
634          * @if OSPDEPREC
635          * Removes all the items in the specified group.
636          *
637          * @brief       <i> [Deprecated] </i>
638          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
639          * @since               2.0
640          *
641          * @return              An error code
642          * @param[in]   groupIndex              The group index
643          * @exception   E_SUCCESS               The method is successful.
644          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
645          * @exception   E_SYSTEM                A system error has occurred.
646          * @remarks     The removed list items are deleted from the memory.
647          * @endif
648          */
649         result RemoveAllItemsAt(int groupIndex);
650
651         /**
652          * @if OSPDEPREC
653          * Removes all the checked items in the specified group.
654          *
655          * @brief       <i> [Deprecated] </i>
656          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
657          * @since               2.0
658          *
659          * @return              An error code
660          * @param[in]   groupIndex              The group index
661          * @exception   E_SUCCESS               The method is successful.
662          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
663          * @exception   E_SYSTEM                A system error has occurred.
664          * @remarks     The removed list items are deleted from the memory.
665          * @endif
666          */
667         result RemoveAllCheckedItemsAt(int groupIndex);
668
669         /**
670          * @if OSPDEPREC
671          * Counts all items of the %GroupedList instance.
672          *
673          * @brief       <i> [Deprecated] </i>
674          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
675          * @since               2.0
676          *
677          * @return              The item count of the specified group
678          * @param[in]   groupIndex              The group index
679          * @exception   E_SUCCESS               The method is successful.
680          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
681          * @exception   E_SYSTEM                A system error has occurred.
682          * @endif
683          */
684         int GetItemCountAt(int groupIndex) const;
685
686         /**
687          * @if OSPDEPREC
688          * Gets the item ID of the item at the specified index.
689          *
690          * @brief       <i> [Deprecated] </i>
691          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
692          * @since               2.0
693          *
694          * @return              The item ID
695          * @param[in]   groupIndex              The group index
696          * @param[in]   itemIndex               The item index in the specified group
697          * @exception   E_SUCCESS               The method is successful.
698          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemIndex is invalid.
699          * @exception   E_SYSTEM                A system error has occurred.
700          * @endif
701          */
702         int GetItemIdAt(int groupIndex, int itemIndex) const;
703
704         /**
705          * @if OSPDEPREC
706          * Gets the item index by the specified item ID.
707          *
708          * @brief       <i> [Deprecated] </i>
709          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
710          * @since                       2.0
711          *
712          * @return                      An error code
713          * @param[in]           itemId                  The item ID
714          * @param[out]      groupIndex          The group index
715          * @param[out]      itemIndex           The item index in the specified group
716          * @exception           E_SUCCESS               The method is successful.
717          * @exception           E_SYSTEM                A system error has occurred.
718          * @endif
719          */
720         result GetItemIndexFromItemId(int itemId, int& groupIndex, int& itemIndex) const;
721
722         /**
723          * @if OSPDEPREC
724          * Gets the group ID at the specified index.
725          *
726          * @brief       <i> [Deprecated] </i>
727          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
728          * @since               2.0
729          *
730          * @return              The group ID
731          * @param[in]   groupIndex              The group index
732          * @exception   E_SUCCESS               The method is successful.
733          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
734          * @exception   E_SYSTEM                A system error has occurred.
735          * @endif
736          */
737         int GetGroupIdAt(int groupIndex) const;
738
739         /**
740          * @if OSPDEPREC
741          * Gets the group index from the specified group ID.
742          *
743          * @brief       <i> [Deprecated] </i>
744          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
745          * @since               2.0
746          *
747          * @return              The group index
748          * @param[in]   groupId             The ID of the group
749          * @exception   E_SUCCESS               The method is successful.
750          * @exception   E_SYSTEM                A system error has occurred.
751          * @endif
752          */
753         int GetGroupIndexFromGroupId(int groupId) const;
754
755         /**
756          * @if OSPDEPREC
757          * Gets the index of the last item checked.
758          *
759          * @brief       <i> [Deprecated] </i>
760          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
761          * @since               2.0
762          *
763          * @return              An error code
764          * @param[out]  groupIndex              The group index
765          * @param[out]  itemIndex               The item index in the specified group
766          * @exception   E_SUCCESS               The method is successful.
767          * @exception   E_SYSTEM                A system error has occurred.
768          * @endif
769          */
770         result GetLastCheckedItemIndex(int& groupIndex, int& itemIndex) const;
771
772         /**
773          * @if OSPDEPREC
774          * Gets the index of the next checked item.
775          *
776          * @brief       <i> [Deprecated] </i>
777          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
778          * @since                       2.0
779          *
780          * @return                      An error code
781          * @param[in,out]   groupIndex          The group index
782          * @param[in,out]   itemIndex           The item index in the specified group
783          * @exception           E_SUCCESS               The method is successful.
784          * @exception           E_SYSTEM                A system error has occurred.
785          * @endif
786          */
787         result GetNextCheckedItemIndexAfter(int& groupIndex, int& itemIndex) const;
788
789         /**
790          * @if OSPDEPREC
791          * Gets the index of the item at the specified item position.
792          *
793          * @brief       <i> [Deprecated] </i>
794          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
795          * @since               2.0
796          *
797          * @return              An error code
798          * @param[in]   x                               The x position of the point
799          * @param[in]   y                               The y position of the point
800          * @param[out]  groupIndex              The index of the group which the item belongs to
801          * @param[out]  itemIndex               The index of the item
802          * @exception   E_SUCCESS               The method is successful.
803          * @exception   E_SYSTEM        A system error has occurred. @n
804          *                                                              There is no item at the specified position.
805          * @endif
806          */
807         result GetItemIndexFromPosition(int x, int y, int& groupIndex, int& itemIndex) const;
808
809         /**
810          * @if OSPDEPREC
811          * Gets the index of the item at the specified item position.
812          *
813          * @brief       <i> [Deprecated] </i>
814          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
815          * @since               2.0
816          *
817          * @return              An error code
818          * @param[in]   position        The position of the point
819          * @param[out]  groupIndex      The index of the group which the item belongs to
820          * @param[out]  itemIndex       The index of the item
821          * @exception   E_SUCCESS               The method is successful.
822          * @exception   E_SYSTEM        A system error has occurred. @n
823          *                                                              There is no item at the specified position.
824          * @endif
825          */
826         result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const;
827
828         /**
829          * @if OSPDEPREC
830          * Gets the index of the current top drawn list item.
831          *
832          * @brief       <i> [Deprecated] </i>
833          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
834          * @since               2.0
835          *
836          * @return              An error code
837          * @param[out]  groupIndex          The group index of the item
838          * @param[out]  itemIndex               The item index of the item
839          * @exception   E_SUCCESS               The method is successful.
840          * @exception   E_SYSTEM                A system error has occurred.
841          * @endif
842          */
843         result GetTopDrawnItemIndex(int& groupIndex, int& itemIndex) const;
844
845         /**
846          * @if OSPDEPREC
847          * Removes all the items of the %GroupedList control.
848          *
849          * @brief       <i> [Deprecated] </i>
850          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
851          * @since               2.0
852          *
853          * @return              An error code
854          * @exception   E_SUCCESS               The method is successful.
855          * @exception   E_SYSTEM                A system error has occurred.
856          * @remarks     The removed list items are deleted from the memory.
857          * @endif
858          */
859         result RemoveAllItems(void);
860
861         /**
862          * @if OSPDEPREC
863          * Removes all the checked items of the %GroupedList control.
864          *
865          * @brief       <i> [Deprecated] </i>
866          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
867          * @since               2.0
868          *
869          * @return              An error code
870          * @exception   E_SUCCESS               The method is successful.
871          * @exception   E_SYSTEM                A system error has occurred.
872          * @remarks     The removed list items are deleted from the memory.
873          * @endif
874          */
875         result RemoveAllCheckedItems(void);
876
877         /**
878          * @if OSPDEPREC
879          * Gets the specified item of the %GroupedList control.
880          *
881          * @brief       <i> [Deprecated] </i>
882          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
883          * @since               2.0
884          *
885          * @return              A custom list item
886          * @param[in]   groupIndex                      The index of the group which the item belongs to
887          * @param[in]   itemIndex                   The index of the item
888          * @exception   E_SUCCESS                       The method is successful.
889          * @exception   E_INVALID_ARG           The specified @c groupIndex or @c itemIndex is invalid.
890          * @exception   E_SYSTEM                        A system error has occurred.
891          * @endif
892          */
893         const CustomListItem* GetItemAt(int groupIndex, int itemIndex) const;
894
895         /**
896          * @if OSPDEPREC
897          * Scrolls to the bottom of the %GroupedList control.
898          *
899          * @brief       <i> [Deprecated] </i>
900          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
901          * @since       2.0
902          * @endif
903          */
904         void ScrollToBottom(void);
905
906         /**
907          * @if OSPDEPREC
908          * Scrolls to the top of the %GroupedList.
909          *
910          * @brief       <i> [Deprecated] </i>
911          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
912          * @since       2.0
913          * @endif
914          */
915         void ScrollToTop(void);
916
917         /**
918          * @if OSPDEPREC
919          * Scrolls to the item at the specified index. @n
920          * The specified item is drawn at the top of the %GroupedList control.
921          *
922          * @brief       <i> [Deprecated] </i>
923          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
924          * @since               2.0
925          *
926          * @return              An error code
927          * @param[in]   groupIndex              The group index
928          * @param[in]   itemIndex               The item index
929          * @exception   E_SUCCESS               The method is successful.
930          * @exception   E_INVALID_ARG   The specified @c groupIndex or @c itemIndex is invalid.
931          * @exception   E_SYSTEM                A system error has occurred.
932          * @endif
933          */
934         result ScrollToTop(int groupIndex, int itemIndex);
935
936         /**
937          * @if OSPDEPREC
938          * Scrolls to the group at the specified index. @n
939          * The specified group is drawn at the top of the %GroupedList control.
940          *
941          * @brief       <i> [Deprecated] </i>
942          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
943          * @since               2.0
944          *
945          * @return              An error code
946          * @param[in]   groupIndex              The group index
947          * @exception   E_SUCCESS               The method is successful.
948          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
949          * @exception   E_SYSTEM                A system error has occurred.
950          * @endif
951          */
952         result ScrollToTop(int groupIndex);
953
954         /**
955          * @if OSPDEPREC
956          * Sets the first index list of scroll by text.
957          *
958          * @brief       <i> [Deprecated] </i>
959          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
960          * @since               2.0
961          *
962          * @return              An error code
963          * @param[in]   text                    The text of the first index
964          * @exception   E_SUCCESS               The method is successful.
965          * @exception   E_SYSTEM                A system error has occurred.
966          * @endif
967          */
968         result SetFastScrollMainIndex(const Tizen::Base::String& text);
969
970         /**
971          * @if OSPDEPREC
972          * Adds the fast scroll event listener.
973          *
974          * @brief       <i> [Deprecated] </i>
975          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
976          * @since               2.0
977          *
978          * @param[in]   listener        The listener to add
979          * @endif
980          */
981         void AddFastScrollEventListener(Tizen::Ui::IFastScrollEventListener& listener);
982
983         /**
984          * @if OSPDEPREC
985          * Removes the fast scroll event listener.
986          *
987          * @brief       <i> [Deprecated] </i>
988          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
989          * @since               2.0
990          *
991          * @param[in]   listener        The listener to remove
992          * @endif
993          */
994         void RemoveFastScrollEventListener(Tizen::Ui::IFastScrollEventListener& listener);
995
996         /**
997          * @if OSPDEPREC
998          * Adds the grouped list item event listener.
999          *
1000          * @brief       <i> [Deprecated] </i>
1001          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
1002          * @since               2.0
1003          *
1004          * @param[in]   listener        The listener to add
1005          * @endif
1006          */
1007         void AddGroupedItemEventListener(Tizen::Ui::IGroupedItemEventListener& listener);
1008
1009         /**
1010          * @if OSPDEPREC
1011          * Removes the grouped list item event listener.
1012          *
1013          * @brief       <i> [Deprecated] </i>
1014          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
1015          * @since               2.0
1016          *
1017          * @param[in]   listener        The listener to remove
1018          * @endif
1019          */
1020         void RemoveGroupedItemEventListener(Tizen::Ui::IGroupedItemEventListener& listener);
1021
1022         /**
1023          * @if OSPDEPREC
1024          * Gets the index of the first checked list item.
1025          *
1026          * @brief       <i> [Deprecated] </i>
1027          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
1028          * @since               2.0
1029          *
1030          * @return              An error code
1031          * @param[out]  groupIndex          The group index of the item
1032          * @param[out]  itemIndex               The item index of the item
1033          * @exception   E_SUCCESS           The method is successful.
1034          * @exception   E_SYSTEM                A system error has occurred.
1035          * @endif
1036          */
1037         result GetFirstCheckedItemIndex(int& groupIndex, int& itemIndex) const;
1038
1039         /**
1040          * @if OSPDEPREC
1041          * Sets the checked status of all the items of the specified group with the given value.
1042          *
1043          * @brief       <i> [Deprecated] </i>
1044          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
1045          * @since               2.0
1046          *
1047          * @return              An error code
1048          * @param[in]   groupIndex          The group index of the item
1049          * @param[in]   check                   Set to @c true to check all the items, @n
1050          *                                                          else @c false
1051          * @exception   E_SUCCESS           The method is successful.
1052          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
1053          * @exception   E_SYSTEM                A system error has occurred.
1054          * @endif
1055          */
1056         result SetAllItemsChecked(int groupIndex, bool check);
1057
1058         /**
1059          * @if OSPDEPREC
1060          * Gets the index of the current bottom drawn list item.
1061          *
1062          * @brief       <i> [Deprecated] </i>
1063          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
1064          * @since               2.0
1065          *
1066          * @return              An error code
1067          * @param[out]  groupIndex          The group index of the item
1068          * @param[out]  itemIndex               The item index of the item
1069          * @exception   E_SUCCESS           The method is successful.
1070          * @exception   E_SYSTEM                A system error has occurred.
1071          * @endif
1072          */
1073         result GetBottomDrawnItemIndex(int& groupIndex, int& itemIndex) const;
1074
1075         /**
1076          * @if OSPDEPREC
1077          * Draws and shows the item of %GroupedList control.
1078          *
1079          * @brief       <i> [Deprecated] </i>
1080          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
1081          * @since                       2.0
1082          *
1083          * @return              An error code
1084          * @param[in]   groupIndex                      The group index
1085          * @param[in]   itemIndex                       The item index
1086          * @exception   E_SUCCESS                       The method is successful.
1087          * @exception   E_INVALID_ARG           The specified @c groupIndex or @c itemIndex is invalid.
1088          * @exception   E_INVALID_OPERATION     The item has never been drawn before calling this method.
1089          * @exception   E_SYSTEM                        A system error has occurred.
1090          * @endif
1091          */
1092         result RefreshItem(int groupIndex, int itemIndex);
1093
1094         /**
1095          * @if OSPDEPREC
1096          * Draws and shows the group of %GroupedList control.
1097          *
1098          * @brief       <i> [Deprecated] </i>
1099          * @deprecated  This class is deprecated. Instead of using this class, use GroupedListView class.
1100          * @since               2.0
1101          *
1102          * @return              An error code
1103          * @param[in]   groupIndex              The group index
1104          * @exception   E_SUCCESS               The method is successful.
1105          * @exception   E_INVALID_ARG   The specified @c groupIndex is invalid.
1106          * @exception   E_SYSTEM                A system error has occurred.
1107          * @endif
1108          */
1109         result RefreshGroup(int groupIndex);
1110
1111 private:
1112         //
1113         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1114         //
1115         GroupedList(const GroupedList& rhs);
1116
1117         //
1118         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1119         //
1120         GroupedList& operator =(const GroupedList& rhs);
1121
1122         friend class _GroupedListImpl;
1123 }; //GroupedList
1124 }}} // Tizen::Ui::Controls
1125 #endif // _FUI_CTRL_GROUPED_LIST_H_