class ItemView;
}
+class ScrollConnector;
class ItemFactory;
class ItemLayout;
static ItemView DownCast( BaseHandle handle );
/**
+ * Retrieve a scroll-connector; this can be used to connect scroll components e.g. scroll bars.
+ * @return The connector.
+ */
+ ScrollConnector GetScrollConnector() const;
+
+ /**
* Query the number of layouts.
* @return The number of layouts.
*/
// INTERNAL INCLUDES
#include <dali/public-api/events/mouse-wheel-event.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
+#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
using namespace std;
using namespace Dali;
mOvershootOverlay.SetPixelArea(OVERSHOOT_BOUNCE_IMAGE_1_PIXEL_AREA);
self.Add(mOvershootOverlay);
- mPropertyLayoutPosition = self.RegisterProperty(LAYOUT_POSITION_PROPERTY_NAME, 0.0f);
+ mScrollConnector = Dali::Toolkit::ScrollConnector::New();
+ mScrollPositionObject = mScrollConnector.GetScrollPositionObject();
+
mPropertyMinimumLayoutPosition = self.RegisterProperty(MINIMUM_LAYOUT_POSITION_PROPERTY_NAME, 0.0f);
mPropertyPosition = self.RegisterProperty(POSITION_PROPERTY_NAME, 0.0f);
mPropertyScrollSpeed = self.RegisterProperty(SCROLL_SPEED_PROPERTY_NAME, 0.0f);
{
}
+Dali::Toolkit::ScrollConnector ItemView::GetScrollConnector() const
+{
+ return mScrollConnector;
+}
+
unsigned int ItemView::GetLayoutCount() const
{
return mLayouts.size();
float ItemView::GetCurrentLayoutPosition(unsigned int itemId) const
{
- return Self().GetProperty<float>(mPropertyLayoutPosition) + static_cast<float>(itemId);
+ return mScrollPositionObject.GetProperty<float>( ScrollConnector::SCROLL_POSITION ) + static_cast<float>( itemId );
}
void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSize, float durationSeconds)
bool scrollAnimationNeeded(false);
float firstItemScrollPosition(0.0f);
- float current = self.GetProperty<float>(mPropertyLayoutPosition);
+ float current = GetCurrentLayoutPosition(0);
float minimum = ClampFirstItemPosition(current, targetSize, *mActiveLayout);
self.SetProperty(mPropertyPosition, GetScrollPosition(current, targetSize));
{
RemoveAnimation(mScrollAnimation);
mScrollAnimation = Animation::New(mAnchoringDuration);
- mScrollAnimation.AnimateTo( Property(self, mPropertyLayoutPosition), firstItemScrollPosition, AlphaFunctions::EaseOut );
+ mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, targetSize), AlphaFunctions::EaseOut );
mScrollAnimation.Play();
}
ItemRange available(0u, itemCount);
- ItemRange range = layout.GetItemsWithinArea(Self().GetProperty<float>(mPropertyLayoutPosition), layoutSize);
+ ItemRange range = layout.GetItemsWithinArea( GetCurrentLayoutPosition(0), layoutSize );
if (reserveExtra)
{
{
Actor self = Self();
const Vector3 layoutSize = Self().GetCurrentSize();
- float layoutPositionDelta = self.GetProperty<float>(mPropertyLayoutPosition) + (event.z * mMouseWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor());
+ float layoutPositionDelta = GetCurrentLayoutPosition(0) + (event.z * mMouseWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor());
float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout);
- self.SetProperty(mPropertyLayoutPosition, firstItemScrollPosition);
+
+ mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
self.SetProperty(mPropertyPosition, GetScrollPosition(firstItemScrollPosition, layoutSize));
mScrollStartedSignalV2.Emit(GetCurrentScrollPosition());
StartRefreshTimer();
WrappedVector3Constraint wrapped(positionConstraint, itemId);
Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- ParentSource( mPropertyLayoutPosition ),
+ Source( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ),
ParentSource( mPropertyScrollSpeed ),
ParentSource( Actor::SIZE ),
wrapped );
WrappedQuaternionConstraint wrapped(rotationConstraint, itemId);
Constraint constraint = Constraint::New<Quaternion>( Actor::ROTATION,
- ParentSource( mPropertyLayoutPosition ),
+ Source( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ),
ParentSource( mPropertyScrollSpeed ),
ParentSource( Actor::SIZE ),
wrapped );
WrappedVector3Constraint wrapped(scaleConstraint, itemId);
Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- ParentSource( mPropertyLayoutPosition ),
+ Source( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ),
ParentSource( mPropertyScrollSpeed ),
ParentSource( Actor::SIZE ),
wrapped );
WrappedVector4Constraint wrapped(colorConstraint, itemId);
Constraint constraint = Constraint::New<Vector4>( Actor::COLOR,
- ParentSource( mPropertyLayoutPosition ),
+ Source( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ),
ParentSource( mPropertyScrollSpeed ),
ParentSource( Actor::SIZE ),
wrapped );
WrappedBoolConstraint wrapped(visibilityConstraint, itemId);
Constraint constraint = Constraint::New<bool>( Actor::VISIBLE,
- ParentSource( mPropertyLayoutPosition ),
+ Source( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ),
ParentSource( mPropertyScrollSpeed ),
ParentSource( Actor::SIZE ),
wrapped );
mRefreshOrderHint = true;
- float currentLayoutPosition = self.GetProperty<float>(mPropertyLayoutPosition);
+ float currentLayoutPosition = GetCurrentLayoutPosition(0);
float firstItemScrollPosition = ClampFirstItemPosition(currentLayoutPosition + mScrollSpeed * direction,
layoutSize,
*mActiveLayout);
float flickAnimationDuration = mActiveLayout->GetItemFlickAnimationDuration() * max(1.0f, fabsf(firstItemScrollPosition - GetCurrentLayoutPosition(0)));
mScrollAnimation = Animation::New(flickAnimationDuration);
- mScrollAnimation.AnimateTo( Property(self, mPropertyLayoutPosition), firstItemScrollPosition, AlphaFunctions::EaseOut );
+ mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunctions::EaseOut );
mScrollAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), 0.0f, AlphaFunctions::EaseOut );
mScrollSpeedAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), mScrollSpeed, AlphaFunctions::Linear );
mScrollSpeedAnimation.Play();
- float layoutPositionDelta = self.GetProperty<float>(mPropertyLayoutPosition) + (mScrollDistance * mActiveLayout->GetScrollSpeedFactor());
+ float layoutPositionDelta = GetCurrentLayoutPosition(0) + (mScrollDistance * mActiveLayout->GetScrollSpeedFactor());
float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout);
- self.SetProperty(mPropertyLayoutPosition, firstItemScrollPosition);
+ mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
self.SetProperty(mPropertyPosition, GetScrollPosition(firstItemScrollPosition, layoutSize));
mScrollStartedSignalV2.Emit(GetCurrentScrollPosition());
return nextFocusActor;
}
}
- float layoutPosition = mActiveLayout->GetClosestAnchorPosition(Self().GetProperty<float>(mPropertyLayoutPosition));
+ float layoutPosition = mActiveLayout->GetClosestAnchorPosition( GetCurrentLayoutPosition(0) );
Vector3 layoutSize = Self().GetCurrentSize();
if(!nextFocusActor)
{
if(commitedFocusableActor)
{
int nextItemID = GetItemId(commitedFocusableActor);
- float layoutPosition = Self().GetProperty<float>(mPropertyLayoutPosition);
+ float layoutPosition = GetCurrentLayoutPosition(0);
Vector3 layoutSize = Self().GetCurrentSize();
Vector3 focusItemPosition = Vector3::ZERO;
ItemLayout::Vector3Function itemPositionConstraint;
if (mActiveLayout && mAnchoringEnabled)
{
- float anchorPosition = mActiveLayout->GetClosestAnchorPosition(Self().GetProperty<float>(mPropertyLayoutPosition));
+ float anchorPosition = mActiveLayout->GetClosestAnchorPosition( GetCurrentLayoutPosition(0) );
anchoringAnimation = Animation::New(mAnchoringDuration);
- anchoringAnimation.AnimateTo( Property(self, mPropertyLayoutPosition), anchorPosition, AlphaFunctions::EaseOut );
+ anchoringAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), anchorPosition, AlphaFunctions::EaseOut );
anchoringAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(anchorPosition, self.GetCurrentSize()), AlphaFunctions::EaseOut );
anchoringAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), 0.0f, AlphaFunctions::EaseOut );
if(!mIsFlicking)
{
RemoveAnimation(mScrollAnimation);
mScrollAnimation = Animation::New(durationSeconds);
- mScrollAnimation.AnimateTo( Property(self, mPropertyLayoutPosition), firstItemScrollPosition, AlphaFunctions::EaseOut );
+ mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunctions::EaseOut );
mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnScrollFinished);
mScrollAnimation.Play();
}
else
{
- self.SetProperty(mPropertyLayoutPosition, firstItemScrollPosition);
+ mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
AnimateScrollOvershoot(0.0f);
}
{
Actor self = Self();
- float currentLayoutPosition = ClampFirstItemPosition(self.GetProperty<float>(mPropertyLayoutPosition), layoutSize, *mActiveLayout);
+ float currentLayoutPosition = ClampFirstItemPosition( GetCurrentLayoutPosition(0), layoutSize, *mActiveLayout );
float forwardClampedPosition = ClampFirstItemPosition(currentLayoutPosition + 1.0, layoutSize, *mActiveLayout);
float backwardClampedPosition = ClampFirstItemPosition(currentLayoutPosition - 1.0, layoutSize, *mActiveLayout);
Vector3 ItemView::GetCurrentScrollPosition() const
{
- float currentLayoutPosition = Self().GetProperty<float>(mPropertyLayoutPosition);
+ float currentLayoutPosition = GetCurrentLayoutPosition(0);
return Vector3(0.0f, GetScrollPosition(currentLayoutPosition, Self().GetCurrentSize()), 0.0f);
}
{
RemoveAnimation(mScrollAnimation);
mScrollAnimation = Animation::New(duration);
- mScrollAnimation.AnimateTo( Property(self, mPropertyLayoutPosition), firstItemScrollPosition, AlphaFunctions::EaseOut );
+ mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunctions::EaseOut );
mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnScrollFinished);
mScrollAnimation.Play();
}
else
{
- self.SetProperty(mPropertyLayoutPosition, firstItemScrollPosition);
+ mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
AnimateScrollOvershoot(0.0f);
}
// since the pan gesture starts.
Actor self = Self();
float scrollDistance = CalculateScrollDistance(mTotalPanDisplacement, *mActiveLayout) * mActiveLayout->GetScrollSpeedFactor();
- float positionDelta = self.GetProperty<float>(mPropertyLayoutPosition) + scrollDistance;
+ float positionDelta = GetCurrentLayoutPosition(0) + scrollDistance;
float minLayoutPosition = mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), Self().GetCurrentSize());
self.SetProperty(mPropertyMinimumLayoutPosition, minLayoutPosition);
float clamppedPosition = min(0.0f, max(minLayoutPosition, positionDelta));
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
#include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
static Dali::Toolkit::ItemView New(ItemFactory& factory);
/**
+ * @copydoc Toolkit::ItemView::GetScrollConnector
+ */
+ Dali::Toolkit::ScrollConnector GetScrollConnector() const;
+
+ /**
* @copydoc Toolkit::ItemView::GetLayoutCount
*/
unsigned int GetLayoutCount() const;
ImageActor mOvershootOverlay; ///< The overlay actor for overshoot effect
OvershootRippleEffect mOvershootEffect; ///< The vertex/fragment shader used to display the overshoot ripple effect
- Property::Index mPropertyLayoutPosition; ///< The logical position of the first item within the layout
+ Dali::Toolkit::ScrollConnector mScrollConnector; ///< Connects ItemView with scrollable components e.g. scroll bars
+ Constrainable mScrollPositionObject; ///< From mScrollConnector
+
Property::Index mPropertyPosition; ///< The physical position of the first item within the layout
Property::Index mPropertyMinimumLayoutPosition; ///< The minimum valid layout position in the layout.
Property::Index mPropertyScrollSpeed; ///< The current scroll speed of item view
--- /dev/null
+//
+// 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.
+//
+
+// CLASS HEADER
+#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+const Property::Index ScrollConnector::SCROLL_POSITION = 50000000; // TODO - expose CUSTOM_PROPERTY_START from Core
+
+ScrollConnector* ScrollConnector::New()
+{
+ return new ScrollConnector();
+}
+
+void ScrollConnector::SetLimits( float min, float max )
+{
+ mMinLimit = min;
+ mMaxLimit = max;
+
+ mLimitsChangedSignal.Emit( mMinLimit, mMaxLimit );
+}
+
+ScrollConnector::ScrollConnector()
+: mMinLimit( 0.0f ),
+ mMaxLimit( 0.0f )
+{
+ mScrollPositionObject = Constrainable::New();
+
+ mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::SCROLL_POSITION_PROPERTY_NAME, 0.0f );
+}
+
+ScrollConnector::~ScrollConnector()
+{
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#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.
+//
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+/**
+ * @copydoc Toolkit::ScrollConnector
+ */
+class ScrollConnector : public Dali::BaseObject
+{
+public:
+
+ typedef Toolkit::ScrollConnector::LimitsChangedSignalType LimitsChangedSignalType;
+
+ static const Property::Index SCROLL_POSITION;
+
+ /**
+ * Create a ScrollConnector.
+ * @return A newly allocated ScrollConnector.
+ */
+ static ScrollConnector* New();
+
+ /**
+ * @copydoc Toolkit::ScrollConnector::SetLimits()
+ */
+ void SetLimits( float min, float max );
+
+ /**
+ * @copydoc Toolkit::ScrollConnector::GetMinLimit()
+ */
+ float GetMinLimit() const
+ {
+ return mMinLimit;
+ }
+
+ /**
+ * @copydoc Toolkit::ScrollConnector::GetMaxLimit()
+ */
+ float GetMaxLimit() const
+ {
+ return mMaxLimit;
+ }
+
+ /**
+ * Signal emitted after the SetLimits() method has been called.
+ */
+ LimitsChangedSignalType& LimitsChangedSignal()
+ {
+ return mLimitsChangedSignal;
+ }
+
+ /**
+ * Retrieve the object which provides the "scroll-position" property.
+ * @return The scroll-position object.
+ */
+ Constrainable GetScrollPositionObject() const
+ {
+ return mScrollPositionObject;
+ }
+
+private:
+
+ /**
+ * Create a new ScrollConnector.
+ */
+ ScrollConnector();
+
+ /**
+ * Virtual destructor
+ */
+ virtual ~ScrollConnector();
+
+ // Undefined
+ ScrollConnector(const ScrollConnector&);
+
+ // Undefined
+ ScrollConnector& operator=(const ScrollConnector& rhs);
+
+private:
+
+ Constrainable mScrollPositionObject;
+
+ LimitsChangedSignalType mLimitsChangedSignal;
+
+ float mMinLimit;
+ float mMaxLimit;
+};
+
+} // namespace Internal
+
+inline Internal::ScrollConnector& GetImpl(Dali::Toolkit::ScrollConnector& obj)
+{
+ DALI_ASSERT_ALWAYS(obj);
+
+ Dali::BaseObject& handle = obj.GetBaseObject();
+
+ return static_cast<Internal::ScrollConnector&>(handle);
+}
+
+inline const Internal::ScrollConnector& GetImpl(const Dali::Toolkit::ScrollConnector& obj)
+{
+ DALI_ASSERT_ALWAYS(obj);
+
+ const Dali::BaseObject& handle = obj.GetBaseObject();
+
+ return static_cast<const Internal::ScrollConnector&>(handle);
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_CONNECTOR_H__
$(toolkit_src_dir)/controls/scroll-component/scroll-component.cpp \
$(toolkit_src_dir)/controls/scrollable/item-view/item-view-impl.cpp \
$(toolkit_src_dir)/controls/scrollable/scrollable-impl.cpp \
+ $(toolkit_src_dir)/controls/scrollable/scroll-connector-impl.cpp \
$(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-base-impl.cpp \
$(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp \
$(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-impl.cpp \
return Control::DownCast<ItemView, Internal::ItemView>(handle);
}
+ScrollConnector ItemView::GetScrollConnector() const
+{
+ return GetImpl(*this).GetScrollConnector();
+}
+
ItemView::~ItemView()
{
}
--- /dev/null
+//
+// 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.
+//
+
+#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
+#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
+
+using namespace Dali;
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+const char* const ScrollConnector::SCROLL_POSITION_PROPERTY_NAME = "scroll-position";
+const Property::Index SCROLL_POSITION = Internal::ScrollConnector::SCROLL_POSITION;
+
+const char* const ScrollConnector::LIMITS_CHANGED_SIGNAL_NAME = "limits-changed";
+
+ScrollConnector ScrollConnector::New()
+{
+ return ScrollConnector( Internal::ScrollConnector::New() );
+}
+
+ScrollConnector::ScrollConnector()
+{
+}
+
+ScrollConnector::ScrollConnector( const ScrollConnector& handle )
+: BaseHandle( handle )
+{
+}
+
+ScrollConnector::~ScrollConnector()
+{
+}
+
+ScrollConnector ScrollConnector::DownCast( BaseHandle handle )
+{
+ return ScrollConnector( dynamic_cast<Internal::ScrollConnector*>(handle.GetObjectPtr()) );
+}
+
+void ScrollConnector::SetLimits( float min, float max )
+{
+ GetImpl(*this).SetLimits( min, max );
+}
+
+float ScrollConnector::GetMinLimit() const
+{
+ return GetImpl(*this).GetMinLimit();
+}
+
+float ScrollConnector::GetMaxLimit() const
+{
+ return GetImpl(*this).GetMaxLimit();
+}
+
+Constrainable ScrollConnector::GetScrollPositionObject() const
+{
+ return GetImpl(*this).GetScrollPositionObject();
+}
+
+ScrollConnector::LimitsChangedSignalType& ScrollConnector::LimitsChangedSignal()
+{
+ return GetImpl(*this).LimitsChangedSignal();
+}
+
+ScrollConnector::ScrollConnector( Internal::ScrollConnector* impl )
+: BaseHandle( impl )
+{
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
+#define __DALI_TOOLKIT_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.
+//
+
+// INTERNAL INCLUDES
+#include <dali/dali.h>
+
+namespace Dali DALI_IMPORT_API
+{
+
+namespace Toolkit
+{
+
+namespace Internal DALI_INTERNAL
+{
+class ScrollConnector;
+}
+
+/**
+ * ScrollConnector is used to connect scrollable containers with components such as scroll bars, indicators etc.
+ *
+ * This basically consists of:
+ * - A "scroll-position" property which controls which part of the scrollable content is visible
+ * - The minimum/maximum limits of the scroll position, which corresponds to the start & end points of the scollable list etc.
+ *
+ * The provider of the scrollable content is responsible for calling SetLimits(). Scroll-bar components are then expected to
+ * receive these values via the LIMITS_CHANGED signal.
+ *
+ * The scroll-position property is accessible via GetScrollPositionObject(). This is intended to be shared by multiple controls
+ * e.g. a list control may be scrolled by panning the list content, or indirectly by dragging a connected scroll-bar control.
+ */
+class ScrollConnector : public BaseHandle
+{
+public:
+
+ static const char* const SCROLL_POSITION_PROPERTY_NAME; ///< This float "scroll-position" property is available via GetScrollPositionObject()
+ static const Property::Index SCROLL_POSITION; ///< The index of the "scroll-position" property
+
+ // Signals
+ static const char* const LIMITS_CHANGED_SIGNAL_NAME; ///< "limits-changed" signal name
+ typedef SignalV2< void ( float min, float max ) > LimitsChangedSignalType;
+
+ /**
+ * Create a ScrollConnector.
+ * @return A handle to a newly allocated ScrollConnector.
+ */
+ static ScrollConnector New();
+
+ /**
+ * Create an empty handle.
+ */
+ ScrollConnector();
+
+ /**
+ * Copy constructor.
+ * @param handle A handle to copy.
+ */
+ ScrollConnector( const ScrollConnector& handle );
+
+ /**
+ * @copydoc Dali::BaseHandle::operator=
+ */
+ using Dali::BaseHandle::operator=;
+
+ /**
+ * Virtual destructor.
+ */
+ virtual ~ScrollConnector();
+
+ /**
+ * Downcast a BaseHandle to ScrollConnector handle.
+ * @return A handle to a ScrollConnector or an empty handle.
+ */
+ static ScrollConnector DownCast( BaseHandle handle );
+
+ /**
+ * Set The min/max values, corresponding to the start & end position of the scrollable content.
+ * @param[in] min The minimum value.
+ * @param[in] max The maximum value.
+ */
+ void SetLimits( float min, float max );
+
+ /**
+ * Retrieve the min limit.
+ * @return The minimum value.
+ */
+ float GetMinLimit() const;
+
+ /**
+ * Retrieve the max limit.
+ * @return The maximum value.
+ */
+ float GetMaxLimit() const;
+
+ /**
+ * Signal emitted after the SetLimits() method has been called.
+ */
+ ScrollConnector::LimitsChangedSignalType& LimitsChangedSignal();
+
+ /**
+ * Retrieve the object which provides the "scroll-position" property.
+ * @return The scroll-position object.
+ */
+ Constrainable GetScrollPositionObject() const;
+
+public: // Not intended for application developers
+
+ /**
+ * Creates a handle using the Toolkit::Internal implementation.
+ * @param[in] impl The Control implementation.
+ */
+ ScrollConnector( Internal::ScrollConnector* impl );
+};
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
$(public_api_src_dir)/controls/scrollable/item-view/spiral-layout.cpp \
$(public_api_src_dir)/controls/scrollable/item-view/album-layout.cpp \
$(public_api_src_dir)/controls/scrollable/scrollable.cpp \
+ $(public_api_src_dir)/controls/scrollable/scroll-connector.cpp \
$(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view.cpp \
$(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-constraints.cpp \
$(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-effect.cpp \
public_api_scroll_component_header_files =
-public_api_scrollable_header_files =
+public_api_scrollable_header_files = \
+ $(public_api_src_dir)/controls/scrollable/scroll-connector.h
public_api_scroll_view_header_files = \
$(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-constraints.h \