Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiCtrlCustomList.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  * @file        FUiCtrlCustomList.h
20  * @brief       This is the header file for the %CustomList class.
21  *
22  * This header file contains the declarations of the %CustomList class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_CUSTOM_LIST_H_
26 #define _FUI_CTRL_CUSTOM_LIST_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FGrpRectangle.h>
31 #include <FUiControl.h>
32 #include <FUiContainer.h>
33 #include <FUiCtrlCustomListTypes.h>
34 #include <FUiICustomItemEventListener.h>
35 #include <FUiCtrlCustomListItem.h>
36 #include <FUiCtrlListTypes.h>
37
38 namespace Tizen { namespace Ui { namespace Controls
39 {
40
41 /**
42  * @if OSPDEPREC
43  * @class               CustomList
44  * @brief       <i> [Deprecated] </i> This class defines the common behavior of a %CustomList control.
45  *
46  * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
47  * @since               2.0
48  *
49  * The %CustomList class represents a list which has user-configured items. An item in a custom list can have
50  * different layout and height than the other items. Each item is composed of elements, which can be texts and bitmaps
51  * and is configured using CustomListItem and CustomListItemFormat.
52  *
53  * When an item in a custom list is selected or deselected, an item event is generated. It is passed on to all item event listeners
54  * that have registered an interest in item events generated by the custom list. If an application wants to perform tasks when a custom
55  * list item is selected and deselected, it must implement ICustomItemEventListener and register the listener to receive events from
56  * the custom list by calling the custom list's AddCustomItemEventListener() method.
57  *
58  * Note that CustomListItem and CustomListItemFormat need to be created on a heap. The items of a custom list are deleted automatically
59  * when the %CustomList control is destroyed. If you want to remove certain list items, you must use RemoveItemAt(). CustomListItemFormat
60  * must be deleted by the application.
61  *
62  * Refer to CustomListItem and CustomListItemFormat.
63  *
64  * Example:
65  *
66  * @image html ui_controls_customlist.png
67  *
68  *
69  * This is a simple UI application that uses a %CustomList control.
70  *
71  *
72  * @code
73 //Sample code for CustomListSample.h
74 #include <FUi.h>
75
76 // Forward Declaration
77 class CustomListElement;
78
79 class CustomListSample
80         : public Tizen::Ui::Controls::Form
81         , public Tizen::Ui::ICustomItemEventListener
82 {
83 public:
84         CustomListSample(void)
85         : __pCustomList(null)
86         , __pCustomListItemFormat(null)
87         , __pListElement(null){}
88
89         bool Initialize(void);
90         result AddListItem(Tizen::Ui::Controls::CustomList& customList, Tizen::Base::String itemText,
91                                 Tizen::Graphics::Bitmap* pBitmapNormal, Tizen::Graphics::Bitmap* pBitmapFocused);
92
93         virtual result OnInitializing(void);
94         virtual result OnTerminating(void);
95
96         // ICustomItemEventListener
97         virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, Tizen::Ui::ItemStatus status);
98         virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, int elementId, Tizen::Ui::ItemStatus status);
99
100 private:
101         static const int ID_LIST_ITEM = 101;
102         static const int ID_LIST_TEXT = 102;
103         static const int ID_LIST_BITMAP = 103;
104         static const int ID_FORMAT_CUSTOM = 104;
105
106         Tizen::Ui::Controls::CustomList* __pCustomList;
107         Tizen::Ui::Controls::CustomListItemFormat* __pCustomListItemFormat;
108         CustomListElement* __pListElement;
109 };
110  *      @endcode
111  *
112  *      @code
113 // Sample code for CutomListSample.cpp
114 #include <FApp.h>
115 #include <FGraphics.h>
116
117 #include "CustomListSample.h"
118
119 using namespace Tizen::App;
120 using namespace Tizen::Base;
121 using namespace Tizen::Graphics;
122 using namespace Tizen::Ui;
123 using namespace Tizen::Ui::Controls;
124
125 class CustomListElement
126         : public ICustomListElement
127 {
128 public:
129         result
130         DrawElement(const Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& rect, CustomListItemStatus itemStatus)
131         {
132                 result r = E_SUCCESS;
133
134                 Canvas* pCanvas = const_cast<Canvas*>(&canvas);
135
136                 pCanvas->SetLineWidth(5);
137                 pCanvas->SetForegroundColor(Color::GetColor(COLOR_ID_GREEN));
138                 if (pCanvas->DrawRectangle(rect) != E_SUCCESS)
139                 {
140                         return r;
141                 }
142
143                 if (pCanvas->DrawText(Point(rect.x+20, rect.y+20), L"Custom") != E_SUCCESS)
144                 {
145                         return r;
146                 }
147
148                 return r;
149         }
150 };
151
152 bool
153 CustomListSample::Initialize()
154 {
155         Construct(FORM_STYLE_NORMAL);
156         return true;
157 }
158
159 result
160 CustomListSample::OnInitializing(void)
161 {
162         result r = E_SUCCESS;
163
164         // Creates an instance of CustomListElement
165         __pListElement = new CustomListElement();
166
167         // Creates an instance of CustomList
168         __pCustomList = new CustomList();
169         __pCustomList->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), CUSTOM_LIST_STYLE_NORMAL);
170         __pCustomList->AddCustomItemEventListener(*this);
171
172         // Creates an instance of CustomListItemFormat
173         __pCustomListItemFormat = new CustomListItemFormat();
174         __pCustomListItemFormat->Construct();
175         __pCustomListItemFormat->AddElement(ID_LIST_TEXT, Rectangle(10, 25, 150, 80));
176         __pCustomListItemFormat->AddElement(ID_LIST_BITMAP, Rectangle(170, 10, 70, 80));
177         __pCustomListItemFormat->AddElement(ID_FORMAT_CUSTOM, Rectangle(GetClientAreaBounds().width - 120, 20, 100, 60));
178         __pCustomListItemFormat->SetElementEventEnabled(ID_LIST_TEXT, true);
179         __pCustomListItemFormat->SetElementEventEnabled(ID_LIST_BITMAP, true);
180         __pCustomListItemFormat->SetElementEventEnabled(ID_FORMAT_CUSTOM, true);
181
182         // Gets instances of Bitmap
183         AppResource* pAppResource = Application::GetInstance()->GetAppResource();
184         Bitmap *pBitmapNormal  = pAppResource->GetBitmapN(L"tizen.png");
185         Bitmap *pBitmapFocused = pAppResource->GetBitmapN(L"tizen.png");
186
187         // Adds the item to the custom list
188         for (int i = 0; i < 30; i++)
189         {
190                 String str = L"Text";
191                 str.Append(i+1);
192                 AddListItem(*__pCustomList, str, pBitmapNormal, pBitmapFocused);
193         }
194
195         // Adds the custom list to the form
196         AddControl(*__pCustomList);
197
198         // Deallocates bitmaps
199         delete pBitmapNormal;
200         delete pBitmapFocused;
201
202         return r;
203 }
204
205 result
206 CustomListSample::OnTerminating(void)
207 {
208         result r = E_SUCCESS;
209
210         // Deallocates item format and the element
211         delete __pCustomListItemFormat;
212         delete __pListElement;
213
214         return r;
215 }
216
217 result
218 CustomListSample::AddListItem(CustomList& customList, String itemText, Bitmap* pBitmapNormal, Bitmap* pBitmapFocused)
219 {
220         // Creates an instance of CustomListItem
221         CustomListItem* pItem = new CustomListItem();
222
223         pItem->Construct(100);
224         pItem->SetItemFormat(*__pCustomListItemFormat);
225         pItem->SetElement(ID_LIST_TEXT, itemText);
226         pItem->SetElement(ID_LIST_BITMAP, *pBitmapNormal, pBitmapFocused);
227         pItem->SetElement(ID_FORMAT_CUSTOM, *(static_cast<ICustomListElement *>(__pListElement)));
228
229         customList.AddItem(*pItem, ID_LIST_ITEM);
230
231         return E_SUCCESS;
232 }
233
234 // ICustomItemEventListener implementation
235 void
236 CustomListSample::OnItemStateChanged(const Control& source, int index, int itemId, ItemStatus status)
237 {
238         switch (itemId)
239         {
240         case ID_LIST_ITEM:
241                 {
242                         // ....
243                 }
244                 break;
245         default:
246                 break;
247         }
248 }
249
250 void
251 CustomListSample::OnItemStateChanged(const Control& source, int index, int itemId, int elementId, Tizen::Ui::ItemStatus status)
252 {
253         switch (itemId)
254         {
255         case ID_LIST_ITEM:
256                 {
257                         switch (elementId)
258                         {
259                         case ID_LIST_TEXT:
260                                 {
261                                         // ....
262                                 }
263                                 break;
264
265                         case ID_LIST_BITMAP:
266                                 {
267                                         // ....
268                                 }
269                                 break;
270                         default:
271                                 break;
272                         }
273                 }
274                 break;
275         default:
276                 break;
277         }
278 }
279  * @endcode
280  * @endif
281  */
282 class _OSP_EXPORT_ CustomList
283         : public Tizen::Ui::Control
284 {
285 public:
286         /**
287          * @if OSPDEPREC
288          * 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.
289          *
290          * @brief       <i> [Deprecated] </i>
291          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
292          * @since               2.0
293          * @endif
294          */
295         CustomList(void);
296
297         /**
298          * @if OSPDEPREC
299          * 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.
300          *
301          * @brief       <i> [Deprecated] </i>
302          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
303          * @since               2.0
304          * @endif
305          */
306         virtual ~CustomList(void);
307
308 public:
309         /**
310          * @if OSPDEPREC
311          * Initializes this instance of %CustomList with the specified parameters.
312          *
313          * @brief       <i> [Deprecated] </i>
314          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
315          * @since           2.0
316          *
317          * @return      An error code
318          * @param[in]   rect                The x and y position of the top-left corner of the %CustomList control along with the width and height of the control
319          * @param[in]   style               The style set of %CustomList
320          * @param[in]   itemDivider                     Set to @c true to display the divider, @n
321          *                                                              else @c false
322          * @exception   E_SUCCESS           The method is successful.
323          * @exception   E_INVALID_ARG     A specified input parameter is invalid.
324          * @exception   E_SYSTEM            A system error has occurred.
325          * @remarks     The size of the control must be within the range as defined by the minimum and maximum size.
326          * @remarks     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.
327          * @endif
328          */
329         result Construct(const Tizen::Graphics::Rectangle& rect, CustomListStyle style, bool itemDivider = true);
330
331
332         /**
333          * @if OSPDEPREC
334          * Adds the custom item event listener instance. @n
335          * The added listener gets notified when the state of CustomListItem is changed.
336          *
337          * @brief       <i> [Deprecated] </i>
338          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
339          * @since               2.0
340          *
341          * @param[in]   listener        The event listener to add
342          * @endif
343          */
344         void AddCustomItemEventListener(Tizen::Ui::ICustomItemEventListener& listener);
345
346         /**
347          * @if OSPDEPREC
348          * Removes the custom item event listener instance. @n
349          * The removed listener is not notified even when custom item events are fired.
350          *
351          * @brief       <i> [Deprecated] </i>
352          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
353          * @since               2.0
354          *
355          * @param[in]   listener        The event listener to remove
356          * @endif       
357          */
358         void RemoveCustomItemEventListener(Tizen::Ui::ICustomItemEventListener& listener);
359
360         /**
361          * @if OSPDEPREC
362          * Adds the specified item to the %CustomList control.
363          *
364          * @brief       <i> [Deprecated] </i>
365          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
366          * @since               2.0
367          *
368          * @return              An error code
369          * @param[in]   item                            The custom list item to add
370          * @param[in]   itemId                  The item ID for the item
371          * @exception   E_SUCCESS                       The method is successful.
372          * @exception   E_SYSTEM                        A system error has occurred.
373          * @remarks     The specified @c itemId can be used to identify a specific CustomListItem or @n
374          *                              to associate user-allocated resources. @n
375          *                              Note that the custom list does not throw an exception @n
376          *              if the same itemID is assigned to multiple items. @n
377          * @remarks             The added item is deleted automatically when the list is destroyed. @n
378          *                              Do not add, insert, or set an item that already belongs to the %CustomList control.
379          * @endif
380          */
381         result AddItem(const CustomListItem& item, int itemId = LIST_ITEM_UNSPECIFIED_ID);
382
383         /**
384          * @if OSPDEPREC
385          * Inserts the specified item to %CustomList at the specified index.
386          *
387          * @brief       <i> [Deprecated] </i>
388          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
389          * @since               2.0
390          *
391          * @return      An error code
392          * @param[in]   index                   The index at which to insert the item
393          * @param[in]   item                            The custom list item to insert
394          * @param[in]   itemId                  The item ID for the item
395          * @exception   E_SUCCESS                       The method is successful.
396          * @exception   E_INVALID_ARG           A specified input parameter is invalid. @n
397          *                                                                      The specified @c index is less than @c 0 or greater than or equal to the item count.
398          * @exception   E_SYSTEM                        A system error has occurred.
399          * @remarks             The inserted item is deleted automatically when the list is destroyed. @n
400          *                              Do not add, insert, or set an item that already belongs to the %CustomList control.
401          * @endif
402          */
403         result InsertItemAt(int index, const CustomListItem& item, int itemId = LIST_ITEM_UNSPECIFIED_ID);
404
405         /**
406          * @if OSPDEPREC
407          * Sets the contents of the item at the specified index in the %CustomList control.
408          *
409          * @brief       <i> [Deprecated] </i>
410          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
411          * @since               2.0
412          *
413          * @return              An error code
414          * @param[in]   index                   The index at which to set the contents of the item
415          * @param[in]   item                    The custom list item to set
416          * @param[in]   itemId                  The item ID for the item
417          * @exception   E_SUCCESS               The method is successful.
418          * @exception   E_INVALID_ARG           A specified input parameter is invalid. @n
419          *                                      The specified @c index is less than @c 0 or greater than or equal to the item count.
420          * @exception   E_SYSTEM                        A system error has occurred.
421          * @remarks             Do not add, insert, or set an item that already belongs to the %CustomList control.
422          * @endif
423          */
424         result SetItemAt(int index, const CustomListItem& item, int itemId = LIST_ITEM_UNSPECIFIED_ID);
425
426         /**
427          * @if OSPDEPREC
428          * Removes the item at the specified index in the %CustomList control.
429          *
430          * @brief       <i> [Deprecated] </i>
431          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
432          * @since               2.0
433          *
434          * @return              An error code
435          * @param[in]   index                           The index of the item to delete
436          * @exception   E_SUCCESS                       The method is successful.
437          * @exception   E_INVALID_ARG           The specified input parameter is invalid. @n
438          *                                                                      The specified @c index is less than @c 0 or greater than or equal to the item count.
439          * @exception   E_SYSTEM                        A system error has occurred.
440          * @remarks     The removed list item is deleted from the memory.
441          * @endif
442          */
443         result RemoveItemAt(int index);
444
445         /**
446          * @if OSPDEPREC
447          * Removes all the items from the %CustomList control.
448          *
449          * @brief       <i> [Deprecated] </i>
450          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
451          * @since               2.0
452          *
453          * @return              An error code
454          * @exception   E_SUCCESS                       The method is successful.
455          * @exception   E_SYSTEM                        A system error has occurred.
456          * @remarks     The removed list items are deleted from the memory.
457          * @endif
458          */
459         result RemoveAllItems(void);
460
461         /**
462          * @if OSPDEPREC
463          * Gets the item at the specified index in the %CustomList control.
464          *
465          * @brief       <i> [Deprecated] </i>
466          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
467          * @since               2.0
468          *
469          * @return              A custom list item, @n
470          *              else @c null if the specified index is out of range
471          * @param[in]   index       The index of the item to get
472          * @endif
473          */
474         const CustomListItem* GetItemAt(int index) const;
475
476         /**
477          * @if OSPDEPREC
478          * Gets the number of items in the %CustomList control.
479          *
480          * @brief       <i> [Deprecated] </i>
481          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
482          * @since               2.0
483          *
484          * @return              The number of items in %CustomList, @n
485          *              else @c -1 if an error occurs
486          * @endif
487          */
488         int GetItemCount(void) const;
489
490         /**
491          * @if OSPDEPREC
492          * Enables or disables the status of the item at the specified @c index in the %CustomList control.
493          *
494          * @brief       <i> [Deprecated] </i>
495          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
496          * @since               2.0
497          *
498          * @return              An error code
499          * @param[in]   index                           The index of the item whose status is to set
500          * @param[in]   enable                          Set to @c true to enable, @n
501          *                                                                      else @c false
502          * @exception   E_SUCCESS                       The method is successful.
503          * @exception   E_SYSTEM                        A system error has occurred.
504          * @endif
505          */
506         result SetItemEnabled(int index, bool enable);
507
508         /**
509          * @if OSPDEPREC
510          * Checks whether the specified index in the %CustomList control is enabled.
511          *
512          * @brief       <i> [Deprecated] </i>
513          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
514          * @since               2.0
515          *
516          * @return      @c true if the item is enabled, @n
517          *                              else @c false
518          * @param[in]   index   The index of the item to check
519          * @endif
520          */
521         bool IsItemEnabled(int index) const;
522
523         /**
524          * @if OSPDEPREC
525          * Sets the check status of the item at the specified index in the %CustomList control.
526          *
527          * @brief       <i> [Deprecated] </i>
528          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
529          * @since               2.0
530          *
531          * @return              An error code
532          * @param[in]   index                           The index of the item to set
533          * @param[in]   check                           The check status
534          * @exception   E_SUCCESS                       The method is successful.
535          * @exception   E_SYSTEM                        A system error has occurred.
536          * @remarks             This method can only be used when the style of the list allows selection.
537          * @endif
538          */
539         result SetItemChecked(int index, bool check);
540
541         /**
542          * @if OSPDEPREC
543          * Checks whether the item at the specified index is checked in the %CustomList control.
544          *
545          * @brief       <i> [Deprecated] </i>
546          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
547          * @since               2.0
548          *
549          * @return              @c true if the item is checked, @n
550          *                              else @c false
551          * @param[in]   index           The index of the item to check
552          * @remarks             This method can only be used when the style of the list allows selection.
553          * @endif
554          */
555         bool IsItemChecked(int index) const;
556
557         /**
558          * @if OSPDEPREC
559          * Sets the check status for all items of the %CustomList control.
560          *
561          * @brief       <i> [Deprecated] </i>
562          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
563          * @since               2.0
564          *
565          * @return              An error code
566          * @param[in]   check                           The check status
567          * @exception   E_SUCCESS                       The method is successful.
568          * @exception   E_SYSTEM                        A system error has occurred.
569          * @remarks     This method can only be used when the style of the list allows multiple selections.
570          * @endif
571          */
572         result SetAllItemsChecked(bool check);
573
574
575         /**
576          * @if OSPDEPREC
577          * Removes the checked items of the %CustomList control.
578          *
579          * @brief       <i> [Deprecated] </i>
580          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
581          * @since               2.0
582          *
583          * @return              An error code
584          * @exception   E_SUCCESS                       The method is successful.
585          * @exception   E_SYSTEM                        A system error has occurred.
586          * @remarks             This method can only be used when the style of the list allows multiple selections.
587          * @remarks     The removed list items are deleted from the memory.
588          * @endif
589          */
590         result RemoveAllCheckedItems(void);
591
592         /**
593          * @if OSPDEPREC
594          * Gets the first item of all the checked items in the %CustomList control.
595          *
596          * @brief       <i> [Deprecated] </i>
597          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
598          * @since               2.0
599          *
600          * @return      The index of the first checked item, @n
601          *              else @c -1 if no item is checked or an error occurs
602          * @endif
603          */
604         int GetFirstCheckedItemIndex(void) const;
605
606         /**
607          * @if OSPDEPREC
608          * Gets the last item of all the checked items in the %CustomList control.
609          *
610          * @brief       <i> [Deprecated] </i>
611          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
612          * @since               2.0
613          *
614          * @return      The index of the last checked item, @n
615          *              else @c -1 if no item is checked or an error occurs
616          * @endif
617          */
618         int GetLastCheckedItemIndex(void) const;
619
620         /**
621          * @if OSPDEPREC
622          * Gets the next checked item from the specified index in the %CustomList control.
623          *
624          * @brief       <i> [Deprecated] </i>
625          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
626          * @since               2.0
627          *
628          * @return      The index of the next checked item @n
629          *              else @c -1 if no more item after the specified index is checked, @n
630          *              or the specified @c index is less than @c 0 or greater than the item count.
631          * @param[in]   index           The index of the %CustomList control item
632          * @endif
633          */
634         int GetNextCheckedItemIndexAfter(int index) const;
635
636         /**
637          * @if OSPDEPREC
638          * Gets the index of the item at the specified position.
639          *
640          * @brief       <i> [Deprecated] </i>
641          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
642          * @since               2.0
643          *
644          * @return              The index of the item, @n
645          *                              else @c -1 if the specified position is not inside any of the items
646          * @param[in] x The x position of the point
647          * @param[in] y The y position of the point
648          * @endif
649          */
650         int GetItemIndexFromPosition(int x, int y) const;
651
652         /**
653          * @if OSPDEPREC
654          * Gets the index of the item at the specified position.
655          *
656          * @brief       <i> [Deprecated] </i>
657          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
658          * @since               2.0
659          *
660          * @return      The index of the item, @n
661          *                              else @c -1 if the specified position is not inside any of the items
662          * @param[in]   position    The position of the point
663          * @endif
664          */
665         int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const;
666
667         /**
668          * @if OSPDEPREC
669          * Gets the index of the first item from the visible items in the %CustomList control.
670          *
671          * @brief       <i> [Deprecated] </i>
672          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
673          * @since               2.0
674          *
675          * @return      The index of the first item, @n
676          *              else @c -1 if no item is visible
677          * @endif
678          */
679         int GetTopDrawnItemIndex(void) const;
680
681         /**
682          * @if OSPDEPREC
683          * Gets the index of the last item from the visible items in the %CustomList control.
684          *
685          * @brief       <i> [Deprecated] </i>
686          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
687          * @since               2.0
688          *
689          * @return      The index of the last item, @n
690          *              else @c -1 if no item is visible
691          * @endif
692          */
693         int GetBottomDrawnItemIndex(void) const;
694
695         /**
696          * @if OSPDEPREC
697          * Sets the background color of the %CustomList control.
698          *
699          * @brief       <i> [Deprecated] </i>
700          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
701          * @since       2.0
702          *
703          * @param[in]   color    The background color
704          * @endif
705          */
706         void SetBackgroundColor(const Tizen::Graphics::Color& color);
707
708         /**
709          * @if OSPDEPREC
710          * Sets the text to be displayed when there is no item in the %CustomList control.
711          *
712          * @brief       <i> [Deprecated] </i>
713          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
714          * @since               2.0
715          *
716          * @param[in]   text    The text message to display
717          * @endif
718          */
719         void SetTextOfEmptyList(const Tizen::Base::String& text);
720
721         /**
722          * @if OSPDEPREC
723          * Sets the color of the text to be displayed when there is no item in the %CustomList control.
724          *
725          * @brief       <i> [Deprecated] </i>
726          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
727          * @since       2.0
728          *
729          * @param[in]   color   The color of the text to display
730          * @endif
731          */
732         void SetTextColorOfEmptyList(const Tizen::Graphics::Color& color);
733
734         /**
735          * @if OSPDEPREC
736          * Gets the color of the text to display when there is no item in the CustomList control.
737          *
738          * @brief       <i> [Deprecated] </i>
739          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
740          * @since       2.0
741          *
742          * @return              The color of the text to be displayed
743          * @endif
744          */
745         Tizen::Graphics::Color GetTextColorOfEmptyList(void) const;
746
747         /**
748          * @if OSPDEPREC
749          * Gets the index of the item.
750          *
751          * @brief       <i> [Deprecated] </i>
752          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
753          * @since               2.0
754          *
755          * @return      The index of the item, @n
756          *              else @c -1 if no item has the specified item ID
757          * @param[in]   itemId          The item ID of the %CustomList control item
758          * @remarks     One or more indexes can have the same item ID, @n
759          *                              and this method returns the first item from such items.
760          * @endif
761          */
762         int GetItemIndexFromItemId(int itemId) const;
763
764         /**
765          * @if OSPDEPREC
766          * Gets the item ID of the item at the specified index.
767          *
768          * @brief       <i> [Deprecated] </i>
769          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
770          * @since               2.0
771          *
772          * @return              The item ID of the item, @n
773          *                              else @c -1 if the specified @c index is less than @c 0 or greater than the item count
774          * @param[in]   index   The index of the %CustomList control item
775          * @endif
776          */
777         int GetItemIdAt(int index) const;
778
779         /**
780          * @if OSPDEPREC
781          * Scrolls to the bottom of the %CustomList control.
782          *
783          * @brief       <i> [Deprecated] </i>
784          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
785          * @since               2.0
786          * @endif
787          */
788         void ScrollToBottom(void);
789
790         /**
791          * @if OSPDEPREC
792          * Scrolls to the top of the %CustomList.
793          *
794          * @brief       <i> [Deprecated] </i>
795          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
796          * @since               2.0
797          * @endif
798          */
799         void ScrollToTop(void);
800
801         /**
802          * @if OSPDEPREC
803          * Scrolls to the item at the specified index. @n
804          * The specified item is drawn at the top of the %CustomList control.
805          *
806          * @brief       <i> [Deprecated] </i>
807          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
808          * @since               2.0
809          *
810          * @return              An error code
811          * @param[in]   index                           The index of the %CustomList control item
812          * @exception   E_SUCCESS                       The method is successful.
813          * @exception   E_SYSTEM                        A system error has occurred.
814          * @exception   E_INVALID_ARG           The specified input parameter is invalid. @n
815          *                                                      The specified @c index is less than @c 0 or greater than the item count.
816          * @endif
817          */
818         result ScrollToTop(int index);
819
820         /**
821          * @if OSPDEPREC
822          * Draws and shows the item at the specified index in the %CustomList control.
823          *
824          * @brief       <i> [Deprecated] </i>
825          * @deprecated  This class is deprecated. Instead of using this class, use ListView class.
826          * @since                       2.0
827          *
828          * @return      An error code
829          *
830          * @param[in]   index                                   The index of the %CustomList control item
831          * @exception   E_SUCCESS                               The method is successful.
832          * @exception   E_SYSTEM                A system error has occurred.
833          * @exception   E_INVALID_OPERATION             The item has never been drawn before calling this method.
834          * @exception   E_INVALID_ARG           The specified input parameter is invalid. @n
835          *                                                                              The specified @c index is less than @c 0 or greater than the item count.
836          * @endif
837          */
838         result RefreshItem(int index);
839
840 private:
841         //
842         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
843         //
844         CustomList(const CustomList& rhs);
845
846         //
847         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
848         //
849         CustomList& operator =(const CustomList& rhs);
850
851         friend class _CustomListImpl;
852
853 }; //CustomList
854
855 }}} //Tizen::Ui::Controls
856
857 #endif // _FUI_CTRL_CUSTOM_LIST_H_