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%2Fscrollable.h;h=d43a29a7b0ecc465f9b2c8b48b60c91365484208;hp=62f61007b0056d9fd58f4f30ba3fe8329b0c10e4;hb=07bbc876b9b069903dd4ed86c9dd5f2f66fc3b86;hpb=389593ad328d5a86972e32148a0ba45bad687b41 diff --git a/dali-toolkit/public-api/controls/scrollable/scrollable.h b/dali-toolkit/public-api/controls/scrollable/scrollable.h index 62f6100..d43a29a 100644 --- a/dali-toolkit/public-api/controls/scrollable/scrollable.h +++ b/dali-toolkit/public-api/controls/scrollable/scrollable.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_SCROLLABLE_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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. @@ -31,6 +31,10 @@ namespace Internal DALI_INTERNAL { class Scrollable; } +/** + * @addtogroup dali-toolkit-controls-scrollable + * @{ + */ /** * @brief Base class for derived Scrollables that contains actors that can be scrolled manually @@ -50,16 +54,6 @@ class DALI_IMPORT_API Scrollable : public Control public: /** - * @brief Scroll component types - */ - enum ScrollComponentType - { - HorizontalScrollBar, - VerticalScrollBar, - OvershootIndicator, - }; - - /** * @brief The start and end property ranges for this control. */ enum PropertyRange @@ -83,35 +77,23 @@ public: OVERSHOOT_ANIMATION_SPEED, ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type float // Animatable properties - SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-relative-position", type Vector3 - SCROLL_POSITION_MIN, ///< Property, name "scroll-position-min", type Vector3 - SCROLL_POSITION_MAX, ///< Property, name "scroll-position-max", type Vector3 - SCROLL_DIRECTION, ///< Property, name "scroll-direction", type Vector2 + SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-relative-position", type Vector2 + SCROLL_POSITION_MIN, ///< Property, name "scroll-position-min", type Vector2 + SCROLL_POSITION_MIN_X, ///< Property, name "scroll-position-min-x", type float + SCROLL_POSITION_MIN_Y, ///< Property, name "scroll-position-min-y", type float + SCROLL_POSITION_MAX, ///< Property, name "scroll-position-max", type Vector2 + SCROLL_POSITION_MAX_X, ///< Property, name "scroll-position-max-x", type float + SCROLL_POSITION_MAX_Y, ///< Property, name "scroll-position-max-y", type float CAN_SCROLL_VERTICAL, ///< Property, name "can-scroll-vertical", type bool CAN_SCROLL_HORIZONTAL ///< Property, name "can-scroll-horizontal", type bool }; }; -public: - - typedef Signal< void ( const Vector3& ) > ScrollStartedSignalType; ///< ScrollStarted signal type - typedef Signal< void ( const Vector3& ) > ScrollCompletedSignalType; ///< ScrollCompleted signal type - typedef Signal< void ( const Vector3& ) > ScrollUpdatedSignalType; ///< Scroll updated signal type - - /** - * @brief Signal emitted when the Scrollable has moved (whether by touch or animation). - */ - ScrollStartedSignalType& ScrollStartedSignal(); - - /** - * @brief Signal emitted when the Scrollable has moved (whether by touch or animation). - */ - ScrollUpdatedSignalType& ScrollUpdatedSignal(); + // Typedefs - /** - * @brief Signal emitted when the Scrollable has completed movement (whether by touch or animation). - */ - ScrollCompletedSignalType& ScrollCompletedSignal(); + typedef Signal< void ( const Vector2& ) > ScrollStartedSignalType; ///< ScrollStarted signal type + typedef Signal< void ( const Vector2& ) > ScrollCompletedSignalType; ///< ScrollCompleted signal type + typedef Signal< void ( const Vector2& ) > ScrollUpdatedSignalType; ///< Scroll updated signal type public: @@ -157,26 +139,18 @@ public: static Scrollable DownCast( BaseHandle handle ); /** - * @brief Checks if a ScrollComponent has been enabled or not. - * - * @param[in] type The Scroll Component Type to check - * @return True (if Enabled) - */ - bool IsScrollComponentEnabled(Scrollable::ScrollComponentType type) const; - - /** - * @brief Enables a ScrollComponent. + * @brief Checks if scroll overshoot has been enabled or not. * - * @param[in] type The Scroll Component Type to enable + * @return Whether the scroll obvershoot is enabled */ - void EnableScrollComponent(Scrollable::ScrollComponentType type); + bool IsOvershootEnabled() const; /** - * @brief Disables a ScrollComponent. + * @brief Sets whether to enables or disable scroll overshoot. * - * @param[in] type The Scroll Component Type to disable + * @param[in] enable Whether to enable the scroll obvershoot or not */ - void DisableScrollComponent(Scrollable::ScrollComponentType type); + void SetOvershootEnabled(bool enable); /** * @brief Set the color of the overshoot effect. @@ -204,6 +178,44 @@ public: */ float GetOvershootAnimationSpeed() const; +public: // Signals + + /** + * @brief Signal emitted when the Scrollable has moved (whether by touch or animation). + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(const Vector2& currentScrollPosition); + * @endcode + * @pre The Object has been initialized. + * @return The signal to connect to. + */ + ScrollStartedSignalType& ScrollStartedSignal(); + + /** + * @brief Signal emitted when the Scrollable has moved (whether by touch or animation). + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(const Vector2& currentScrollPosition); + * @endcode + * @pre The Object has been initialized. + * @return The signal to connect to. + */ + ScrollUpdatedSignalType& ScrollUpdatedSignal(); + + /** + * @brief Signal emitted when the Scrollable has completed movement (whether by touch or animation). + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(const Vector2& currentScrollPosition); + * @endcode + * @pre The Object has been initialized. + * @return The signal to connect to. + */ + ScrollCompletedSignalType& ScrollCompletedSignal(); + public: // Not intended for application developers /** @@ -221,6 +233,9 @@ public: // Not intended for application developers explicit DALI_INTERNAL Scrollable( Dali::Internal::CustomActor* internal ); }; +/** + * @} + */ } // namespace Toolkit } // namespace Dali