Merge "apply header review on Popup, ProgressPopup and MessageBox" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiCtrlIconListView.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        FUiCtrlIconListView.h
20  * @brief       This is the header file for the %IconListView class.
21  *
22  * This header file contains the declarations of the %IconListView class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_ICON_LIST_VIEW_H_
26 #define _FUI_CTRL_ICON_LIST_VIEW_H_
27
28 //Includes
29 #include <FGrpFloatRectangle.h>
30 #include <FOspConfig.h>
31 #include <FUiContainer.h>
32 #include <FUiCtrlControlsTypes.h>
33 #include <FUiCtrlIconListViewTypes.h>
34 #include <FUiCtrlIIconListViewItemEventListener.h>
35 #include <FUiCtrlIIconListViewItemProvider.h>
36 #include <FUiCtrlIScrollEventListener.h>
37 #include <FUiCtrlIScrollEventListenerF.h>
38 #include <FUiCtrlListViewTypes.h>
39 #include <FUiCtrlScrollPanelTypes.h>
40
41 namespace Tizen { namespace Ui { namespace Controls
42 {
43
44 /**
45  * @class       IconListView
46  * @brief   This class defines the common behavior for a %IconListView control.
47  *
48  * @since       2.0
49  *
50  * The %IconListView class displays a 2-dimentional list of bitmap images and icons.
51  *
52  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
53  *
54  * The following example demonstrates how to use the %IconListView class.
55  *
56  * @code
57 //Sample code for IconListViewSample.h
58 #include <FUi.h>
59
60 class IconListViewSample
61         : public Tizen::Ui::Controls::Form
62         , public Tizen::Ui::Controls::IIconListViewItemProvider
63         , public Tizen::Ui::Controls::IIconListViewItemEventListener
64 {
65 public:
66         IconListViewSample(void)
67         : __pIconListView(null){}
68
69         bool Initialize(void);
70         virtual result OnInitializing(void);
71         virtual result OnTerminating(void);
72
73         // IIconListViewItemEventListener
74         virtual void OnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView &view, int index, Tizen::Ui::Controls::IconListViewItemStatus status);
75
76         //IIconListViewItemProvider
77         virtual Tizen::Ui::Controls::IconListViewItem* CreateItem(int index);
78         virtual bool DeleteItem(int index, Tizen::Ui::Controls::IconListViewItem* pItem);
79         virtual int GetItemCount(void);
80
81 private:
82         Tizen::Graphics::Bitmap* __pHome;
83         Tizen::Graphics::Bitmap* __pMsg;
84         Tizen::Graphics::Bitmap* __pAlarm;
85
86         Tizen::Ui::Controls::IconListView* __pIconListView;
87 };
88  *      @endcode
89  *
90  *      @code
91 //Sample code for IconListViewSample.cpp
92 #include <FApp.h>
93 #include <FGraphics.h>
94
95 #include "IconListViewSample.h"
96
97 using namespace Tizen::App;
98 using namespace Tizen::Base;
99 using namespace Tizen::Graphics;
100 using namespace Tizen::Ui;
101 using namespace Tizen::Ui::Controls;
102
103 bool
104 IconListViewSample::Initialize(void)
105 {
106         Construct(FORM_STYLE_NORMAL);
107         return true;
108 }
109
110 result
111 IconListViewSample::OnInitializing(void)
112 {
113         result r = E_SUCCESS;
114
115         // Creates an instance of IconListView
116         __pIconListView = new IconListView();
117         __pIconListView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height),
118                         Dimension(100, 100), ICON_LIST_VIEW_STYLE_NORMAL, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
119         __pIconListView->SetItemProvider(*this);
120         __pIconListView->AddIconListViewItemEventListener(*this);
121
122         // Adds the icon list view to the form
123         AddControl(*__pIconListView);
124
125         // Gets instances of Bitmap
126         AppResource* pAppResource = Application::GetInstance()->GetAppResource();
127         __pHome  = pAppResource->GetBitmapN(L"home.png");
128         __pMsg = pAppResource->GetBitmapN(L"message.png");
129         __pAlarm  = pAppResource->GetBitmapN(L"alarm.png");
130
131         return r;
132 }
133
134 result
135 IconListViewSample::OnTerminating(void)
136 {
137         result r = E_SUCCESS;
138
139         // Deallocates bitmaps
140         delete __pHome;
141         delete __pMsg;
142         delete __pAlarm;
143
144         return r;
145 }
146
147 int
148 IconListViewSample::GetItemCount(void)
149 {
150         return 3;
151 }
152
153 IconListViewItem*
154 IconListViewSample::CreateItem(int index)
155 {
156         // Creates an instance of IconListViewItem
157         IconListViewItem* pIconListview = new IconListViewItem();
158
159         // Creates an instance of String
160         String* pStr = new String();
161
162         switch (index % 3)
163         {
164         case 0:
165                 {
166                         *pStr = L"Home";
167                         pIconListview->Construct(*__pHome, pStr);
168                 }
169                 break;
170         case 1:
171                 {
172                         *pStr = L"Msg";
173                         pIconListview->Construct(*__pMsg, pStr);
174                 }
175                 break;
176         case 2:
177                 {
178                         *pStr = L"Alarm";
179                         pIconListview->Construct(*__pAlarm, pStr);
180                 }
181                 break;
182         }
183
184         // Deallocates the string
185         delete pStr;
186
187         return pIconListview;
188 }
189
190 bool
191 IconListViewSample::DeleteItem(int index, IconListViewItem* pItem)
192 {
193         delete pItem;
194         return true;
195 }
196
197 void
198 IconListViewSample::OnIconListViewItemStateChanged (IconListView &view, int index, IconListViewItemStatus status)
199 {
200         switch (index)
201         {
202         case 0:
203                 {
204                         // ....
205                 }
206                 break;
207         case 1:
208                 {
209                         // ....
210                 }
211                 break;
212         default:
213                 break;
214         }
215 }
216  * @endcode
217  *
218  */
219 class _OSP_EXPORT_ IconListView
220         : public Tizen::Ui::Control
221 {
222 public:
223         /**
224          * The object is not fully constructed after this constructor is called. For full construction, the Construct(const Tizen::Graphics::Rectangle&, const Tizen::Graphics::Dimension&, IconListViewStyle, IconListViewScrollDirection, IconListViewScrollStyle) method must be called right after calling this constructor.
225          *
226          * @since       2.0
227          */
228         IconListView(void);
229
230         /**
231          * This destructor overrides Tizen::Base::Object::~Object().
232          *
233          * @since       2.0
234          */
235         virtual ~IconListView(void);
236
237 public:
238         /**
239          * Initializes this instance of %IconListView with the specified parameters.
240          *
241          * @since 2.0
242          *
243          * @return      An error code
244          * @param[in]   rect                            An instance of the Tizen::Graphics::Rectangle class @n
245          *                                                                      This instance represents the x and y coordinates of the top-left corner of the created %IconListView along with
246          *                                                                      the width and height.
247          * @param[in]   itemBitmapSize          The size of an icon in %IconListView
248          * @param[in]   style                           The style set of %IconListView
249          * @param[in]   direction                       The direction of scroll
250          * @param[in]   scrollStyle                     The scroll style of %IconListView
251          * @exception   E_SUCCESS                       The method is successful.
252          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
253          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
254          * @exception   E_SYSTEM                        A system error has occurred.
255          * @remarks     A control is fully usable only after it has been added to a container, therefore some methods may fail if used earlier.
256          * @remarks     The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and margins. @n
257          *                      %IconListView cannot display more than @c 256 items on the screen at once.
258          * @remarks     The actual size of bitmap to be displayed in %IconListView is smaller than the specified size when the border style is @c ICON_LIST_VIEW_ITEM_BORDER_STYLE_SHADOW.
259          */
260         result Construct(const Tizen::Graphics::Rectangle& rect, const Tizen::Graphics::Dimension& itemBitmapSize, IconListViewStyle style = ICON_LIST_VIEW_STYLE_NORMAL, IconListViewScrollDirection direction = ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL, IconListViewScrollStyle scrollStyle = ICON_LIST_SCROLL_STYLE_FADE_OUT);
261
262         /**
263          * Initializes this instance of %IconListView with the specified parameters.
264          *
265          * @since   2.1
266          *
267          * @return      An error code
268          * @param[in]   rect                            An instance of the Tizen::Graphics::FloatRectangle class @n
269          *                                                                      This instance represents the x and y coordinates of the top-left corner of the created %IconListView along with
270          *                                                                      the width and height.
271          * @param[in]   itemBitmapSize          The size of an icon in %IconListView
272          * @param[in]   style                           The style set of %IconListView
273          * @param[in]   direction                       The direction of scroll
274          * @param[in]   scrollStyle                     The scroll style of %IconListView
275          * @exception   E_SUCCESS                       The method is successful.
276          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
277          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
278          * @exception   E_SYSTEM                        A system error has occurred.
279          * @remarks     A control is fully usable only after it has been added to a container, therefore some methods may fail if used earlier.
280          * @remarks     The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and margins. @n
281          *                      %IconListView cannot display more than @c 256 items on the screen at once.
282          * @remarks     The actual size of bitmap to be displayed in %IconListView is smaller than the specified size when the border style is @c ICON_LIST_VIEW_ITEM_BORDER_STYLE_SHADOW.
283          */
284         result Construct(const Tizen::Graphics::FloatRectangle& rect, const Tizen::Graphics::FloatDimension& itemBitmapSize, IconListViewStyle style = ICON_LIST_VIEW_STYLE_NORMAL, IconListViewScrollDirection direction = ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL, IconListViewScrollStyle scrollStyle = ICON_LIST_SCROLL_STYLE_FADE_OUT);
285
286         /**
287          * Sets the item provider that creates and deletes items for the %IconListView control.
288          *
289          * @since   2.0
290          *
291          * @return      An error code
292          * @param[in]   provider                        The item provider to create and delete items
293          * @exception   E_SUCCESS                       The method is successful.
294          * @exception   E_SYSTEM                        A system error has occurred.
295          * @remarks     If an item provider is not set for %IconListView, it does not work. @n
296          *                      The specified @c provider should be allocated in heap memory.
297          */
298         result SetItemProvider(IIconListViewItemProvider& provider);
299
300         /**
301          * Adds a listener instance. @n
302          * The added listener can listen to item events when they are fired.
303          *
304          * @since   2.0
305          *
306          * @param[in]   listener                        The listener to add
307          */
308         void AddIconListViewItemEventListener(IIconListViewItemEventListener& listener);
309
310         /**
311          * Removes a listener instance. @n
312          * The removed listener cannot listen to events when they are fired.
313          *
314          * @since   2.0
315          *
316          * @param[in]   listener                        The listener to remove
317          */
318         void RemoveIconListViewItemEventListener(IIconListViewItemEventListener& listener);
319
320         /**
321          * Adds a listener instance that listens to state changes of a scroll event. @n
322          * The added listener can listen to events on the context of the given event dispatcher when they are fired.
323          *
324          * @since   2.0
325          *
326          * @param[in]   listener                        The event listener to add
327          * @see                 IScrollEventListener::OnScrollEndReached()
328          * @see                 RemoveScrollEventListener()
329          */
330         void AddScrollEventListener(IScrollEventListener& listener);
331
332         /**
333          * Adds a listener instance that listens to state changes of a scroll event. @n
334          * The added listener can listen to events on the context of the given event dispatcher when they are fired.
335          *
336          * @since   2.1
337          *
338          * @param[in]   listener                        The event listener to add
339          * @see                 IScrollEventListenerF::OnScrollEndReached()
340          * @see                 RemoveScrollEventListener()
341          */
342         void AddScrollEventListener(IScrollEventListenerF& listener);
343
344         /**
345          * Removes a listener instance that listens to state changes of a scroll event. @n
346          * The removed listener cannot listen to events when they are fired.
347          *
348          * @since   2.0
349          *
350          * @param[in]   listener                        The event listener to remove
351          * @see                 IScrollEventListener::OnScrollEndReached()
352          * @see                 RemoveScrollEventListener()
353          */
354         void RemoveScrollEventListener(IScrollEventListener& listener);
355
356         /**
357          * Removes a listener instance that listens to state changes of a scroll event. @n
358          * The removed listener cannot listen to events when they are fired.
359          *
360          * @since   2.1
361          *
362          * @param[in]   listener                        The event listener to remove
363          * @see                 IScrollEventListenerF::OnScrollEndReached()
364          * @see                 RemoveScrollEventListener()
365          */
366         void RemoveScrollEventListener(IScrollEventListenerF& listener);
367
368         /**
369          * Sets the background bitmap of %IconListView.
370          *
371          * @since   2.0
372          *
373          * @param[in]   pBitmap                         The background bitmap
374          * @exception   E_SUCCESS                       The method is successful.
375          * @exception   E_SYSTEM                        A system error has occurred.
376          * @remarks     When @c pBitmap is @c null, %IconListView does not have a background bitmap. The default value for the background bitmap is @c null.
377          * @remarks     The background bitmap has priority over the background color. When both the background bitmap and the background color are specified,
378          *                      only the bitmap is displayed.
379          */
380         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
381
382         /**
383          * Sets the background color of this control.
384          *
385          * @since   2.0
386          *
387          * @return      An error code
388          * @param[in]   color               The background color
389          * @exception   E_SUCCESS                       The method is successful.
390          * @remarks     This method sets the alpha value of the specified color to @c 255, when a device does not support @c 32 bit color space.
391          * @remarks     The background bitmap has priority over the background color. When both the background bitmap and the background color are specified,
392          *                      only the bitmap is displayed.
393          */
394         result SetBackgroundColor(const Tizen::Graphics::Color& color);
395
396         /**
397          * Gets the background color of this control.
398          *
399          * @since       2.0
400          *
401          * @return      The background color, @n
402          *                      else RGBA(0, 0, 0, 0) if an error occurs
403          */
404         Tizen::Graphics::Color GetBackgroundColor(void) const;
405
406         /**
407          * Sets the margin of %IconListView.
408          *
409          * @since   2.0
410          *
411          * @return      An error code
412          * @param[in]   type                            The type of margin
413          * @param[in]   value                           The marginal value
414          * @exception   E_SUCCESS                       The method is successful.
415          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
416          * @exception   E_SYSTEM                        A system error has occurred.
417          * @remarks     The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and
418          *                      margins. %IconListView cannot display more than @c 256 items on screen at once.
419          */
420         result SetMargin(MarginType type, int value);
421
422         /**
423          * Sets the margin of %IconListView.
424          *
425          * @since   2.1
426          *
427          * @return      An error code
428          * @param[in]   type                            The type of margin
429          * @param[in]   value                           The marginal value
430          * @exception   E_SUCCESS                       The method is successful.
431          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
432          * @exception   E_SYSTEM                        A system error has occurred.
433          * @remarks     The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and
434          *                      margins. The %IconListView cannot display more than 256 items on screen at once.
435          */
436         result SetMargin(MarginType type, float value);
437
438         /**
439          * Gets the margin of %IconListView.
440          *
441          * @since   2.0
442          *
443          * @return      The marginal value of %IconListView, @n
444          *                      else @c -1 if an error occurs
445          * @param[in]   type                            The type of margin
446          */
447         int GetMargin(MarginType type) const;
448
449         /**
450          * Gets the margin of %IconListView.
451          *
452          * @since   2.1
453          *
454          * @return      The marginal value of %IconListView, @n
455          *                      else @c -1 if an error occurs
456          * @param[in]   type                            The type of margin
457          */
458         float GetMarginF(MarginType type) const;
459
460         /**
461          * Sets the horizontal and vertical spacing between the items.
462          *
463          * @since   2.0
464          *
465          * @return      An error code
466          * @param[in]   horizontalSpacing       The spacing between items in horizontal direction
467          * @param[in]   verticalSpacing         The spacing between items in vertical direction
468          * @exception   E_SUCCESS                       The method is successful.
469          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
470          * @exception   E_SYSTEM                        A system error has occurred.
471          * @remarks     The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and
472          *                      margins. %IconListView cannot display more than @c 256 items on screen at once.
473          */
474         result SetItemSpacing(int horizontalSpacing, int verticalSpacing);
475
476         /**
477          * Sets the horizontal and vertical spacing between the items.
478          *
479          * @since   2.1
480          *
481          * @return      An error code
482          * @param[in]   horizontalSpacing       The spacing between items in horizontal direction
483          * @param[in]   verticalSpacing         The spacing between items in vertical direction
484          * @exception   E_SUCCESS                       The method is successful.
485          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
486          * @exception   E_SYSTEM                        A system error has occurred.
487          * @remarks     The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and
488          *                      margins. The %IconListView cannot display more than 256 items on screen at once.
489          */
490         result SetItemSpacing(float horizontalSpacing, float verticalSpacing);
491
492         /**
493          * Gets the horizontal spacing between items of %IconListView.
494          *
495          * @since   2.0
496          *
497          * @return      The value of space between items in horizontal direction, @n
498          *                      else @c -1 if an error occurs
499          */
500         int GetItemHorizontalSpacing(void) const;
501
502         /**
503          * Gets the horizontal spacing between items of %IconListView.
504          *
505          * @since   2.1
506          *
507          * @return      The value of space between items in horizontal direction, @n
508          *                      else @c -1 if an error occurs
509          */
510         float GetItemHorizontalSpacingF(void) const;
511
512         /**
513          * Gets the vertical spacing between items of %IconListView.
514          *
515          * @since   2.0
516          *
517          * @return      The value of space between items in vertical direction, @n
518          *                      else @c -1 if an error occurs
519          */
520         int GetItemVerticalSpacing(void) const;
521
522         /**
523          * Gets the vertical spacing between items of %IconListView.
524          *
525          * @since   2.1
526          *
527          * @return      The value of space between items in vertical direction, @n
528          *                      else @c -1 if an error occurs
529          */
530         float GetItemVerticalSpacingF(void) const;
531
532         /**
533          * Sets the checked status of the specified item of %IconListView.
534          *
535          * @since   2.0
536          *
537          * @return      An error code
538          * @param[in]   index                           The index of the %IconListView item
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          * @exception   E_OUT_OF_RANGE          The specified @c index is out of range.
543          * @remarks     This method can only be used when the style of the list allows selection.
544          * @remarks     This method only changes the state of the list item. %IconListView needs to be redrawn to reflect the change on the screen.
545          */
546         result SetItemChecked(int index, bool check);
547
548         /**
549          * Checks whether the specified @c item is checked.
550          *
551          * @since   2.0
552          *
553          * @return      @c true if the specified @c item is checked, @n
554          *                      else @c false
555          * @param[in]   index                           The index of the item
556          * @remarks  This method can only be used when the style of the list allows selection.
557          */
558         bool IsItemChecked(int index) const;
559
560         /**
561          * Gets the index of the item at the specified position.
562          *
563          * @since   2.0
564          *
565          * @return      The index of the item, @n
566          *                      else @c -1 if there is no list item at the specified position or if the %IconListView instance is invalid
567          * @param[in]   x                   The x position of a point
568          * @param[in]   y                   The y position of a point
569          */
570         int GetItemIndexFromPosition(int x, int y) const;
571
572         /**
573          * Gets the index of the item at the specified @c position.
574          *
575          * @since   2.1
576          *
577          * @return      The index of the item, @n
578          *                      else @c -1 if there is no list item at the specified position or if the %IconListView instance is invalid
579          * @param[in]   x                   The x position of a point
580          * @param[in]   y                   The y position of a point
581          */
582         int GetItemIndexFromPosition(float x, float y) const;
583
584         /**
585          * Gets the index of the item at the specified position.
586          *
587          * @since   2.0
588          *
589          * @return      The index of the item, @n
590          *                      else @c -1 if there is no list item at the specified @c position or if the %IconListView instance is invalid
591          * @param[in]   position            The position of a point
592          */
593         int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const;
594
595         /**
596          * Gets the index of the item at the specified position.
597          *
598          * @since   2.1
599          *
600          * @return      The index of the item, @n
601          *                      else @c -1 if there is no list item at the specified @c position or if the %IconListView instance is invalid
602          * @param[in]   position            The position of a point
603          */
604         int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const;
605
606         /**
607          * Sets the horizontal alignment of the text of an item.
608          *
609          * @since   2.0
610          *
611          * @return      An error code
612          * @param[in]   alignment                       The horizontal alignment of the text
613          * @exception   E_SUCCESS                       The method is successful.
614          * @exception   E_SYSTEM                        A system error has occurred.
615          */
616         result SetTextHorizontalAlignment(HorizontalAlignment alignment);
617
618         /**
619          * Sets the vertical alignment of the text of an item.
620          *
621          * @since   2.0
622          *
623          * @return      An error code
624          * @param[in]   alignment                       The vertical alignment of the text
625          * @exception   E_SUCCESS                       The method is successful.
626          * @exception   E_SYSTEM                        A system error has occurred.
627          */
628         result SetTextVerticalAlignment(IconListViewItemTextVerticalAlignment alignment);
629
630         /**
631          * Gets the horizontal alignment of the text of the %IconListView control.
632          *
633          * @since   2.0
634          *
635          * @return      The horizontal alignment of the text, @n
636          *                      else @c ALIGNMENT_LEFT when the %IconListView instance is invalid
637          */
638         HorizontalAlignment GetTextHorizontalAlignment(void) const;
639
640         /**
641          * Gets the vertical alignment of the text of the current %IconListView.
642          *
643          * @since   2.0
644          *
645          * @return      The vertical alignment of the text of an item, @n
646          *                      else @c ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_TOP when the %IconListView instance is invalid
647          */
648         IconListViewItemTextVerticalAlignment GetTextVerticalAlignment(void) const;
649
650         /**
651          * Sets the text of the empty list.
652          *
653          * @since   2.0
654          *
655          * @return      An error code
656          * @param[in]   text                The text of the empty list
657          * @exception   E_SUCCESS                       The method is successful.
658          * @exception   E_SYSTEM                        A system error has occurred.
659          */
660         result SetTextOfEmptyList(const Tizen::Base::String& text);
661
662         /**
663          * Gets the text to display when there is no item in the list.
664          *
665          * @since       2.0
666          *
667          * @return  The text to be displayed, @n
668          *                      else an empty string if the instance is invalid
669          */
670         Tizen::Base::String GetTextOfEmptyList(void) const;
671
672         /**
673          * Sets the color of the text that is displayed when %IconListView contains no item.
674          *
675          * @since   2.0
676          *
677          * @return      An error code
678          * @param[in]   color               The color of the text
679          * @exception   E_SUCCESS                       The method is successful.
680          * @exception   E_SYSTEM                        A system error has occurred.
681          */
682         result SetTextColorOfEmptyList(const Tizen::Graphics::Color& color);
683
684         /**
685          * Gets the color of the text to display when there is no item in the list.
686          *
687          * @since   2.0
688          *
689          * @return  The color of the text to be displayed, @n
690          *                      else RGBA(0, 0, 0, 0) if the instance is invalid
691          */
692         Tizen::Graphics::Color GetTextColorOfEmptyList(void) const;
693
694         /**
695          * Sets the text color of the item.
696          *
697          * @since   2.0
698          *
699          * @return      An error code
700          * @param[in]   status                          The drawing status of items
701          * @param[in]   color               The color of the text
702          * @exception   E_SUCCESS                       The method is successful.
703          * @exception   E_SYSTEM                        A system error has occurred.
704          */
705         result SetItemTextColor(IconListViewItemDrawingStatus status, const Tizen::Graphics::Color& color);
706
707         /**
708          * Gets the text color of the item.
709          *
710          * @since   2.0
711          *
712          * @return      The color of the text, @n
713          *                      else RGBA(0, 0, 0, 0) if the instance is invalid
714          * @param[in]   status                          The drawing status of items
715          */
716         Tizen::Graphics::Color GetItemTextColor(IconListViewItemDrawingStatus status) const;
717
718         /**
719          * Sets the size of the text of the %IconListView control.
720          *
721          * @since   2.0
722          *
723          * @return      An error code
724          * @param[in]   size                            The size of the text
725          * @exception   E_SUCCESS                       The method is successful.
726          * @exception   E_INVALID_ARG           The specified input parameter is invalid.
727          * @exception   E_SYSTEM                        A system error has occurred.
728          * @remarks     If the specified @c size is less than the minimum size, this method fails. The minimum font size is @c 6 on devices of high screen density.
729          */
730         result SetItemTextSize(int size);
731
732         /**
733          * Sets the size of the text of the %IconListView control.
734          *
735          * @since   2.1
736          *
737          * @return      An error code
738          * @param[in]   size                            The size of the text
739          * @exception   E_SUCCESS                       The method is successful.
740          * @exception   E_INVALID_ARG           The specified input parameter is invalid.
741          * @exception   E_SYSTEM                        A system error has occurred.
742          * @remarks     If the specified @c size is less than the minimum size, this method fails. The minimum font size is @c 6 on devices of high screen density.
743          */
744         result SetItemTextSize(float size);
745
746         /**
747          * Gets the size of the text of the %IconListView control.
748          *
749          * @since   2.0
750          *
751          * @return  The size of the text of the %IconListView control, @n
752          *                      else @c -1 if the instance is invalid
753          */
754         int GetItemTextSize(void) const;
755
756         /**
757          * Gets the size of the text of the %IconListView control.
758          *
759          * @since   2.1
760          *
761          * @return  The size of the text of the %IconListView control, @n
762          *                      else @c -1 if the instance is invalid
763          */
764         float GetItemTextSizeF(void) const;
765
766         /**
767          * Sets the position of the checkbox of the %IconListView control.
768          *
769          * @since   2.0
770          *
771          * @return      An error code
772          * @param[in]   position                        The position of the checkbox of the %IconListView control
773          * @exception   E_SUCCESS                       The method is successful.
774          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation. @n
775          *                                                                      That is, %IconListView cannot get the position of the checkbox when the style is @c ICON_LIST_VIEW_STYLE_NORMAL.
776          * @exception   E_SYSTEM                        A system error has occurred.
777          * @remarks  This method changes the position of the checkbox image displayed for the "selected" item(s),
778          *                      when the style of %IconListView is either @c ICON_LIST_VIEW_STYLE_RADIO or @c ICON_LIST_VIEW_STYLE_MARK.
779          */
780         result SetCheckBoxPosition(IconListViewCheckBoxPosition position);
781
782         /**
783          * Gets the position of the checkbox of the %IconListView control.
784          *
785          * @since   2.0
786          *
787          * @return      The position of the checkbox
788          * @remarks     This method returns @c ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT when the style of %IconListView is @c ICON_LIST_VIEW_STYLE_NORMAL or
789          *                      @c ICON_LIST_VIEW_STYLE_DIVIDE_TEXT.
790          */
791         IconListViewCheckBoxPosition GetCheckBoxPosition(void) const;
792
793         /**
794          * Enables or disables touch animation.
795          *
796          * @since   2.0
797          *
798          * @return      An error code
799          * @param[in]   enable                          Set to @c true to enable touch animation, @n
800          *                                  else @c false
801          * @exception   E_SUCCESS                       The method is successful.
802          * @exception   E_SYSTEM                        A system error has occurred.
803          * @remarks     If you want to use a separate selected bitmap, the animation effect must be disabled.
804          * @remarks     In case a touch animation is disabled, the normal bitmap of IconListViewItem is displayed in response to touch interaction if the
805          *                      selected bitmap of %IconListViewItem is @c null.
806          */
807         result SetTouchAnimationEnabled(bool enable);
808
809         /**
810          * Checks whether touch animation is enabled.
811          *
812          * @since   2.0
813          *
814          * @return      @c true if touch animation is enabled, @n
815          *          else @c false if touch animation is disabled or if the instance is invalid
816          */
817         bool IsTouchAnimationEnabled(void) const;
818
819         /**
820          * Scrolls the list contents to the specified @c index.
821          *
822          * @since   2.0
823          *
824          * @return      An error code
825          * @param[in]   index                           The index of the item
826          * @exception   E_SUCCESS                       The method is successful.
827          * @exception   E_SYSTEM                        A system error has occurred.
828          * @exception   E_OUT_OF_RANGE          The specified @c index is out of range.
829          */
830         result ScrollToItem(int index);
831
832         /*
833          * Scrolls the list contents with the amount of pixels.
834          *
835          * @since 2.1
836          *
837          * @return      An error code
838          * @param[in]   pixel                           The amount of pixels to scroll
839          * @exception   E_SUCCESS                       The method is successful.
840          * @exception   E_OUT_OF_RANGE          The specified @c pixel is out of range.
841          * @remarks     If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return @c E_OUT_OF_RANGE.
842          *                      Likewise, in case of positive @c pixel on the bottom position of scroll it will also return @c E_OUT_OF_RANGE.
843          */
844         result ScrollByPixel(int pixel);
845
846         /*
847          * Scrolls the list contents with the amount of pixels.
848          *
849          * @since 2.1
850          *
851          * @return      An error code
852          * @param[in]   pixel                           The amount of pixels to scroll
853          * @exception   E_SUCCESS                       The method is successful.
854          * @exception   E_OUT_OF_RANGE          The specified @c pixel is out of range.
855          * @remarks     If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return @c E_OUT_OF_RANGE.
856          *                      Likewise, in case of positive @c pixel on the bottom position of scroll it will also return @c E_OUT_OF_RANGE.
857          */
858         result ScrollByPixel(float pixel);
859
860         /**
861          * Refreshes the specified item of %IconListView.
862          *
863          * @since   2.0
864          *
865          * @return      An error code
866          * @param[in]   index                           The index of the %IconListView item
867          * @param[in]   type                            The type of change of an item
868          * @exception   E_SUCCESS                       The method is successful.
869          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation. @n
870          *                                      That is, %IconListView cannot execute RefreshList() before first drawn.
871          * @exception   E_SYSTEM                        A system error has occurred.
872          * @exception   E_OUT_OF_RANGE          The specified @c index is out of range.
873          */
874         result RefreshList(int index, ListRefreshType type);
875
876         /**
877          * Updates the whole items of a list.
878          *
879          * @since       2.0
880          *
881          * @return  An error code
882          * @exception   E_SUCCESS           The method is successful.
883          * @exception   E_SYSTEM            A system error has occurred.
884          * @remarks  This method clears items in the list and re-invokes the methods of the item provider to fill the list.
885          */
886         result UpdateList(void);
887
888         /**
889          * Gets the size of bitmap of the item.
890          *
891          * @since       2.0
892          *
893          * @return      An error code
894          * @param[out]  width                           The width of bitmap of the item
895          * @param[out]  height                          The height of bitmap of the item
896          * @exception   E_SUCCESS                       The method is successful.
897          * @exception   E_INVALID_STATE         This instance is in an invalid state.
898          */
899         result GetItemBitmapSize(int& width, int& height) const;
900
901         /**
902          * Gets the size of bitmap of the item.
903          *
904          * @since       2.1
905          *
906          * @return      An error code
907          * @param[out]  width                           The width of bitmap of the item
908          * @param[out]  height                          The height of bitmap of the item
909          * @exception   E_SUCCESS                       The method is successful.
910          * @exception   E_INVALID_STATE         This instance is in an invalid state.
911          */
912         result GetItemBitmapSize(float& width, float& height) const;
913
914         /**
915          * Gets the size of bitmap of the item.
916          *
917          * @since   2.0
918          *
919          * @return      The size of bitmap of the item, @n
920          *                      else (-1, -1) if the instance is invalid
921          */
922         Tizen::Graphics::Dimension GetItemBitmapSize(void) const;
923
924         /**
925          * Gets the size of bitmap of the item.
926          *
927          * @since   2.1
928          *
929          * @return      The size of bitmap of the item, @n
930          *                      else (-1, -1) if the instance is invalid
931          */
932         Tizen::Graphics::FloatDimension GetItemBitmapSizeF(void) const;
933
934         /**
935          * Gets the size of the item.
936          *
937          * @since   2.0
938          *
939          * @return      An error code
940          * @param[out]  width                           The width of the item
941          * @param[out]  height                          The height of the item
942          * @exception   E_SUCCESS                       The method is successful.
943          * @exception   E_INVALID_STATE         This instance is in an invalid state.
944          */
945         result GetItemSize(int& width, int& height) const;
946
947         /**
948          * Gets the size of the item.
949          *
950          * @since   2.1
951          *
952          * @return      An error code
953          * @param[out]  width                           The width of the item
954          * @param[out]  height                          The height of the item
955          * @exception   E_SUCCESS                       The method is successful.
956          * @exception   E_INVALID_STATE         This instance is in an invalid state.
957          */
958         result GetItemSize(float& width, float& height) const;
959
960         /**
961          * Gets the size of the item.
962          *
963          * @since   2.0
964          *
965          * @return      The size of the item, @n
966          *                      else (-1, -1) if the instance is invalid
967          */
968         Tizen::Graphics::Dimension GetItemSize(void) const;
969
970         /**
971          * Gets the size of the item.
972          *
973          * @since   2.1
974          *
975          * @return      The size of the item, @n
976          *                      else (-1, -1) if the instance is invalid
977          */
978         Tizen::Graphics::FloatDimension GetItemSizeF(void) const;
979
980         /**
981          * Sets the number of item lines to be scrolled for the magnetic scroll of %IconListView.
982          *
983          * @since   2.0
984          *
985          * @return      An error code
986          * @param[in]   scrollSize                      The number of item lines for the magnetic scroll of %IconListView
987          * @exception   E_SUCCESS                       The method is successful.
988          * @exception   E_INVALID_ARG           The specified @c scrollSize is out of range. @n
989          *                                                                      The specified @c scrollSize is less than @c 0 or greater than the item count shown along the scroll direction.
990          * @exception   E_SYSTEM                        A system error has occurred.
991          * @remarks     If the @c scrollSize is set to @c 0, %IconListView does not use the magnetic scroll. The initial value is @c 0.
992          */
993         result SetMagneticScrollSize(int scrollSize);
994
995         /**
996          * Gets the number of item lines for the magnetic scroll of %IconListView.
997          *
998          * @since   2.0
999          *
1000          * @return      The number of item lines for the magnetic scroll of %IconListView, @n
1001          *                      else @c -1 if the instance is invalid
1002          */
1003         int GetMagneticScrollSize(void) const;
1004
1005         /**
1006          * Gets the number of items to be displayed per axis of %IconListView.
1007          *
1008          * @since   2.0
1009          *
1010          * @return      The number of items to be displayed per axis, @n
1011          *                      else @c -1 if the instance is invalid
1012          * @remarks     The axis represents "row" when the scroll style is @c ICON_LIST_VIEW_SCROLLSDIRECTION_HORIZONTAL, while it represents "column" when the
1013          *                      scroll style is @c ICON_LIST_VIEW_SCROLLDIRECTION_VERTICAL.
1014          */
1015         int GetItemCountPerAxis(void) const;
1016
1017         /**
1018          * Sets the items horizontal alignment of %IconListView.
1019          *
1020          * @since   2.0
1021          *
1022          * @return      An error code
1023          * @param[in]   alignment                       The alignment of items
1024          * @exception   E_SUCCESS                       The method is successful.
1025          * @exception   E_INVALID_OPERATION     The alignment of icon list view is not in the vertical scroll direction.
1026          * @exception   E_SYSTEM                        A system error has occurred.
1027          */
1028         result SetItemLayoutHorizontalAlignment(HorizontalAlignment alignment);
1029
1030         /**
1031          * Sets the items vertical alignment of %IconListView.
1032          *
1033          * @since   2.0
1034          *
1035          * @return      An error code
1036          * @param[in]   alignment                       The alignment of items
1037          * @exception   E_SUCCESS                       The method is successful.
1038          * @exception   E_INVALID_OPERATION     The alignment of icon list view is not in the horizontal scroll direction.
1039          * @exception   E_SYSTEM                        A system error has occurred.
1040          */
1041         result SetItemLayoutVerticalAlignment(VerticalAlignment alignment);
1042
1043         /**
1044          * Gets the items horizontal alignment of %IconListView.
1045          *
1046          * @since   2.0
1047          *
1048          * @return      The alignment of items, @n
1049          *                      else @c ALIGNMENT_LEFT if the instance is invalid
1050          */
1051         HorizontalAlignment GetItemLayoutHorizontalAlignment(void) const;
1052
1053         /**
1054          * Gets the items vertical alignment of %IconListView.
1055          *
1056          * @since   2.0
1057          *
1058          * @return      The alignment of items, @n
1059          *                      else @c ALIGNMENT_TOP if the instance is invalid
1060          */
1061         VerticalAlignment GetItemLayoutVerticalAlignment(void) const;
1062
1063         /**
1064          * Sets the item border style.
1065          *
1066          * @since       2.0
1067          *
1068          * @return      An error code
1069          * @param[in]   borderStyle                     An item border style
1070          * @exception   E_SUCCESS                       The method is successful.
1071          * @exception   E_SYSTEM                        A system error has occurred.
1072         */
1073         result SetItemBorderStyle(IconListViewItemBorderStyle borderStyle);
1074
1075         /**
1076          * Gets the item border style.
1077          *
1078          * @since       2.0
1079          *
1080          * @return      The item border style, @n
1081          *                      else @c ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE if an error occurs
1082          */
1083         IconListViewItemBorderStyle GetItemBorderStyle(void) const;
1084
1085         /**
1086          * Sets the bitmap of the empty list.
1087          *
1088          * @since       2.0
1089          *
1090          * @return      An error code
1091          * @param[in]   pBitmap                         The bitmap of the empty list
1092          * @exception   E_SUCCESS                       The method is successful.
1093          * @exception   E_SYSTEM                        A system error has occurred.
1094          */
1095         result SetBitmapOfEmptyList(const Tizen::Graphics::Bitmap* pBitmap);
1096
1097         /**
1098          * Begins the reordering mode.
1099          *
1100          * @since 2.0
1101          *
1102          * @return  An error code
1103          * @exception E_SUCCESS         The method is successful.
1104          * @exception E_SYSTEM                  A system error has occurred.
1105          * @see IIconListViewItemEventListener::OnIconListViewItemReordered()
1106          */
1107         result BeginReorderingMode(void);
1108
1109         /**
1110          * Ends the reordering mode.
1111          *
1112          * @since 2.0
1113          *
1114          * @exception E_SUCCESS         The method is successful.
1115          * @exception E_SYSTEM                  A system error has occurred.
1116          * @see IIconListViewItemEventListener::OnIconListViewItemReordered()
1117          */
1118         result EndReorderingMode(void);
1119
1120         /**
1121          * Checks whether %IconListView is in reordering mode.
1122          *
1123          * @since 2.0
1124          *
1125          * @return  @c true if %IconListView is in reordering mode, @n
1126          *          else @c false
1127          */
1128         bool IsInReorderingMode(void) const;
1129
1130         /**
1131          * Sets the scroll input handling mode.
1132          *
1133          * @since 2.1
1134          *
1135          * @param[in] mode      The scroll input handling mode
1136          * @see                         GetScrollInputMode()
1137          */
1138         void SetScrollInputMode(ScrollInputMode mode);
1139
1140         /**
1141          * Gets the scroll input handling mode.
1142          *
1143          * @since 2.1
1144          *
1145          * @return              The scroll input handling mode
1146          * @see                 SetScrollInputMode()
1147          */
1148         ScrollInputMode GetScrollInputMode(void) const;
1149
1150 public:
1151         friend class _IconListViewImpl;
1152
1153 private:
1154         /**
1155          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1156          *
1157          * @since       2.0
1158          */
1159         IconListView(const IconListView& rhs);
1160
1161         /**
1162          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1163          *
1164          * @since       2.0
1165          */
1166         IconListView& operator =(const IconListView& rhs);
1167
1168 }; // IconListView
1169
1170 }}} // Tizen::Ui::Controls
1171
1172 #endif // _FUI_CTRL_ICON_LIST_VIEW_H_