2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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.
19 * @file FUiCtrlIconListView.h
20 * @brief This is the header file for the %IconListView class.
22 * This header file contains the declarations of the %IconListView class and its helper classes.
25 #ifndef _FUI_CTRL_ICON_LIST_VIEW_H_
26 #define _FUI_CTRL_ICON_LIST_VIEW_H_
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>
41 namespace Tizen { namespace Ui { namespace Controls
46 * @brief This class defines the common behavior for a %IconListView control.
50 * The %IconListView class displays a 2-dimentional list of bitmap images and icons.
52 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
54 * The following example demonstrates how to use the %IconListView class.
57 //Sample code for IconListViewSample.h
60 class IconListViewSample
61 : public Tizen::Ui::Controls::Form
62 , public Tizen::Ui::Controls::IIconListViewItemProvider
63 , public Tizen::Ui::Controls::IIconListViewItemEventListener
66 IconListViewSample(void)
67 : __pIconListView(null){}
69 bool Initialize(void);
70 virtual result OnInitializing(void);
71 virtual result OnTerminating(void);
73 // IIconListViewItemEventListener
74 virtual void OnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView &view, int index, Tizen::Ui::Controls::IconListViewItemStatus status);
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);
82 Tizen::Graphics::Bitmap* __pHome;
83 Tizen::Graphics::Bitmap* __pMsg;
84 Tizen::Graphics::Bitmap* __pAlarm;
86 Tizen::Ui::Controls::IconListView* __pIconListView;
91 //Sample code for IconListViewSample.cpp
93 #include <FGraphics.h>
95 #include "IconListViewSample.h"
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;
104 IconListViewSample::Initialize(void)
106 Construct(FORM_STYLE_NORMAL);
111 IconListViewSample::OnInitializing(void)
113 result r = E_SUCCESS;
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);
122 // Adds the icon list view to the form
123 AddControl(*__pIconListView);
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");
135 IconListViewSample::OnTerminating(void)
137 result r = E_SUCCESS;
139 // Deallocates bitmaps
148 IconListViewSample::GetItemCount(void)
154 IconListViewSample::CreateItem(int index)
156 // Creates an instance of IconListViewItem
157 IconListViewItem* pIconListview = new IconListViewItem();
159 // Creates an instance of String
160 String* pStr = new String();
167 pIconListview->Construct(*__pHome, pStr);
173 pIconListview->Construct(*__pMsg, pStr);
179 pIconListview->Construct(*__pAlarm, pStr);
184 // Deallocates the string
187 return pIconListview;
191 IconListViewSample::DeleteItem(int index, IconListViewItem* pItem)
198 IconListViewSample::OnIconListViewItemStateChanged (IconListView &view, int index, IconListViewItemStatus status)
219 class _OSP_EXPORT_ IconListView
220 : public Tizen::Ui::Control
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.
231 * This destructor overrides Tizen::Base::Object::~Object().
235 virtual ~IconListView(void);
239 * Initializes this instance of %IconListView with the specified parameters.
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.
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);
263 * Initializes this instance of %IconListView with the specified parameters.
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.
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);
287 * Sets the item provider that creates and deletes items for the %IconListView control.
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.
298 result SetItemProvider(IIconListViewItemProvider& provider);
301 * Adds a listener instance. @n
302 * The added listener can listen to item events when they are fired.
306 * @param[in] listener The listener to add
308 void AddIconListViewItemEventListener(IIconListViewItemEventListener& listener);
311 * Removes a listener instance. @n
312 * The removed listener cannot listen to events when they are fired.
316 * @param[in] listener The listener to remove
318 void RemoveIconListViewItemEventListener(IIconListViewItemEventListener& listener);
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.
326 * @param[in] listener The event listener to add
327 * @see IScrollEventListener::OnScrollEndReached()
328 * @see RemoveScrollEventListener()
330 void AddScrollEventListener(IScrollEventListener& listener);
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.
338 * @param[in] listener The event listener to add
339 * @see IScrollEventListenerF::OnScrollEndReached()
340 * @see RemoveScrollEventListener()
342 void AddScrollEventListener(IScrollEventListenerF& listener);
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.
350 * @param[in] listener The event listener to remove
351 * @see IScrollEventListener::OnScrollEndReached()
352 * @see RemoveScrollEventListener()
354 void RemoveScrollEventListener(IScrollEventListener& listener);
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.
362 * @param[in] listener The event listener to remove
363 * @see IScrollEventListenerF::OnScrollEndReached()
364 * @see RemoveScrollEventListener()
366 void RemoveScrollEventListener(IScrollEventListenerF& listener);
369 * Sets the background bitmap of %IconListView.
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.
380 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
383 * Sets the background color of this control.
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.
394 result SetBackgroundColor(const Tizen::Graphics::Color& color);
397 * Gets the background color of this control.
401 * @return The background color, @n
402 * else RGBA(0, 0, 0, 0) if an error occurs
404 Tizen::Graphics::Color GetBackgroundColor(void) const;
407 * Sets the margin of %IconListView.
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.
420 result SetMargin(MarginType type, int value);
423 * Sets the margin of %IconListView.
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.
436 result SetMargin(MarginType type, float value);
439 * Gets the margin of %IconListView.
443 * @return The marginal value of %IconListView, @n
444 * else @c -1 if an error occurs
445 * @param[in] type The type of margin
447 int GetMargin(MarginType type) const;
450 * Gets the margin of %IconListView.
454 * @return The marginal value of %IconListView, @n
455 * else @c -1 if an error occurs
456 * @param[in] type The type of margin
458 float GetMarginF(MarginType type) const;
461 * Sets the horizontal and vertical spacing between the items.
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.
474 result SetItemSpacing(int horizontalSpacing, int verticalSpacing);
477 * Sets the horizontal and vertical spacing between the items.
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.
490 result SetItemSpacing(float horizontalSpacing, float verticalSpacing);
493 * Gets the horizontal spacing between items of %IconListView.
497 * @return The value of space between items in horizontal direction, @n
498 * else @c -1 if an error occurs
500 int GetItemHorizontalSpacing(void) const;
503 * Gets the horizontal spacing between items of %IconListView.
507 * @return The value of space between items in horizontal direction, @n
508 * else @c -1 if an error occurs
510 float GetItemHorizontalSpacingF(void) const;
513 * Gets the vertical spacing between items of %IconListView.
517 * @return The value of space between items in vertical direction, @n
518 * else @c -1 if an error occurs
520 int GetItemVerticalSpacing(void) const;
523 * Gets the vertical spacing between items of %IconListView.
527 * @return The value of space between items in vertical direction, @n
528 * else @c -1 if an error occurs
530 float GetItemVerticalSpacingF(void) const;
533 * Sets the checked status of the specified item of %IconListView.
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.
546 result SetItemChecked(int index, bool check);
549 * Checks whether the specified @c item is checked.
553 * @return @c true if the specified @c item is checked, @n
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.
558 bool IsItemChecked(int index) const;
561 * Gets the index of the item at the specified position.
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
570 int GetItemIndexFromPosition(int x, int y) const;
573 * Gets the index of the item at the specified @c position.
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
582 int GetItemIndexFromPosition(float x, float y) const;
585 * Gets the index of the item at the specified position.
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
593 int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const;
596 * Gets the index of the item at the specified position.
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
604 int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const;
607 * Sets the horizontal alignment of the text of an item.
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.
616 result SetTextHorizontalAlignment(HorizontalAlignment alignment);
619 * Sets the vertical alignment of the text of an item.
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.
628 result SetTextVerticalAlignment(IconListViewItemTextVerticalAlignment alignment);
631 * Gets the horizontal alignment of the text of the %IconListView control.
635 * @return The horizontal alignment of the text, @n
636 * else @c ALIGNMENT_LEFT when the %IconListView instance is invalid
638 HorizontalAlignment GetTextHorizontalAlignment(void) const;
641 * Gets the vertical alignment of the text of the current %IconListView.
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
648 IconListViewItemTextVerticalAlignment GetTextVerticalAlignment(void) const;
651 * Sets the text of the empty list.
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.
660 result SetTextOfEmptyList(const Tizen::Base::String& text);
663 * Gets the text to display when there is no item in the list.
667 * @return The text to be displayed, @n
668 * else an empty string if the instance is invalid
670 Tizen::Base::String GetTextOfEmptyList(void) const;
673 * Sets the color of the text that is displayed when %IconListView contains no item.
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.
682 result SetTextColorOfEmptyList(const Tizen::Graphics::Color& color);
685 * Gets the color of the text to display when there is no item in the list.
689 * @return The color of the text to be displayed, @n
690 * else RGBA(0, 0, 0, 0) if the instance is invalid
692 Tizen::Graphics::Color GetTextColorOfEmptyList(void) const;
695 * Sets the text color of the item.
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.
705 result SetItemTextColor(IconListViewItemDrawingStatus status, const Tizen::Graphics::Color& color);
708 * Gets the text color of the item.
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
716 Tizen::Graphics::Color GetItemTextColor(IconListViewItemDrawingStatus status) const;
719 * Sets the size of the text of the %IconListView control.
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.
730 result SetItemTextSize(int size);
733 * Sets the size of the text of the %IconListView control.
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.
744 result SetItemTextSize(float size);
747 * Gets the size of the text of the %IconListView control.
751 * @return The size of the text of the %IconListView control, @n
752 * else @c -1 if the instance is invalid
754 int GetItemTextSize(void) const;
757 * Gets the size of the text of the %IconListView control.
761 * @return The size of the text of the %IconListView control, @n
762 * else @c -1 if the instance is invalid
764 float GetItemTextSizeF(void) const;
767 * Sets the position of the checkbox of the %IconListView control.
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.
780 result SetCheckBoxPosition(IconListViewCheckBoxPosition position);
783 * Gets the position of the checkbox of the %IconListView control.
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.
791 IconListViewCheckBoxPosition GetCheckBoxPosition(void) const;
794 * Enables or disables touch animation.
798 * @return An error code
799 * @param[in] enable Set to @c true to enable touch animation, @n
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.
807 result SetTouchAnimationEnabled(bool enable);
810 * Checks whether touch animation is enabled.
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
817 bool IsTouchAnimationEnabled(void) const;
820 * Scrolls the list contents to the specified @c index.
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.
830 result ScrollToItem(int index);
833 * Scrolls the list contents with the amount of pixels.
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.
844 result ScrollByPixel(int pixel);
847 * Scrolls the list contents with the amount of pixels.
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.
858 result ScrollByPixel(float pixel);
861 * Refreshes the specified item of %IconListView.
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.
874 result RefreshList(int index, ListRefreshType type);
877 * Updates the whole items of a list.
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.
886 result UpdateList(void);
889 * Gets the size of bitmap of the item.
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.
899 result GetItemBitmapSize(int& width, int& height) const;
902 * Gets the size of bitmap of the item.
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.
912 result GetItemBitmapSize(float& width, float& height) const;
915 * Gets the size of bitmap of the item.
919 * @return The size of bitmap of the item, @n
920 * else (-1, -1) if the instance is invalid
922 Tizen::Graphics::Dimension GetItemBitmapSize(void) const;
925 * Gets the size of bitmap of the item.
929 * @return The size of bitmap of the item, @n
930 * else (-1, -1) if the instance is invalid
932 Tizen::Graphics::FloatDimension GetItemBitmapSizeF(void) const;
935 * Gets the size of the item.
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.
945 result GetItemSize(int& width, int& height) const;
948 * Gets the size of the item.
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.
958 result GetItemSize(float& width, float& height) const;
961 * Gets the size of the item.
965 * @return The size of the item, @n
966 * else (-1, -1) if the instance is invalid
968 Tizen::Graphics::Dimension GetItemSize(void) const;
971 * Gets the size of the item.
975 * @return The size of the item, @n
976 * else (-1, -1) if the instance is invalid
978 Tizen::Graphics::FloatDimension GetItemSizeF(void) const;
981 * Sets the number of item lines to be scrolled for the magnetic scroll of %IconListView.
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.
993 result SetMagneticScrollSize(int scrollSize);
996 * Gets the number of item lines for the magnetic scroll of %IconListView.
1000 * @return The number of item lines for the magnetic scroll of %IconListView, @n
1001 * else @c -1 if the instance is invalid
1003 int GetMagneticScrollSize(void) const;
1006 * Gets the number of items to be displayed per axis of %IconListView.
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.
1015 int GetItemCountPerAxis(void) const;
1018 * Sets the items horizontal alignment of %IconListView.
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.
1028 result SetItemLayoutHorizontalAlignment(HorizontalAlignment alignment);
1031 * Sets the items vertical alignment of %IconListView.
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.
1041 result SetItemLayoutVerticalAlignment(VerticalAlignment alignment);
1044 * Gets the items horizontal alignment of %IconListView.
1048 * @return The alignment of items, @n
1049 * else @c ALIGNMENT_LEFT if the instance is invalid
1051 HorizontalAlignment GetItemLayoutHorizontalAlignment(void) const;
1054 * Gets the items vertical alignment of %IconListView.
1058 * @return The alignment of items, @n
1059 * else @c ALIGNMENT_TOP if the instance is invalid
1061 VerticalAlignment GetItemLayoutVerticalAlignment(void) const;
1064 * Sets the item border style.
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.
1073 result SetItemBorderStyle(IconListViewItemBorderStyle borderStyle);
1076 * Gets the item border style.
1080 * @return The item border style, @n
1081 * else @c ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE if an error occurs
1083 IconListViewItemBorderStyle GetItemBorderStyle(void) const;
1086 * Sets the bitmap of the empty list.
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.
1095 result SetBitmapOfEmptyList(const Tizen::Graphics::Bitmap* pBitmap);
1098 * Begins the reordering mode.
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()
1107 result BeginReorderingMode(void);
1110 * Ends the reordering mode.
1114 * @exception E_SUCCESS The method is successful.
1115 * @exception E_SYSTEM A system error has occurred.
1116 * @see IIconListViewItemEventListener::OnIconListViewItemReordered()
1118 result EndReorderingMode(void);
1121 * Checks whether %IconListView is in reordering mode.
1125 * @return @c true if %IconListView is in reordering mode, @n
1128 bool IsInReorderingMode(void) const;
1131 * Sets the scroll input handling mode.
1135 * @param[in] mode The scroll input handling mode
1136 * @see GetScrollInputMode()
1138 void SetScrollInputMode(ScrollInputMode mode);
1141 * Gets the scroll input handling mode.
1145 * @return The scroll input handling mode
1146 * @see SetScrollInputMode()
1148 ScrollInputMode GetScrollInputMode(void) const;
1151 friend class _IconListViewImpl;
1155 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1159 IconListView(const IconListView& rhs);
1162 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1166 IconListView& operator =(const IconListView& rhs);
1170 }}} // Tizen::Ui::Controls
1172 #endif // _FUI_CTRL_ICON_LIST_VIEW_H_