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