namespace Dali
{
-
namespace Toolkit
{
-
namespace Internal DALI_INTERNAL
{
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
};
/**
*/
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
};
/**
*/
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
};
/**
class DALI_TOOLKIT_API RulerDomain
{
public:
-
/**
* @brief Creates Ruler domain allowing a point to traverse between min and max extents.
*
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).
* @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.
* @return The size of the ruler from min to max
*/
float GetSize() const;
-
};
// Forward declare future extension interface
* @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
* @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
* @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.
*
* @SINCE_1_0.0
* @return The domain
*/
- const RulerDomain &GetDomain() const;
+ const RulerDomain& GetDomain() const;
/**
* @brief Disables Domain (minimum/maximum extents for this axis).
*/
float Clamp(float x, float length = 0.0f, float scale = 1.0f) const;
-
/**
* @brief Clamps value (x) from (min) to (max).
*
* @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.
* @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
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<Ruler> RulerPtr; ///< Pointer to Dali::Toolkit::Ruler object @SINCE_1_0.0
/**
* @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;
};
/**
/**
* @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
*/
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
};
/**
*/
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.
};
/**
*/
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
};
/**
// Typedefs
- typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type @SINCE_1_0.0
+ typedef Signal<void(const SnapEvent&)> SnapStartedSignalType; ///< SnapStarted signal type @SINCE_1_0.0
public:
-
/**
* @brief Creates an empty ScrollView handle.
* @SINCE_1_0.0
* @SINCE_1_0.0
* @param[in] handle Handle to copy from
*/
- ScrollView( const ScrollView& handle );
+ ScrollView(const ScrollView& handle);
/**
* @brief Move constructor
*
* @param[in] rhs A reference to the moved handle
*/
- ScrollView( ScrollView&& rhs );
+ ScrollView(ScrollView&& rhs);
/**
* @brief Assignment operator.
* @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
* @param[in] rhs A reference to the moved handle
* @return A reference to this
*/
- ScrollView& operator=( ScrollView&& rhs );
+ ScrollView& operator=(ScrollView&& rhs);
/**
* @brief Destructor.
* @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.
*
* @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.
* @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
* 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).
* 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
* @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.
* @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).
SnapStartedSignalType& SnapStartedSignal();
public: // Not intended for application developers
-
/// @cond internal
/**
* @brief Creates a handle using the Toolkit::Internal implementation.
* @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
};