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