Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / inc / FUiCtrlListView.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        FUiCtrlListView.h
20  * @brief       This is the header file for the %ListView class.
21  *
22  * This header file contains the declarations of the %ListView class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_LIST_VIEW_H_
26 #define _FUI_CTRL_LIST_VIEW_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FGrpRectangle.h>
31 #include <FUiContainer.h>
32 #include <FUiControl.h>
33 #include <FUiCtrlIFastScrollListener.h>
34 #include <FUiCtrlIListViewItemEventListener.h>
35 #include <FUiCtrlIListViewItemProvider.h>
36 #include <FUiCtrlIScrollEventListener.h>
37 #include <FUiCtrlListViewTypes.h>
38 #include <FUiIUiLinkEventListener.h>
39
40 namespace Tizen { namespace Ui { namespace Controls
41 {
42
43 class _ListViewImpl;
44
45 /**
46  * @class       ListView
47  * @brief   This class defines common behavior for a %ListView control.
48  *
49  * @since       2.0
50  *
51  * The %ListView class displays a list of simple and user-configured items. A simple item has a fixed layout consisting of a bitmap
52  * and a text string. A user-configured item in a %ListView instance can have a different layout and height than the other items.
53  * Each user-configured item is composed of elements that can be texts and bitmaps, and is configured using the CustomItem class.
54  *
55  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
56  *
57  * The following example demonstrates how to use the %ListView class.
58  *
59  *
60  * @code
61 //Sample code for ListViewSample.h
62 #include <FUi.h>
63
64 class ListViewSample
65         : public Tizen::Ui::Controls::Form
66         , public Tizen::Ui::Controls::IListViewItemEventListener
67         , public Tizen::Ui::Controls::IListViewItemProvider
68 {
69 public:
70         ListViewSample(void)
71         : __pListView(null)
72         , __pItemContext(null){}
73
74         bool Initialize(void);
75         virtual result OnInitializing(void);
76         virtual result OnTerminating(void);
77
78         // IListViewItemEventListener
79         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
80         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView &listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
81         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView &listView, int index, Tizen::Ui::Controls::SweepDirection direction);
82
83         // IListViewItemProvider
84         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
85         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
86         virtual int GetItemCount(void);
87
88 private:
89         static const int ID_FORMAT_STRING = 100;
90         static const int ID_FORMAT_BITMAP = 101;
91         static const int ID_CONTEXT_ITEM_1 = 103;
92         static const int ID_CONTEXT_ITEM_2 = 104;
93
94         Tizen::Graphics::Bitmap* __pHome;
95         Tizen::Graphics::Bitmap* __pMsg;
96         Tizen::Graphics::Bitmap* __pAlarm;
97         Tizen::Graphics::Bitmap* __pCall;
98
99         Tizen::Ui::Controls::ListView* __pListView;
100         Tizen::Ui::Controls::ListContextItem* __pItemContext;
101 };
102  *      @endcode
103  *
104  *      @code
105 //Sample code for ListViewSample.cpp
106 #include <FApp.h>
107 #include <FGraphics.h>
108
109 #include "ListViewSample.h"
110
111 using namespace Tizen::App;
112 using namespace Tizen::Base;
113 using namespace Tizen::Graphics;
114 using namespace Tizen::Media;
115 using namespace Tizen::Ui::Controls;
116
117 bool
118 ListViewSample::Initialize(void)
119 {
120         Construct(FORM_STYLE_NORMAL);
121         return true;
122 }
123
124 result
125 ListViewSample::OnInitializing(void)
126 {
127         result r = E_SUCCESS;
128
129         // Creates an instance of ListView
130         __pListView = new ListView();
131         __pListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, false);
132         __pListView->SetItemProvider(*this);
133         __pListView->AddListViewItemEventListener(*this);
134
135         // Adds the list view to the form
136         AddControl(*__pListView);
137
138         // Creates an instance of ListContextItem
139         __pItemContext = new ListContextItem();
140         __pItemContext->Construct();
141         __pItemContext->AddElement(ID_CONTEXT_ITEM_1, L"Test1");
142         __pItemContext->AddElement(ID_CONTEXT_ITEM_2, L"Test2");
143
144         // Gets instances of Bitmap
145         AppResource* pAppResource = Application::GetInstance()->GetAppResource();
146         __pHome = pAppResource->GetBitmapN(L"tizen.png");
147         __pMsg = pAppResource->GetBitmapN(L"tizen.png");
148         __pAlarm = pAppResource->GetBitmapN(L"tizen.png");
149         __pCall = pAppResource->GetBitmapN(L"tizen.png");
150
151         return r;
152 }
153
154 result
155 ListViewSample::OnTerminating(void)
156 {
157         result r = E_SUCCESS;
158
159         // Deallocates bitmaps
160         delete __pHome;
161         delete __pMsg;
162         delete __pAlarm;
163         delete __pCall;
164
165         // Deallocates the item context
166         delete __pItemContext;
167
168         return r;
169 }
170
171 // IListViewItemEventListener implementation
172 void
173 ListViewSample::OnListViewItemStateChanged(ListView &listView, int index, int elementId, ListItemStatus status)
174 {
175         switch (elementId)
176         {
177         case ID_FORMAT_BITMAP:
178                 {
179                         // ....
180                 }
181                 break;
182         case ID_FORMAT_STRING:
183                 {
184                         // ....
185                 }
186                 break;
187         default:
188                 break;
189         }
190 }
191
192 void
193 ListViewSample::OnListViewContextItemStateChanged(ListView &listView, int index, int elementId, ListContextItemStatus state)
194 {
195         switch (elementId)
196         {
197         case ID_CONTEXT_ITEM_1:
198                 {
199                         // ....
200                 }
201                 break;
202         case ID_CONTEXT_ITEM_2:
203                 {
204                         // ....
205                 }
206                 break;
207         default:
208                 break;
209         }
210 }
211
212 void
213 ListViewSample::OnListViewItemSwept(ListView &listView, int index, SweepDirection direction)
214 {
215         // ....
216 }
217
218 // IListViewItemProvider implementation
219 ListItemBase*
220 ListViewSample::CreateItem(int index, int itemWidth)
221 {
222         // Creates an instance of CustomItem
223         CustomItem* pItem = new CustomItem();
224         ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
225
226         switch (index % 4)
227         {
228         case 0:
229                 {
230                         style = LIST_ANNEX_STYLE_NORMAL;
231                         pItem->Construct(Dimension(itemWidth,112), style);
232                         pItem->AddElement(Rectangle(10, 20, 60, 60), ID_FORMAT_BITMAP, *__pHome, null, null);
233                         pItem->AddElement(Rectangle(80, 25, 150, 50), ID_FORMAT_STRING, L"Home", true);
234                 }
235                 break;
236         case 1:
237                 {
238                         style = LIST_ANNEX_STYLE_DETAILED;
239                         pItem->Construct(Dimension(itemWidth,112), style);
240                         pItem->AddElement(Rectangle(10, 20, 60, 60), ID_FORMAT_BITMAP, *__pMsg, null, null);
241                         pItem->AddElement(Rectangle(80, 25, 150, 50), ID_FORMAT_STRING, L"Msg", true);
242                 }
243                 break;
244         case 2:
245                 {
246                         style = LIST_ANNEX_STYLE_ONOFF_SLIDING;
247                         pItem->Construct(Dimension(itemWidth,112), style);
248                         pItem->AddElement(Rectangle(10, 20, 60, 60), ID_FORMAT_BITMAP, *__pAlarm, null, null);
249                         pItem->AddElement(Rectangle(80, 25, 150, 50), ID_FORMAT_STRING, L"Alarm", true);
250                 }
251                 break;
252         case 3:
253                 {
254                         style = LIST_ANNEX_STYLE_MARK;
255                         pItem->Construct(Dimension(itemWidth,112), style);
256                         pItem->AddElement(Rectangle(10, 20, 60, 60), ID_FORMAT_BITMAP, *__pCall, null, null);
257                         pItem->AddElement(Rectangle(80, 25, 150, 50), ID_FORMAT_STRING, L"Call", true);
258                 }
259                 break;
260         default:
261                 break;
262         }
263
264         pItem->SetContextItem(__pItemContext);
265
266         return pItem;
267 }
268
269 bool
270 ListViewSample::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
271 {
272         delete pItem;
273         pItem = null;
274         return true;
275 }
276
277 int
278 ListViewSample::GetItemCount(void)
279 {
280         return 15;
281 }
282  * @endcode
283  *
284  */
285 class _OSP_EXPORT_ ListView
286         : public Tizen::Ui::Control
287 {
288 public:
289         /**
290          * The object is not fully constructed after this constructor is
291          * called. For full construction, the Construct() method must be
292          * called right after calling this constructor.
293          *
294          * @since       2.0
295          */
296         ListView(void);
297
298         /**
299          * This destructor overrides Tizen::Base::Object::~Object().
300          *
301          * @since       2.0
302          */
303         virtual ~ListView(void);
304
305         /**
306          * @if OSPDEPREC
307          * Initializes this instance of %ListView with the specified parameters.
308          *
309          * @brief <i> [Deprecated]  </i>
310          * @deprecated  This method is deprecated.
311          * @since       2.0
312          *
313          * @return  An error code
314          * @param[in] rect                              An instance of the Graphics::Rectangle class @n
315          *                                                              This instance represents the x and y coordinates of the left top corner of the created %ListView along with the width
316          *                                                              and height.
317          * @param[in] itemDivider       Set to @c true to display an item divider, @n
318          *                                                              else @c false
319          * @param[in] fastScroll        Set to @c true to use fast scroll, @n
320          *                              else @c false
321          * @exception E_SUCCESS         The method is successful.
322          * @exception E_INVALID_ARG     A specified input parameter is invalid. @n
323          *                                                      Either the @c rect.width or @c rect.height parameter has a negative value.
324          * @exception E_SYSTEM          A system error has occurred.
325          * @endif
326          */
327         result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider = true, bool fastScroll = false);
328
329         /**
330          * Initializes this instance of %ListView with the specified parameters.
331          *
332          * @since 2.0
333          *
334          * @return  An error code
335          * @param[in] rect              An instance of the Graphics::Rectangle class @n
336          *                                                              This instance represents the x and y coordinates of the left top corner of the created %ListView along with the width
337          *                                                              and height.
338          * @param[in] itemDivider       Set to @c true to display an item divider, @n
339          *                                                              else @c false
340          * @param[in] scrollStyle       Set to scroll style
341          * @exception E_SUCCESS         The method is successful.
342          * @exception E_INVALID_ARG     A specified input parameter is invalid. @n
343          *                                                      Either the @c rect.width or @c rect.height parameter has a negative value.
344          * @exception E_SYSTEM          A system error has occurred.
345          */
346         result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, ListScrollStyle scrollStyle);
347
348         /**
349          * Sets the item provider that creates and deletes items for the list.
350          *
351          * @since       2.0
352          *
353          * @return  An error code
354          * @param[in] provider          The item provider to create and delete items
355          * @exception E_SUCCESS         The method is successful.
356          * @exception E_SYSTEM          A system error has occurred.
357          * @remarks  If an item provider is not set for the list, the list does not work. @n
358          *                      The specified @c provider should be allocated in heap memory.
359          */
360         result SetItemProvider(IListViewItemProvider& provider);
361
362
363         /**
364          * Adds a listener instance that listens to state changes of list view items. @n
365          * The added listener can listen to events on the specified event dispatcher's context when they are fired.
366          *
367          * @since       2.0
368          *
369          * @param[in] listener              The event listener to add
370          */
371         void AddListViewItemEventListener(IListViewItemEventListener& listener);
372
373         /**
374          * Removes a listener instance that listens to state changes of list view items. @n
375          * The removed listener cannot listen to events when they are fired.
376          *
377          * @since       2.0
378          *
379          * @param[in] listener                  The event listener to remove
380          */
381         void RemoveListViewItemEventListener(IListViewItemEventListener& listener);
382
383         /**
384          * Adds a listener instance that listens to state changes of a fast scroll. @n
385          * The added listener can listen to events on the specified event dispatcher's context when they are fired.
386          *
387          * @since       2.0
388          *
389          * @param[in] listener                  The event listener to add
390          */
391         void AddFastScrollListener(IFastScrollListener& listener);
392
393         /**
394          * Removes a listener instance that listens to state changes of a fast scroll. @n
395          * The removed listener cannot listen to events when they are fired.
396          *
397          * @since       2.0
398          *
399          * @param[in] listener                  The event listener to remove
400          */
401         void RemoveFastScrollListener(IFastScrollListener& listener);
402
403         /**
404          * Adds a listener instance that listens to state changes of a scroll event. @n
405          * The added listener can listen to events on the specified event dispatcher's context when they are fired.
406          *
407          * @since       2.0
408          *
409          * @param[in] listener          The event listener to add
410          * @see     IScrollEventListener::OnScrollEndReached()
411          * @see     RemoveScrollEventListener()
412          */
413         void AddScrollEventListener(IScrollEventListener& listener);
414
415         /**
416          * Removes a listener instance that listens to state changes of a scroll event. @n
417          * The removed listener cannot listen to events when they are fired.
418          *
419          * @since       2.0
420          *
421          * @param[in] listener                  The event listener to remove
422          * @see         IScrollEventListener::OnScrollEndReached()
423          * @see     AddScrollEventListener()
424          */
425         void RemoveScrollEventListener(IScrollEventListener& listener);
426
427         /**
428          * Adds a link event listener.
429          *
430          * @since       2.0
431          *
432          * @param[in] listener          The event listener to add
433          * @remarks  The added listener is notified when a link is selected by the user.
434          * @see     RemoveUiLinkEventListener()
435          */
436         void AddUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
437
438         /**
439          * Removes the specified link event listener. @n
440          * The removed listener cannot listen to events when they are fired.
441          *
442          * @since       2.0
443          *
444          * @param[in] listener          The event listener to remove
445          * @see     AddUiLinkEventListener()
446          */
447         void RemoveUiLinkEventListener(Tizen::Ui::IUiLinkEventListener& listener);
448
449         /**
450          * Sets the sweep event to enable.
451          *
452          * @since   2.0
453          *
454          * @return  An error code
455          * @param[in] enable                    Set to @c true to enable the sweep, @n
456          *                                                              else @c false
457          * @exception E_SUCCESS         The method is successful.
458          * @exception E_SYSTEM          A system error has occurred.
459          */
460         result SetSweepEnabled(bool enable);
461
462         /**
463          * Sets the index list of the scroll by texts.
464          *
465          * @since       2.0
466          *
467          * @return  An error code
468          * @param[in] text              The text of the index
469          * @param[in] useSearchIcon             Set to @c true to show the magnifying icon, @n
470          *                              else @c false
471          * @exception E_SUCCESS         The method is successful.
472          * @exception E_INVALID_ARG     A specified input parameter is invalid.
473          * @exception E_INVALID_STATE   This instance is in an invalid state.
474          * @exception E_SYSTEM          A system error has occurred.
475          */
476         result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon);
477
478         /**
479          * Gets the index of the top drawn item of the %ListView control.
480          *
481          * @since       2.0
482          *
483          * @return  The index of the top drawn item
484          */
485         int GetTopDrawnItemIndex(void) const;
486
487         /**
488          * Gets the index of the bottom drawn item of the %ListView control.
489          *
490          * @since       2.0
491          *
492          * @return  The index of the bottom drawn item
493          */
494         int GetBottomDrawnItemIndex(void) const;
495
496         /**
497          * Scrolls to the item at the specified index. @n
498          * The specified item is drawn at the top of the %ListView control.
499          *
500          * @since       2.0
501          *
502          * @return  An error code
503          * @param[in] index                             The item index
504          * @exception E_SUCCESS         The method is successful.
505          * @exception E_OUT_OF_RANGE    The specified input parameter is invalid.
506          * @exception E_SYSTEM          A system error has occurred.
507          */
508         result ScrollToItem(int index);
509
510         /**
511          * Scrolls to the item at the specified index. @n
512          * The specified item is drawn at the position specified by the item alignment.
513          *
514          * @since       2.0
515          *
516          * @return  An error code
517          * @param[in] index             The item index
518          * @param[in] itemAlignment             The item alignment
519          * @exception E_SUCCESS         The method is successful.
520          * @exception E_OUT_OF_RANGE    A specified input parameter is invalid.
521          * @exception E_SYSTEM          A system error has occurred.
522          */
523         result ScrollToItem(int index, ListScrollItemAlignment itemAlignment);
524
525         /**
526          * Sets the check status of the item at the specified index.
527          *
528          * @since       2.0
529          *
530          * @return  An error code
531          * @param[in] index             The item index
532          * @param[in] check                             The check status
533          * @exception E_SUCCESS             The method is successful.
534          * @exception E_OUT_OF_RANGE        A specified input parameter is invalid.
535          * @exception E_INVALID_OPERATION   The item is disabled.
536          * @exception E_SYSTEM              A system error has occurred.
537          */
538         result SetItemChecked(int index, bool check);
539
540         /**
541          * Checks whether the item at the specified index is checked.
542          *
543          * @since       2.0
544          *
545          * @return  @c true if the item is checked, @n
546          *          else @c false
547          * @param[in] index                             The item index
548          */
549         bool IsItemChecked(int index) const;
550
551         /**
552          * Sets the enabled/disabled status of the item at the specified index.
553          *
554          * @since       2.0
555          *
556          * @return      An error code
557          * @param[in] index             The item index
558          * @param[in] enable                    The enabled/disabled status
559          * @exception E_SUCCESS         The method is successful.
560          * @exception E_OUT_OF_RANGE    A specified input parameter is invalid.
561          * @exception E_SYSTEM          A system error has occurred.
562          *
563          */
564         result SetItemEnabled(int index, bool enable);
565
566         /**
567          * Checks whether the item at the specified index is enabled.
568          *
569          * @since       2.0
570          *
571          * @return  @c true if the item is enabled, @n
572          *          else @c false
573          * @param[in] index                             The item index
574          */
575         bool IsItemEnabled(int index) const;
576
577         /**
578          * Counts the number of items.
579          *
580          * @since       2.0
581          *
582          * @return  The total number of items
583          */
584         int GetItemCount(void) const;
585
586         /**
587          * Shows the description text of the given item.
588          *
589          * @since       2.0
590          *
591          * @return      An error code
592          * @param[in] index                             The index of the item
593          * @exception E_SUCCESS         The method is successful.
594          * @exception E_OUT_OF_RANGE    The specified input parameter is invalid.
595          * @exception E_SYSTEM          A system error has occurred.
596          * @remarks  If no description text is set to the item of the specified index, this method does not show the description text.
597          *
598          */
599         result ShowItemDescriptionText(int index);
600
601         /**
602          * Hides the description text of the given item.
603          *
604          * @since       2.0
605          *
606          * @return  An error code
607          * @param[in] index                             The index of the item
608          * @exception E_SUCCESS         The method is successful.
609          * @exception E_OUT_OF_RANGE    The specified input parameter is invalid.
610          * @exception E_SYSTEM          A system error has occurred.
611          */
612         result HideItemDescriptionText(int index);
613
614         /**
615          * Refreshes the specified item.
616          *
617          * @since       2.0
618          *
619          * @return  An error code
620          * @param[in] index             The item index
621          * @param[in] type              The item to be added, removed, or modified
622          * @exception E_SUCCESS            The method is successful.
623          * @exception E_OUT_OF_RANGE       A specified input parameter is invalid.
624          * @exception E_INVALID_OPERATION  The current state of the instance prohibits the execution of the specified operation.
625          * @exception E_SYSTEM             A system error has occurred.
626          * @remarks     3 refresh types are supported: LIST_REFRESH_TYPE_ITEM_ADD, LIST_REFRESH_TYPE_ITEM_REMOVE, and LIST_REFRESH_TYPE_ITEM_MODIFY.
627          *                      - LIST_REFRESH_TYPE_ITEM_ADD is used when new data is added to the data model. @n
628          *                      - LIST_REFRESH_TYPE_ITEM_REMOVE is used when a data is deleted from the data model. @n
629          *                      - LIST_REFRESH_TYPE_ITEM_MODIFY is used when an existing data has changes and needs to be updated. @n
630          *                         Calling this method with LIST_REFRESH_TYPE_ITEM_MODIFY invokes the item provider to call DeleteItem() and CreateItem() for the given index in
631          *                         sequence.
632          * @remarks  This method internally calls Invalidate(), so you do not need to call them to update the screen.
633          */
634         result RefreshList(int index, ListRefreshType type);
635
636         /**
637          * Refreshes the specified item's element.
638          *
639          * @since 2.0
640          *
641          * @return  An error code
642          * @param[in] index             The item index
643          * @param[in] elementId         The item element ID
644          * @exception E_SUCCESS            The method is successful.
645          * @exception E_OUT_OF_RANGE       A specified input parameter is invalid.
646          * @exception E_SYSTEM             A system error has occurred.
647          * @remarks  This method internally calls Invalidate(), so you do not need to call them to update the screen.
648          */
649         result RefreshList(int index, int elementId);
650
651         /**
652          * Updates the whole items of a list.
653          *
654          * @since       2.0
655          *
656          * @return  An error code
657          * @exception E_SUCCESS         The method is successful.
658          * @exception E_SYSTEM          A system error has occurred.
659          * @remarks     This method clears the items in the list and re-invokes the methods of the item provider to fill the list.
660          */
661         result UpdateList(void);
662
663         /**
664          * Gets the index of the item at the specified position.
665          *
666          * @since       2.0
667          *
668          * @return  The index of the item, @n
669          *                      else @c -1 if there is no list item at the specified position
670          * @param[in] x                                 The X position of the point
671          * @param[in] y                 The Y position of the point
672          * @remarks     The method returns -1 when there is no list item at the specified position.
673          */
674         int GetItemIndexFromPosition(int x, int y) const;
675
676         /**
677          * Gets the index of the item at the specified position.
678          *
679          * @since       2.0
680          *
681          * @return  The index of the item
682          * @param[in] position          The position of the point, @n
683          *                                                      else @c -1 if there is no list item at the specified position
684          */
685         int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const;
686
687         /**
688          * Gets the index of the item and ID of the element at the specified position.
689          *
690          * @since       2.0
691          *
692          * @return  An error code
693          * @param[in] x                 The X position of the item
694          * @param[in] y                 The Y position of the item
695          * @param[out] itemIndex                The index of the item
696          * @param[out] elementId        The ID of the element
697          * @exception E_SUCCESS         The method is successful.
698          * @exception E_SYSTEM          A system error has occurred, or @n
699          *                                                              there is no item at the specified position.
700          * @remarks     The specified @c itemIndex is -1 when there is no list item at the specified position.
701          * @remarks  The specified @c elementId is -1 when there is no element at the specified position.
702          */
703         result GetItemIndexFromPosition(int x, int y, int& itemIndex, int& elementId) const;
704
705         /**
706          * Gets the index of the item and ID of the element at the specified position.
707          *
708          * @since       2.0
709          *
710          * @return  An error code
711          * @param[in] position          The position of the point
712          * @param[out] itemIndex        The index of the item
713          * @param[out] elementId                The ID of the element
714          * @exception E_SUCCESS         The method is successful.
715          * @exception E_SYSTEM          A system error has occurred, or @n
716          *                                                              there is no item at the specified position.
717          * @remarks     The specified @c itemIndex is -1 when there is no list item at the specified position.
718          * @remarks The specified @c elementId is -1 when there is no element at the specified position.
719          */
720         result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& itemIndex, int& elementId) const;
721
722         /**
723          * Sets the color of a division line between items.
724          *
725          * @since       2.0
726          *
727          * @return  An error code
728          * @param[in] color                             The division line color
729          * @exception E_SUCCESS         The method is successful.
730          */
731         result SetItemDividerColor(const Tizen::Graphics::Color& color);
732
733         /**
734          * Gets the color of a division line between items.
735          *
736          * @since       2.0
737          *
738          * @return  The color of a section, @n
739          *                      else RGBA(0, 0, 0, 0) if the instance is invalid
740          */
741         Tizen::Graphics::Color GetItemDividerColor(void) const;
742
743         /**
744          * Sets the background color of this control.
745          *
746          * @since       2.0
747          *
748          * @return  An error code
749          * @param[in] color                             The background color
750          * @exception E_SUCCESS                 The method is successful.
751          * @remarks  The method sets the alpha value of the specified @c color to @c 255, when a device does not support 32bit color space. @n
752          *          The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only
753          *                      the bitmap image is displayed.
754          */
755         result SetBackgroundColor(const Tizen::Graphics::Color& color);
756
757         /**
758          * Gets the background color of this control.
759          *
760          * @since       2.0
761          *
762          * @return      The background color, @n
763          *                      else RGBA(0, 0, 0, 0) if the instance is invalid
764          */
765         Tizen::Graphics::Color GetBackgroundColor(void) const;
766
767         /**
768          * Sets the bitmap of this control.
769          *
770          * @since 2.0
771          *
772          * @return  An error code
773          * @param[in] pBitmap           The bitmap for the list
774          * @exception E_SUCCESS         The method is successful.
775          * @exception E_SYSTEM          A system error has occurred.
776          */
777         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
778
779         /**
780          * Sets the bitmap of the empty list.
781          *
782          * @since   2.0
783          *
784          * @return  An error code
785          * @param[in] pBitmap           The bitmap for the empty list
786          * @exception E_SUCCESS         The method is successful.
787          * @exception E_SYSTEM          A system error has occurred.
788          */
789         result SetBitmapOfEmptyList(const Tizen::Graphics::Bitmap* pBitmap);
790
791         /**
792          * Sets the text of the empty list.
793          *
794          * @since    2.0
795          *
796          * @return   An error code
797          * @param[in] text              The text for the empty list
798          * @exception E_SUCCESS         The method is successful.
799          * @exception E_SYSTEM          A system error has occurred.
800          */
801         result SetTextOfEmptyList(const Tizen::Base::String& text);
802
803         /**
804          * Gets the text to display when there is no item in a list.
805          *
806          * @since       2.0
807          *
808          * @return      The text to display, @n
809          *                      else an empty string if the instance is invalid
810          */
811         Tizen::Base::String GetTextOfEmptyList(void) const;
812
813         /**
814          * Sets a color of the text to display when there is no item in a list.
815          *
816          * @since       2.0
817          *
818          * @return  An error code
819          * @param[in] color             The color of the text to display
820          * @exception E_SUCCESS         The method is successful.
821          * @exception E_SYSTEM          A system error has occurred.
822          */
823         result SetTextColorOfEmptyList(const Tizen::Graphics::Color& color);
824
825         /**
826          * Gets a color of the text to display when there is no item in a list.
827          *
828          * @since       2.0
829          *
830          * @return  The color of the text to display
831          */
832         Tizen::Graphics::Color GetTextColorOfEmptyList(void) const;
833
834         /**
835          * Begins the reordering mode.
836          *
837          * @since 2.0
838          *
839          * @return  An error code
840          * @exception E_SUCCESS         The method is successful.
841          * @exception E_SYSTEM          A system error has occurred.
842          * @see    IListViewItemEventListener::OnListViewItemReordered()
843          */
844         result BeginReorderingMode(void);
845
846         /**
847          * Ends the reordering mode.
848          *
849          * @since 2.0
850          *
851          * @return  An error code
852          * @exception E_SUCCESS         The method is successful.
853          * @exception E_SYSTEM          A system error has occurred.
854          * @see    IListViewItemEventListener::OnListViewItemReordered()
855          */
856         result EndReorderingMode(void);
857
858         /**
859          * Checks whether the %ListView control is in reordering mode.
860          *
861          * @since 2.0
862          *
863          * @return      @c true if the %ListView is in reordering mode, @n
864          *              else @c false
865          */
866         bool IsInReorderingMode(void) const;
867
868 protected:
869         friend class _ListViewImpl;
870
871 private:
872         //
873         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
874         //
875         ListView(const ListView& rhs);
876
877         //
878         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
879         //
880         ListView& operator =(const ListView& rhs);
881 }; // ListView
882
883 }}} // Tizen::Ui::Controls
884
885 #endif  // _FUI_CTRL_LIST_VIEW_H_