X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-connector-impl.h;h=ff91e1b4870223e6e250df32b8e4303eb7ace121;hb=66c5b1e0a29cc284f7acbe3f1e0e6bd8ee43316e;hp=5d169b1a1096b2a4a2fed3741ca648dcbe0de61c;hpb=7c48d81eb1f49aab3c852ab83c9f688cfdfadd0d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h index 5d169b1..ff91e1b 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h @@ -1,21 +1,26 @@ #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_CONNECTOR_H__ #define __DALI_TOOLKIT_INTERNAL_SCROLL_CONNECTOR_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. + * + */ + +// EXTERNAL INCLUDES +#include +#include // INTERNAL INCLUDES #include @@ -36,7 +41,8 @@ class ScrollConnector : public Dali::BaseObject { public: - typedef Toolkit::ScrollConnector::LimitsChangedSignalType LimitsChangedSignalType; + typedef Toolkit::ScrollConnector::DomainChangedSignalType DomainChangedSignalType; + typedef Toolkit::ScrollConnector::ScrollPositionChangedSignalType ScrollPositionChangedSignalType; static const Property::Index SCROLL_POSITION; static const Property::Index OVERSHOOT; @@ -48,9 +54,9 @@ public: static ScrollConnector* New(); /** - * @copydoc Toolkit::ScrollConnector::SetLimits() + * @copydoc Toolkit::ScrollConnector::SetScrollDomain() */ - void SetLimits( float min, float max ); + void SetScrollDomain( float min, float max, float length ); /** * @copydoc Toolkit::ScrollConnector::GetMinLimit() @@ -69,22 +75,62 @@ public: } /** - * Signal emitted after the SetLimits() method has been called. + * @copydoc Toolkit::ScrollConnector::GetContentLength() + */ + float GetContentLength() const + { + return mContentLength; + } + + /** + * @copydoc Toolkit::ScrollConnector::SetScrollPosition() + */ + void SetScrollPosition( float position ); + + /** + * @copydoc Toolkit::ScrollConnector::GetScrollPosition() */ - LimitsChangedSignalType& LimitsChangedSignal() + float GetScrollPosition() const { - return mLimitsChangedSignal; + return mScrollPositionObject.GetProperty( Toolkit::ScrollConnector::SCROLL_POSITION ); + } + + /** + * Signal emitted after the SetScrollPosition() method has been called. + */ + ScrollPositionChangedSignalType& ScrollPositionChangedSignal() + { + return mScrollPositionChangedSignal; + } + + /** + * Signal emitted after the SetScrollDomain() method has been called. + */ + DomainChangedSignalType& DomainChangedSignal() + { + return mDomainChangedSignal; } /** * Retrieve the object which provides the "scroll-position" property. * @return The scroll-position object. */ - Constrainable GetScrollPositionObject() const + Handle GetScrollPositionObject() const { return mScrollPositionObject; } + /** + * Connects a callback function with the object's signals. + * @param[in] object The object providing the signal. + * @param[in] tracker Used to disconnect the signal. + * @param[in] signalName The signal to connect to. + * @param[in] functor A newly allocated FunctorDelegate. + * @return True if the signal was connected. + * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. + */ + static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); + private: /** @@ -105,12 +151,14 @@ private: private: - Constrainable mScrollPositionObject; + Handle mScrollPositionObject; - LimitsChangedSignalType mLimitsChangedSignal; + DomainChangedSignalType mDomainChangedSignal; + ScrollPositionChangedSignalType mScrollPositionChangedSignal; float mMinLimit; float mMaxLimit; + float mContentLength; }; } // namespace Internal