X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fscrollable%2Fitem-view%2Fitem-view.h;h=692d129300b2a6132fbb6c7263c809896fdf673b;hp=b63f0cd05454d1c1c49817c97484a584e271d99a;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=2eb0f016cf4d8a8282681283ae0e842c0c67bded diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h b/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h old mode 100644 new mode 100755 index b63f0cd..692d129 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_ITEM_VIEW_H__ -#define __DALI_TOOLKIT_ITEM_VIEW_H__ +#ifndef DALI_TOOLKIT_ITEM_VIEW_H +#define DALI_TOOLKIT_ITEM_VIEW_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,20 +48,30 @@ typedef IntrusivePtr ItemLayoutPtr; /** * @brief ItemView is a scrollable layout container. * - * Multiple ItemLayouts may be provided, to determine the logical position of each item a layout. - * Actors are provided from an external ItemFactory, to display the currently visible items. + * Multiple ItemLayouts may be provided to determine the logical position of each item layout. + * Actors are provided from an external ItemFactory to display the currently visible items. * * Signals * | %Signal Name | Method | * |---------------------------------|--------------------------------------------| * | layoutActivated | @ref LayoutActivatedSignal() | * @SINCE_1_0.0 + * + * Actions + * | %Action Name | Attributes | Description | + * |---------------|-------------------------|-------------------------------------------------| + * | stopScrolling | Doesn't have attributes | Stops the scroll animation. See @ref DoAction() | + * @SINCE_1_1.33 */ -class DALI_IMPORT_API ItemView : public Scrollable +class DALI_TOOLKIT_API ItemView : public Scrollable { public: + /** + * @brief Enumeration for the start and end property ranges for this control. + * @SINCE_1_1.18 + */ enum PropertyRange { PROPERTY_START_INDEX = Toolkit::Scrollable::PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.18 @@ -72,27 +82,114 @@ public: }; /** - * @brief An enumeration of properties belonging to the ScrollView class. + * @brief Enumeration for the instance of properties belonging to the ScrollView class. * @SINCE_1_0.0 */ struct Property { + /** + * @brief Enumeration for the instance of properties belonging to the ScrollView class. + * @SINCE_1_0.0 + */ enum { - // Event side properties - MINIMUM_SWIPE_SPEED = PROPERTY_START_INDEX, ///< Property, name "minimumSwipeSpeed", @see SetMinimumSwipeSpeed(), type float, @SINCE_1_1.18 - MINIMUM_SWIPE_DISTANCE, ///< Property, name "minimumSwipeDistance", @see SetMinimumSwipeDistance(), type float, @SINCE_1_1.18 - WHEEL_SCROLL_DISTANCE_STEP, ///< Property, name "wheelScrollDistanceStep", @see SetWheelScrollDistanceStep(), type float, @SINCE_1_1.18 - SNAP_TO_ITEM_ENABLED, ///< Property, name "snapToItemEnabled", @see SetAnchoring(), type bool, @SINCE_1_1.18 - REFRESH_INTERVAL, ///< Property, name "refreshInterval", @see SetRefreshInterval(), type float, @SINCE_1_1.18 - - // Animatable properties - LAYOUT_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "layoutPosition", type float @SINCE_1_0.0 - SCROLL_SPEED, ///< Property, name "scrollSpeed", type float @SINCE_1_0.0 - OVERSHOOT, ///< Property, name "overshoot", type float @SINCE_1_0.0 - SCROLL_DIRECTION, ///< Property, name "scrollDirection", type Vector2 @SINCE_1_0.0 - LAYOUT_ORIENTATION, ///< Property, name "layoutOrientation", type integer @SINCE_1_0.0 - SCROLL_CONTENT_SIZE ///< Property, name "scrollContentSize", type float @SINCE_1_0.0 + /////////////////////////////////////////////////////////////////////////////// + // Event side (non-animatable) properties + /////////////////////////////////////////////////////////////////////////////// + + /** + * @brief The minimum swipe speed in pixels per second. + * @details Name "minimumSwipeSpeed", type Property::FLOAT. + * @SINCE_1_1.18 + * @see SetMinimumSwipeSpeed() + */ + MINIMUM_SWIPE_SPEED = PROPERTY_START_INDEX, + + /** + * @brief The minimum swipe distance in actor coordinates. + * @details Name "minimumSwipeDistance", type Property::FLOAT. + * @SINCE_1_1.18 + * @see SetMinimumSwipeDistance() + */ + MINIMUM_SWIPE_DISTANCE, + + /** + * @brief The step of scroll distance in actor coordinates for each wheel event received. + * @details Name "wheelScrollDistanceStep", type Property::FLOAT. + * @SINCE_1_1.18 + * @see SetWheelScrollDistanceStep() + */ + WHEEL_SCROLL_DISTANCE_STEP, + + /** + * @brief Whether the animation for the layout to scroll to its anchor position after dragging or swiping is enabled. + * @details Name "snapToItemEnabled", type Property::BOOLEAN. + * @SINCE_1_1.18 + * @see SetAnchoring() + */ + SNAP_TO_ITEM_ENABLED, + + /** + * @brief The interval between refreshes. + * @details Name "refreshInterval", type Property::FLOAT. + * @SINCE_1_1.18 + * @see SetRefreshInterval() + */ + REFRESH_INTERVAL, + + /** + * @brief The layout used. + * @details Name "layout", type Property::ARRAY. + * @SINCE_1_2.60 + * @see Dali::Toolkit::DefaultItemLayoutProperty + */ + LAYOUT, + + /////////////////////////////////////////////////////////////////////////////// + // Animatable Properties + /////////////////////////////////////////////////////////////////////////////// + + /** + * @brief The current logical position within the layout. + * @details Name "layoutPosition", type Property::FLOAT. + * @SINCE_1_0.0 + */ + LAYOUT_POSITION = ANIMATABLE_PROPERTY_START_INDEX, + + /** + * @brief The scrolling speed when playing the flick animation. + * @details Name "scrollSpeed", type Property::FLOAT. + * @SINCE_1_0.0 + */ + SCROLL_SPEED, + + /** + * @brief The amount that we can scroll beyond the boundary. + * @details Name "overshoot", type Property::FLOAT. + * @SINCE_1_0.0 + */ + OVERSHOOT, + + /** + * @brief The current scrolling direction. + * @details Name "scrollDirection", type Property::FLOAT. + * @SINCE_1_0.0 + */ + SCROLL_DIRECTION, + + /** + * @brief The current orientation of the layout. + * @details Name "layoutOrientation", type Property::INTEGER. + * @SINCE_1_0.0 + */ + LAYOUT_ORIENTATION, + + /** + * @brief The size of the content. + * @details Name "scrollContentSize", type Property::FLOAT. + * @SINCE_1_0.0 + */ + SCROLL_CONTENT_SIZE, }; }; @@ -103,7 +200,7 @@ public: public: /** - * @brief Create an uninitialized ItemView; this can be initialized with ItemView::New(). + * @brief Creates an uninitialized ItemView; this can be initialized with ItemView::New(). * * Calling member functions with an uninitialized Dali::Object is not allowed. * @SINCE_1_0.0 @@ -113,17 +210,20 @@ public: /** * @brief Copy constructor. * @SINCE_1_0.0 + * @param[in] itemView Handle to an object */ ItemView( const ItemView& itemView ); /** * @brief Assignment operator. * @SINCE_1_0.0 + * @param[in] itemView Handle to an object + * @return A reference to this */ ItemView& operator=( const ItemView& itemView ); /** - * @brief Destructor + * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. * @SINCE_1_0.0 @@ -131,96 +231,96 @@ public: ~ItemView(); /** - * @brief Create an initialized ItemView. + * @brief Creates an initialized ItemView. * * @SINCE_1_0.0 - * @param[in] factory The factory which provides ItemView with items. - * @return A handle to a newly allocated Dali resource. + * @param[in] factory The factory which provides ItemView with items + * @return A handle to a newly allocated Dali resource */ static ItemView New(ItemFactory& factory); /** - * @brief Downcast an Object handle to ItemView. + * @brief Downcasts a handle to ItemView handle. * - * If handle points to a ItemView the downcast produces valid - * handle. If not the returned handle is left uninitialized. + * If handle points to a ItemView, the downcast produces valid handle. + * If not, the returned handle is left uninitialized. * * @SINCE_1_0.0 * @param[in] handle Handle to an object - * @return handle to a ItemView or an uninitialized handle + * @return A handle to a ItemView or an uninitialized handle */ static ItemView DownCast( BaseHandle handle ); /** - * @brief Query the number of layouts. + * @brief Queries the number of layouts. * * @SINCE_1_0.0 - * @return The number of layouts. + * @return The number of layouts */ unsigned int GetLayoutCount() const; /** - * @brief Add a layout. + * @brief Adds a layout. * * @SINCE_1_0.0 - * @param[in] layout The layout. + * @param[in] layout The layout */ void AddLayout(ItemLayout& layout); /** - * @brief Remove a layout. + * @brief Removes a layout. * * @SINCE_1_0.0 - * @param[in] layoutIndex The index of one of the ItemView layouts. + * @param[in] layoutIndex The index of one of the ItemView layouts * @pre layoutIndex is less than GetLayoutCount(). */ void RemoveLayout(unsigned int layoutIndex); /** - * @brief Retrieve a layout. + * @brief Retrieves a layout. * * @SINCE_1_0.0 - * @param[in] layoutIndex The index of the layout to retrieve. + * @param[in] layoutIndex The index of the layout to retrieve * @return The layout * @pre layoutIndex is less than GetLayoutCount(). */ ItemLayoutPtr GetLayout(unsigned int layoutIndex) const; /** - * @brief Retrieve the currently active layout, if any. + * @brief Retrieves the currently active layout, if any. * * @SINCE_1_0.0 - * @return The layout, or an uninitialized pointer if no layout is active. + * @return The layout, or an uninitialized pointer if no layout is active */ ItemLayoutPtr GetActiveLayout() const; /** - * @brief Retrieve the current layout-position of an item in the ItemView. + * @brief Retrieves the current layout-position of an item in the ItemView. * * @SINCE_1_0.0 - * @param[in] itemId The item identifier. - * @return The current layout-position. + * @param[in] itemId The item identifier + * @return The current layout-position */ float GetCurrentLayoutPosition(ItemId itemId) const; /** - * @brief Activate one of the layouts; this will resize the ItemView + * @brief Activates one of the layouts; this will resize the ItemView * & relayout actors within the ItemView. * * This is done by applying constraints from the new layout, and * removing constraints from the previous layout. * * @SINCE_1_0.0 - * @param[in] layoutIndex The index of one of the ItemView layouts. - * @param[in] targetSize The target ItemView & layout size. - * @param[in] durationSeconds The time taken to relayout in seconds (zero for immediate). + * @param[in] layoutIndex The index of one of the ItemView layouts + * @param[in] targetSize The target ItemView & layout size + * @param[in] durationSeconds The time taken to relayout in seconds (zero for immediate) * @pre layoutIndex is less than GetLayoutCount(). * @pre durationSeconds is greater or equal to zero. */ void ActivateLayout(unsigned int layoutIndex, Vector3 targetSize, float durationSeconds); /** - * @brief Deactivate the current layout, if any. + * @brief Deactivates the current layout, if any. * * The constraints applied by the layout will be removed. * @SINCE_1_0.0 @@ -228,8 +328,8 @@ public: void DeactivateCurrentLayout(); /** - * @brief Set the minimum swipe speed in pixels per second; A pan - * gesture must exceed this to trigger a swipe. + * @brief Sets the minimum swipe speed in pixels per second; + * A pan gesture must exceed this to trigger a swipe. * * @SINCE_1_0.0 * @param[in] speed The minimum swipe speed @@ -237,7 +337,7 @@ public: void SetMinimumSwipeSpeed(float speed); /** - * @brief Get the minimum swipe speed in pixels per second. + * @brief Gets the minimum swipe speed in pixels per second. * * @SINCE_1_0.0 * @return The minimum swipe speed @@ -245,16 +345,16 @@ public: float GetMinimumSwipeSpeed() const; /** - * @brief Set the minimum swipe distance in actor coordinates; A pan - * gesture must exceed this to trigger a swipe. + * @brief Sets the minimum swipe distance in actor coordinates; + * A pan gesture must exceed this to trigger a swipe. * * @SINCE_1_0.0 - * @param[in] distance The minimum swipe distance. + * @param[in] distance The minimum swipe distance */ void SetMinimumSwipeDistance(float distance); /** - * @brief Get the minimum swipe distance in actor coordinates. + * @brief Gets the minimum swipe distance in actor coordinates. * * @SINCE_1_0.0 * @return The minimum swipe distance @@ -330,7 +430,9 @@ public: void ScrollToItem(ItemId itemId, float durationSeconds); /** - * @brief Set the interval between refreshes. When the layout-position of items is changed by this interval, + * @brief Set the interval between refreshes. + * + * When the layout-position of items is changed by this interval, * new items are requested from ItemFactory. * * @SINCE_1_0.0 @@ -403,11 +505,12 @@ public: * * A relayout will occur for the remaining actors; for example if RemoveItem(Item(2, ActorZ), 0) is called, * the items with ID 3 or greater will be moved: - * Initial actors: After remove: - * ID 1 - ActorA ID 1 - ActorA - * ID 2 - ActorB ID 2 - ActorC (previously ID 3) - * ID 3 - ActorC ID 3 - ActorB (previously ID 4) - * ID 4 - ActorD + * | Initial actors: | After remove: | + * |:------------------ |:-------------- | + * | ID 1 - ActorA | ID 1 - ActorA | + * | ID 2 - ActorB | ID 2 - ActorC (previously ID 3) | + * | ID 3 - ActorC | ID 3 - ActorB (previously ID 4) | + * | ID 4 - ActorD | | * @SINCE_1_0.0 * @param[in] itemId The Item ID of the item to remove. * @param[in] durationSeconds How long the relayout takes in seconds. @@ -448,7 +551,7 @@ public: void ReplaceItems(const ItemContainer& replacementItems, float durationSeconds); /** - * @brief Set the parent origin of the items + * @brief Set the parent origin of the items. * * A relayout will occur for all the items if the parent origin is different than the current one. * @SINCE_1_0.0 @@ -457,7 +560,7 @@ public: void SetItemsParentOrigin( const Vector3& parentOrigin ); /** - * @brief Get the parent origin of the items + * @brief Get the parent origin of the items. * * @SINCE_1_0.0 * @return The current parent origin of the items @@ -465,7 +568,7 @@ public: Vector3 GetItemsParentOrigin() const; /** - * @brief Set the anchor point of the items + * @brief Set the anchor point of the items. * * A relayout will occur for all the items if the anchor point is different than the current one. * @SINCE_1_0.0 @@ -474,7 +577,7 @@ public: void SetItemsAnchorPoint( const Vector3& anchorPoint ); /** - * @brief Get the anchor point of the items + * @brief Get the anchor point of the items. * * @SINCE_1_0.0 * @return The current anchor point of the items @@ -506,6 +609,7 @@ public: // Signals public: // Not intended for application developers + /// @cond internal /** * @brief Creates a handle using the Toolkit::Internal implementation. * @@ -521,6 +625,7 @@ public: // Not intended for application developers * @param[in] internal A pointer to the internal CustomActor. */ explicit DALI_INTERNAL ItemView( Dali::Internal::CustomActor* internal ); + /// @endcond }; /** @@ -530,4 +635,4 @@ public: // Not intended for application developers } // namespace Dali -#endif // __DALI_TOOLKIT_ITEM_VIEW_H__ +#endif // DALI_TOOLKIT_ITEM_VIEW_H