X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view.h;h=76f3e20c0012a9392695701dcf52b3b895e4dde4;hb=HEAD;hp=594e6dadbe5ee3e7a3fc34cc128166528f7df144;hpb=c987d82026e4acea095e80c4afba70a62efea61c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h old mode 100755 new mode 100644 index 594e6da..76f3e20 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_SCROLL_VIEW_H__ -#define __DALI_TOOLKIT_SCROLL_VIEW_H__ +#ifndef DALI_TOOLKIT_SCROLL_VIEW_H +#define DALI_TOOLKIT_SCROLL_VIEW_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -26,10 +26,8 @@ namespace Dali { - namespace Toolkit { - namespace Internal DALI_INTERNAL { class ScrollView; @@ -45,9 +43,9 @@ class ScrollView; */ enum ClampState { - NotClamped, ///< The quantity isn't clamped @SINCE_1_0.0 - ClampedToMin, ///< The quantity is clamped to the min value @SINCE_1_0.0 - ClampedToMax ///< The quantity is clamped to the max value @SINCE_1_0.0 + NOT_CLAMPED, ///< The quantity isn't clamped @SINCE_1_9.28 + CLAMPED_TO_MIN, ///< The quantity is clamped to the min value @SINCE_1_9.28 + CLAMPED_TO_MAX ///< The quantity is clamped to the max value @SINCE_1_9.28 }; /** @@ -66,8 +64,8 @@ struct ClampState2D */ enum SnapType { - Snap, ///< Snap @SINCE_1_0.0 - Flick ///< Flick @SINCE_1_0.0 + SNAP, ///< SNAP @SINCE_1_9.28 + FLICK ///< FLICK @SINCE_1_9.28 }; /** @@ -76,19 +74,18 @@ enum SnapType */ enum DirectionBias { - DirectionBiasLeft = -1, ///< Bias scroll snap to Left @SINCE_1_0.0 - DirectionBiasNone = 0, ///< Don't bias scroll snap @SINCE_1_0.0 - DirectionBiasRight = 1 ///< Bias scroll snap to Right @SINCE_1_0.0 + DIRECTION_BIAS_LEFT = -1, ///< Bias scroll snap to Left @SINCE_1_9.28 + DIRECTION_BIAS_NONE = 0, ///< Don't bias scroll snap @SINCE_1_9.28 + DIRECTION_BIAS_RIGHT = 1 ///< Bias scroll snap to Right @SINCE_1_9.28 }; /** * @brief Used for specifying minimum/maximum extents of a ruler. * @SINCE_1_0.0 */ -class DALI_IMPORT_API RulerDomain +class DALI_TOOLKIT_API RulerDomain { public: - /** * @brief Creates Ruler domain allowing a point to traverse between min and max extents. * @@ -100,10 +97,9 @@ public: explicit RulerDomain(float min, float max, bool enabled = true); public: - - float min; ///< Minimum extent (point cannot traverse less than this) - float max; ///< Maximum extent (point cannot traverse greater than this) - bool enabled; ///< Whether domain has been enabled or not. + float min; ///< Minimum extent (point cannot traverse less than this) + float max; ///< Maximum extent (point cannot traverse greater than this) + bool enabled; ///< Whether domain has been enabled or not. /** * @brief Clamps value (x) from (min) to (max). @@ -132,7 +128,7 @@ public: * @param[out] clamped Whether clamping occurred and which size (None, Min or Max) * @return The clamped value */ - float Clamp(float x, float length, float scale, ClampState &clamped) const; + float Clamp(float x, float length, float scale, ClampState& clamped) const; /** * @brief Returns (max-min) size of ruler. @@ -141,7 +137,6 @@ public: * @return The size of the ruler from min to max */ float GetSize() const; - }; // Forward declare future extension interface @@ -154,20 +149,20 @@ class RulerExtension; * where their snap points are and their domain. * @SINCE_1_0.0 */ -class DALI_IMPORT_API Ruler : public RefObject +class DALI_TOOLKIT_API Ruler : public RefObject { public: /** * @brief Enumeration for the type of the ruler. * @SINCE_1_0.0 */ - enum RulerType { - Fixed, ///< A fixed ruler @SINCE_1_0.0 - Free ///< A free ruler @SINCE_1_0.0 + enum RulerType + { + FIXED, ///< A fixed ruler @SINCE_1_9.28 + FREE ///< A free ruler @SINCE_1_9.28 }; public: - /** * @brief Constructs ruler, enabled by default, with limitless domain. * @SINCE_1_0.0 @@ -202,7 +197,7 @@ public: * @param[in] wrap Enable wrap mode * @return The position representing this page point */ - virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const = 0; + virtual float GetPositionFromPage(unsigned int page, unsigned int& volume, bool wrap) const = 0; /** * @brief Returns page from position, based on whatever the ruler @@ -231,10 +226,12 @@ public: * @SINCE_1_0.0 * @return The extension interface of the Ruler */ - virtual RulerExtension* GetExtension() { return NULL; } + virtual RulerExtension* GetExtension() + { + return NULL; + } public: - /** * @brief Gets the ruler type. * @@ -277,7 +274,7 @@ public: * @SINCE_1_0.0 * @return The domain */ - const RulerDomain &GetDomain() const; + const RulerDomain& GetDomain() const; /** * @brief Disables Domain (minimum/maximum extents for this axis). @@ -299,7 +296,6 @@ public: */ float Clamp(float x, float length = 0.0f, float scale = 1.0f) const; - /** * @brief Clamps value (x) from (min) to (max). * @@ -313,7 +309,7 @@ public: * @param[out] clamped Whether clamping occurred and which size (None, Min or Max) * @return The clamped value */ - float Clamp(float x, float length, float scale, ClampState &clamped) const; + float Clamp(float x, float length, float scale, ClampState& clamped) const; /** * @brief Snaps and Clamps (x) in accordance to ruler settings. @@ -348,10 +344,9 @@ public: * @param[out] clamped Whether clamping occurred and which size (None, Min or Max) * @return The clamped value after snapping */ - float SnapAndClamp(float x, float bias, float length, float scale, ClampState &clamped) const; + float SnapAndClamp(float x, float bias, float length, float scale, ClampState& clamped) const; protected: - /** * @brief Destructor - A reference counted object may only be deleted by calling Unreference(). * @SINCE_1_0.0 @@ -359,11 +354,9 @@ protected: virtual ~Ruler(); protected: - - RulerType mType; ///< Type of Ruler (Fixed or Free). - bool mEnabled; ///< If the ruler is enabled. - RulerDomain mDomain; ///< The domain of the ruler. - + RulerType mType; ///< Type of Ruler (FIXED or FREE). + bool mEnabled; ///< If the ruler is enabled. + RulerDomain mDomain; ///< The domain of the ruler. }; typedef IntrusivePtr RulerPtr; ///< Pointer to Dali::Toolkit::Ruler object @SINCE_1_0.0 @@ -372,7 +365,7 @@ typedef IntrusivePtr RulerPtr; ///< Pointer to Dali::Toolkit::Ruler objec * @brief Concrete implementation of Ruler that has no snapping and has one single page. * @SINCE_1_0.0 */ -class DALI_IMPORT_API DefaultRuler : public Ruler +class DALI_TOOLKIT_API DefaultRuler : public Ruler { public: /** @@ -384,29 +377,29 @@ public: /** * @copydoc Toolkit::Ruler::Snap */ - virtual float Snap(float x, float bias) const; + float Snap(float x, float bias) const override; /** * @copydoc Toolkit::Ruler::GetPositionFromPage */ - virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const; + float GetPositionFromPage(unsigned int page, unsigned int& volume, bool wrap) const override; /** * @copydoc Toolkit::Ruler::GetPageFromPosition */ - virtual unsigned int GetPageFromPosition(float position, bool wrap) const; + unsigned int GetPageFromPosition(float position, bool wrap) const override; /** * @copydoc Toolkit::Ruler::GetTotalPages */ - virtual unsigned int GetTotalPages() const; + unsigned int GetTotalPages() const override; }; /** * @brief Concrete implementation of Ruler that has fixed snapping. * @SINCE_1_0.0 */ -class DALI_IMPORT_API FixedRuler : public Ruler +class DALI_TOOLKIT_API FixedRuler : public Ruler { public: /** @@ -420,22 +413,22 @@ public: /** * @copydoc Toolkit::Ruler::Snap */ - virtual float Snap(float x, float bias) const; + float Snap(float x, float bias) const override; /** * @copydoc Toolkit::Ruler::GetPositionFromPage */ - virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const; + float GetPositionFromPage(unsigned int page, unsigned int& volume, bool wrap) const override; /** * @copydoc Toolkit::Ruler::GetPageFromPosition */ - virtual unsigned int GetPageFromPosition(float position, bool wrap) const; + unsigned int GetPageFromPosition(float position, bool wrap) const override; /** * @copydoc Toolkit::Ruler::GetTotalPages */ - virtual unsigned int GetTotalPages() const; + unsigned int GetTotalPages() const override; private: float mSpacing; ///< The spacing between each interval @@ -454,20 +447,18 @@ class ScrollView; * | snap-started | @ref SnapStartedSignal() | * @SINCE_1_0.0 */ -class DALI_IMPORT_API ScrollView : public Scrollable +class DALI_TOOLKIT_API ScrollView : public Scrollable { - public: - /** * @brief Clamps signal event's data. * @SINCE_1_0.0 */ struct ClampEvent { - ClampState2D scale; ///< Clamp information for scale axes - ClampState2D position; ///< Clamp information for position axes - ClampState rotation; ///< Clamp information for rotation + ClampState2D scale; ///< Clamp information for scale axes + ClampState2D position; ///< Clamp information for position axes + ClampState rotation; ///< Clamp information for rotation }; /** @@ -476,9 +467,9 @@ public: */ struct SnapEvent { - SnapType type; ///< Current snap commencing - Vector2 position; ///< Target snap position - float duration; ///< Duration of snap animation. + SnapType type; ///< Current snap commencing + Vector2 position; ///< Target snap position + float duration; ///< Duration of snap animation. }; /** @@ -487,11 +478,11 @@ public: */ enum PropertyRange { - PROPERTY_START_INDEX = Toolkit::Scrollable::PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.18 - PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices, @SINCE_1_1.18 + PROPERTY_START_INDEX = Toolkit::Scrollable::PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.18 + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices, @SINCE_1_1.18 ANIMATABLE_PROPERTY_START_INDEX = Toolkit::Scrollable::ANIMATABLE_PROPERTY_END_INDEX + 1, - ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX + 1000 ///< Reserve animatable property indices @SINCE_1_0.0 + ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX + 1000 ///< Reserve animatable property indices @SINCE_1_0.0 }; /** @@ -716,10 +707,9 @@ public: // Typedefs - typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type @SINCE_1_0.0 + typedef Signal SnapStartedSignalType; ///< SnapStarted signal type @SINCE_1_0.0 public: - /** * @brief Creates an empty ScrollView handle. * @SINCE_1_0.0 @@ -734,7 +724,15 @@ public: * @SINCE_1_0.0 * @param[in] handle Handle to copy from */ - ScrollView( const ScrollView& handle ); + ScrollView(const ScrollView& handle); + + /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + ScrollView(ScrollView&& rhs) noexcept; /** * @brief Assignment operator. @@ -744,7 +742,16 @@ public: * @param[in] handle The handle to copy from * @return A reference to this */ - ScrollView& operator=( const ScrollView& handle ); + ScrollView& operator=(const ScrollView& handle); + + /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + ScrollView& operator=(ScrollView&& rhs) noexcept; /** * @brief Destructor. @@ -772,10 +779,9 @@ public: * @param[in] handle Handle to an object * @return A handle to a ScrollView or an uninitialized handle */ - static ScrollView DownCast( BaseHandle handle ); + static ScrollView DownCast(BaseHandle handle); public: - /** * @brief Gets snap-animation's AlphaFunction. * @@ -875,7 +881,7 @@ public: * * @SINCE_1_0.0 * @param[in] sensitive @c true to enable scroll, @c false to disable scrolling - * @note Unlike Actor::SetSensitive(), this determines whether this ScrollView + * @note Unlike Actor::Property::SENSITIVE, this determines whether this ScrollView * should react (e.g. pan), without disrupting the sensitivity of its children. * */ @@ -1067,7 +1073,7 @@ public: * @SINCE_1_0.0 * @param[in] distance The minimum pan distance for a flick */ - void SetMinimumDistanceForFlick( const Vector2& distance ); + void SetMinimumDistanceForFlick(const Vector2& distance); /** * @brief Returns the minimum pan speed required for a flick gesture in pixels per second. @@ -1083,7 +1089,7 @@ public: * @SINCE_1_0.0 * @param[in] speed The minimum pan speed for a flick */ - void SetMinimumSpeedForFlick( float speed ); + void SetMinimumSpeedForFlick(float speed); /** * @brief Gets the maximum flick speed setting for ScrollView when @@ -1218,8 +1224,7 @@ public: * to get to the target page. * */ - void ScrollTo(const Vector2& position, float duration, - DirectionBias horizontalBias, DirectionBias verticalBias); + void ScrollTo(const Vector2& position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias); /** * @brief Scrolls View to position specified (contents will scroll to this position). @@ -1240,8 +1245,7 @@ public: * to get to the target page. * */ - void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha, - DirectionBias horizontalBias, DirectionBias verticalBias); + void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias); /** * @brief Scrolls View to page currently based on assumption that each page is @@ -1390,7 +1394,7 @@ public: * @param[in] threshold The threshold to apply around the axis * @note If no threshold is specified, then the default threshold of PI * 0.25 radians (or 45 degrees) is used. */ - void SetScrollingDirection( Radian direction, Radian threshold = PanGestureDetector::DEFAULT_THRESHOLD ); + void SetScrollingDirection(Radian direction, Radian threshold = PanGestureDetector::DEFAULT_THRESHOLD); /** * @brief Removes a direction constraint from the scroll view. @@ -1399,10 +1403,9 @@ public: * @param[in] direction The axis to stop constraining to. * Usually will be PanGestureDetector::DIRECTION_VERTICAL or PanGestureDetector::DIRECTION_HORIZONTAL (but can be any other angle if desired). */ - void RemoveScrollingDirection( Radian direction ); + void RemoveScrollingDirection(Radian direction); public: // Signals - /** * @brief Signal emitted when the ScrollView has started to snap or flick (it tells the target * position, scale, rotation for the snap or flick). @@ -1418,7 +1421,6 @@ public: // Signals SnapStartedSignalType& SnapStartedSignal(); public: // Not intended for application developers - /// @cond internal /** * @brief Creates a handle using the Toolkit::Internal implementation. @@ -1434,7 +1436,7 @@ public: // Not intended for application developers * @SINCE_1_0.0 * @param[in] internal A pointer to the internal CustomActor */ - explicit DALI_INTERNAL ScrollView( Dali::Internal::CustomActor* internal ); + explicit DALI_INTERNAL ScrollView(Dali::Internal::CustomActor* internal); /// @endcond }; @@ -1445,4 +1447,4 @@ public: // Not intended for application developers } // namespace Dali -#endif // __DALI_TOOLKIT_SCROLL_VIEW_H__ +#endif // DALI_TOOLKIT_SCROLL_VIEW_H