X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fscrollable%2Fscrollable.h;h=a00aeff627e01e84b4a1c0b2bc2cc9069add9638;hb=b3aff14cae6b3af637e75171422c16661878ba8e;hp=907f7a1911031a5b30ae6564e4cb6c6820fce6af;hpb=306d2f61a1b64179e801fa8a0bb2bd7b4e9dd682;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 907f7a1..a00aeff 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. @@ -33,55 +33,23 @@ class Scrollable; } /** - * @brief How axes/rotation or scale are clamped - */ -enum ClampState -{ - NotClamped, ///< The quantity isn't clamped - ClampedToMin, ///< The quantity is clamped to the min value - ClampedToMax ///< The quantity is clamped to the max value -}; - -/** - * @brief A 2 dimensional clamp - */ -struct ClampState2 -{ - ClampState x; ///< The clamp state of the x axis - ClampState y; ///< The clamp state of the y axis -}; - -/** - * @brief A 3 dimensional clamp - */ -struct ClampState3 -{ - ClampState x; ///< The clamp state of the x axis - ClampState y; ///< The clamp state of the y axis - ClampState z; ///< The clamp state of the z axis -}; - -/** * @brief Base class for derived Scrollables that contains actors that can be scrolled manually * (via touch) or automatically. * * 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() | */ class DALI_IMPORT_API Scrollable : public Control { public: /** - * @brief Clamp signal event's data - */ - struct ClampEvent - { - ClampState3 scale; ///< Clamp information for scale axes - ClampState3 position; ///< Clamp information for position axes - ClampState rotation; ///< Clamp information for rotation - }; - - /** * @brief Scroll component types */ enum ScrollComponentType @@ -91,33 +59,44 @@ public: 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 - /// @name Properties - /** @{ */ - static const Property::Index PROPERTY_OVERSHOOT_EFFECT_COLOR; ///< Property, name "overshoot-effect-color", @see SetOvershootEffectColor(), type VECTOR4 - static const Property::Index PROPERTY_OVERSHOOT_ANIMATION_SPEED; ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type FLOAT - /** @} */ + ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX, + ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices + }; - /// @name Signals - /** @{ */ - static const char* const SIGNAL_SCROLL_STARTED; ///< "scroll-started"; - static const char* const SIGNAL_SCROLL_COMPLETED; ///< "scroll-completed"; - static const char* const SIGNAL_SCROLL_UPDATED; ///< "scroll-updated"; - static const char* const SIGNAL_SCROLL_CLAMPED; ///< "scroll-clamped"; - /** @} */ + /** + * @brief An enumeration of properties belonging to the Scrollable class. + */ + struct Property + { + enum + { + // Event side properties + 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 + + // 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 + 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 - typedef Signal< void ( const ClampEvent& ) > ScrollClampedSignalType; ///< Scroll clamped signal type /** * @brief Signal emitted when the Scrollable has moved (whether by touch or animation). @@ -134,14 +113,6 @@ public: */ ScrollCompletedSignalType& ScrollCompletedSignal(); - /** - * @brief Signal emitted when the Scrollable is pushing against a domain boundary - * (in either position, scale, or rotation). - * - * @return The signal to connect to - */ - ScrollClampedSignalType& ScrollClampedSignal(); - public: /**