X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscrollable-impl.h;h=1f876ad7f4a1450b985fd112df58bccbc048bc80;hb=66c5b1e0a29cc284f7acbe3f1e0e6bd8ee43316e;hp=b784c02013f6652f7f98b479fcd95d7c96cf232e;hpb=e2eda444afbe82e9591fe198eef339227f90a616;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/scrollable-impl.h b/dali-toolkit/internal/controls/scrollable/scrollable-impl.h index b784c02..1f876ad 100644 --- a/dali-toolkit/internal/controls/scrollable/scrollable-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scrollable-impl.h @@ -1,28 +1,30 @@ #ifndef __DALI_TOOLKIT_INTERNAL_SCROLLABLE_H__ #define __DALI_TOOLKIT_INTERNAL_SCROLLABLE_H__ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ -// INTERNAL INCLUDES -#include +// EXTERNAL INCLUDES +#include +// INTERNAL INCLUDES #include #include -#include +#include namespace Dali { @@ -39,19 +41,9 @@ typedef IntrusivePtr ScrollablePtr; /** * @copydoc Toolkit::Scrollable */ -class Scrollable : public ControlImpl +class Scrollable : public Control { public: - static const std::string SCROLLABLE_CAN_SCROLL_VERTICAL; - static const std::string SCROLLABLE_CAN_SCROLL_HORIZONTAL; - - /** - * Create a new Scrollable. - * @return A public handle to the newly allocated Scrollable. - */ -// static Dali::Toolkit::Scrollable New(); - -public: /** * @copydoc Dali::Toolkit::Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType type) @@ -105,6 +97,28 @@ public: */ virtual void ScrollTo(const Vector3 &position, float duration) = 0; + /** + * Set the color of the overshoot effect. + * @parm[in] color The color of the overshoot effect + */ + virtual void SetOvershootEffectColor( const Vector4& color ) = 0; + + /** + * Retrieve the color of the overshoot effect. + * @return The color of the overshoot effect. + */ + Vector4 GetOvershootEffectColor() const; + + /** + * @copydoc Dali::Toolkit::Scrollable::SetOvershootAnimationSpeed(float pixelsPerSecond) + */ + void SetOvershootAnimationSpeed( float pixelsPerSecond ); + + /** + * @copydoc Dali::Toolkit::Scrollable::GetOvershootAnimationSpeed() + */ + float GetOvershootAnimationSpeed() const; + private: /** @@ -119,22 +133,17 @@ public: //Signals /** * @copydoc Dali::Toolkit::Scrollable::ScrollStartedSignal() */ - Toolkit::Scrollable::ScrollStartedSignalV2& ScrollStartedSignal(); + Toolkit::Scrollable::ScrollStartedSignalType& ScrollStartedSignal(); /** * @copydoc Dali::Toolkit::Scrollable::ScrollUpdatedSignal() */ - Toolkit::Scrollable::ScrollUpdatedSignalV2& ScrollUpdatedSignal(); + Toolkit::Scrollable::ScrollUpdatedSignalType& ScrollUpdatedSignal(); /** * @copydoc Dali::Toolkit::Scrollable::ScrollCompletedSignal() */ - Toolkit::Scrollable::ScrollCompletedSignalV2& ScrollCompletedSignal(); - - /** - * @copydoc Dali::Toolkit::Scrollable::ScrollClampedSignal() - */ - Toolkit::Scrollable::ScrollClampedSignalV2& ScrollClampedSignal(); + Toolkit::Scrollable::ScrollCompletedSignalType& ScrollCompletedSignal(); /** * Connects a callback function with the object's signals. @@ -147,6 +156,24 @@ public: //Signals */ static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + //properties + + /** + * Called when a property of an object of this type is set. + * @param[in] object The object whose property is set. + * @param[in] index The property index. + * @param[in] value The new property value. + */ + static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ); + + /** + * Called to retrieve a property of an object of this type. + * @param[in] object The object whose property is to be retrieved. + * @param[in] index The property index. + * @return The current value of the property. + */ + static Property::Value GetProperty( BaseObject* object, Property::Index index ); + protected: /** @@ -155,14 +182,16 @@ protected: Scrollable(); /** - * A reference counted object may only be deleted by calling Unreference() + * @brief Construct a new Scrollable. + * + * @param[in] behaviourFlags Flags to enable */ - virtual ~Scrollable(); + Scrollable( ControlBehaviour behaviourFlags ); /** - * Register common properties + * A reference counted object may only be deleted by calling Unreference() */ - void RegisterCommonProperties(); + virtual ~Scrollable(); private: @@ -181,21 +210,24 @@ private: // Undefined Scrollable& operator=(const Scrollable& rhs); + /** + * Helper to create an initialized ScrollComponent + * @param[in] scrollable reference to ScrollView implementation + * @param[in] type the type of scroll component to create. + * @return A pointer to the created ScrollComponent. + */ + Toolkit::ScrollComponent NewScrollComponent(Toolkit::Scrollable& scrollable, Toolkit::Scrollable::ScrollComponentType type); + protected: - Property::Index mPropertyRelativePosition;///< Scroll Relative Position ("scroll-relative-position") [range from 0.0f - 1.0f in each axes] - Property::Index mPropertyPositionMin; ///< Scroll Domain Minimum ("position-min") - Property::Index mPropertyPositionMax; ///< Scroll Domain Maximum ("position-max") - Property::Index mPropertyScrollDirection; ///< Scroll direction ("scroll-direction") - Property::Index mPropertyCanScrollVertical; ///< Whether the current scroll domain is large enough to scroll vertically - Property::Index mPropertyCanScrollHorizontal; ///< Whether the current scroll domain is large enough to scroll horizontally + Vector4 mOvershootEffectColor; /// mComponent; ///< ScrollComponent (such as a scrollbar/page indicator/status) - Toolkit::Scrollable::ScrollStartedSignalV2 mScrollStartedSignalV2; - Toolkit::Scrollable::ScrollUpdatedSignalV2 mScrollUpdatedSignalV2; - Toolkit::Scrollable::ScrollCompletedSignalV2 mScrollCompletedSignalV2; - Toolkit::Scrollable::ScrollClampedSignalV2 mScrollClampedSignalV2; + Toolkit::Scrollable::ScrollStartedSignalType mScrollStartedSignal; + Toolkit::Scrollable::ScrollUpdatedSignalType mScrollUpdatedSignal; + Toolkit::Scrollable::ScrollCompletedSignalType mScrollCompletedSignal; private: @@ -203,7 +235,7 @@ private: typedef ComponentContainer::iterator ComponentIter; ComponentContainer mComponents; ///< ScrollComponent (such as a scrollbar/page indicator/status) - bool mOvershootEnabled; + bool mOvershootEnabled:1; }; } // namespace Internal