X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fscrollable%2Fscrollable.h;h=76dbb074757c17abf076330eafca6f120edb0fa1;hb=421d28ac0c56bca53a4c187983de6c20b56957c5;hp=f28a9dabb6941bda3ff3f812592f10cfdfd1f3d4;hpb=b458e407eba11c73f38da68bce8e967a30ea03e2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/scrollable/scrollable.h b/dali-toolkit/public-api/controls/scrollable/scrollable.h index f28a9da..76dbb07 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 @@ -39,40 +43,26 @@ class Scrollable; * Scrollables such as ScrollView and ItemView can be derived from this class. * * Signals - * | %Signal Name | Method | - * |-------------------|------------------------------| - * | scroll-started | @ref ScrollStartedSignal() | - * | scroll-completed | @ref ScrollUpdatedSignal() | - * | scroll-updated | @ref ScrollCompletedSignal() | + * | %Signal Name | Method | + * |------------------|------------------------------| + * | scrollStarted | @ref ScrollStartedSignal() | + * | scrollCompleted | @ref ScrollUpdatedSignal() | + * | scrollUpdated | @ref ScrollCompletedSignal() | */ class DALI_IMPORT_API Scrollable : public Control { public: /** - * @brief Scroll component types - */ - enum ScrollComponentType - { - HorizontalScrollBar, - VerticalScrollBar, - OvershootIndicator, - }; - - // Custom properties - - static const std::string SCROLL_RELATIVE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-relative-position", type VECTOR3 - static const std::string SCROLL_POSITION_MIN_PROPERTY_NAME; ///< Property, name "scroll-position-min", type VECTOR3 - static const std::string SCROLL_POSITION_MAX_PROPERTY_NAME; ///< Property, name "scroll-position-max", type VECTOR3 - static const std::string SCROLL_DIRECTION_PROPERTY_NAME; ///< Property, name "scroll-direction", type VECTOR2 - - /** * @brief The start and end property ranges for this control. */ enum PropertyRange { PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, - PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices + + ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX, + ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices }; /** @@ -82,31 +72,28 @@ public: { enum { - OVERSHOOT_EFFECT_COLOR = PROPERTY_START_INDEX, ///< Property, name "overshoot-effect-color", @see SetOvershootEffectColor(), type VECTOR4 - OVERSHOOT_ANIMATION_SPEED, ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type FLOAT + // Event side properties + OVERSHOOT_EFFECT_COLOR = PROPERTY_START_INDEX, ///< Property, name "overshootEffectColor", @see SetOvershootEffectColor(), type Vector4 + OVERSHOOT_ANIMATION_SPEED, ///< Property, name "overshootAnimationSpeed", @see SetOvershootAnimationSpeed(), type float + + // Animatable properties + SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scrollRelativePosition", type Vector2 + SCROLL_POSITION_MIN, ///< Property, name "scrollPositionMin", type Vector2 + SCROLL_POSITION_MIN_X, ///< Property, name "scrollPositionMinX", type float + SCROLL_POSITION_MIN_Y, ///< Property, name "scrollPositionMinY", type float + SCROLL_POSITION_MAX, ///< Property, name "scrollPositionMax", type Vector2 + SCROLL_POSITION_MAX_X, ///< Property, name "scrollPositionMaxX", type float + SCROLL_POSITION_MAX_Y, ///< Property, name "scrollPositionMaxY", type float + CAN_SCROLL_VERTICAL, ///< Property, name "canScrollVertical", type bool + CAN_SCROLL_HORIZONTAL ///< Property, name "canScrollHorizontal", 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(); + // Typedefs - /** - * @brief Signal emitted when the Scrollable has moved (whether by touch or animation). - */ - ScrollUpdatedSignalType& ScrollUpdatedSignal(); - - /** - * @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: @@ -152,26 +139,18 @@ public: static Scrollable DownCast( BaseHandle handle ); /** - * @brief Checks if a ScrollComponent has been enabled or not. + * @brief Checks if scroll overshoot has been enabled or not. * - * @param[in] type The Scroll Component Type to check - * @return True (if Enabled) + * @return Whether the scroll obvershoot is enabled */ - bool IsScrollComponentEnabled(Scrollable::ScrollComponentType type) const; + bool IsOvershootEnabled() const; /** - * @brief Enables a ScrollComponent. + * @brief Sets whether to enables or disable scroll overshoot. * - * @param[in] type The Scroll Component Type to enable + * @param[in] enable Whether to enable the scroll obvershoot or not */ - void EnableScrollComponent(Scrollable::ScrollComponentType type); - - /** - * @brief Disables a ScrollComponent. - * - * @param[in] type The Scroll Component Type to disable - */ - void DisableScrollComponent(Scrollable::ScrollComponentType type); + void SetOvershootEnabled(bool enable); /** * @brief Set the color of the overshoot effect. @@ -199,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 /** @@ -216,6 +233,9 @@ public: // Not intended for application developers explicit DALI_INTERNAL Scrollable( Dali::Internal::CustomActor* internal ); }; +/** + * @} + */ } // namespace Toolkit } // namespace Dali