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