1 #ifndef __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
2 #define __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://floralicense.org/license/
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
21 #include <dali/dali.h>
23 namespace Dali DALI_IMPORT_API
29 namespace Internal DALI_INTERNAL
31 class ScrollConnector;
35 * ScrollConnector is used to connect scrollable containers with components such as scroll bars, indicators etc.
37 * This basically consists of:
38 * - A "scroll-position" property which controls which part of the scrollable content is visible
39 * - The minimum/maximum limits of the scroll position, which corresponds to the start & end points of the scollable list etc.
41 * The provider of the scrollable content is responsible for calling SetLimits(). Scroll-bar components are then expected to
42 * receive these values via the LIMITS_CHANGED signal.
44 * The scroll-position property is accessible via GetScrollPositionObject(). This is intended to be shared by multiple controls
45 * e.g. a list control may be scrolled by panning the list content, or indirectly by dragging a connected scroll-bar control.
47 class ScrollConnector : public BaseHandle
51 static const char* const SCROLL_POSITION_PROPERTY_NAME; ///< This float "scroll-position" property is available via GetScrollPositionObject()
52 static const Property::Index SCROLL_POSITION; ///< The index of the "scroll-position" property
55 static const char* const LIMITS_CHANGED_SIGNAL_NAME; ///< "limits-changed" signal name
56 typedef SignalV2< void ( float min, float max ) > LimitsChangedSignalType;
59 * Create a ScrollConnector.
60 * @return A handle to a newly allocated ScrollConnector.
62 static ScrollConnector New();
65 * Create an empty handle.
71 * @param handle A handle to copy.
73 ScrollConnector( const ScrollConnector& handle );
76 * @copydoc Dali::BaseHandle::operator=
78 using Dali::BaseHandle::operator=;
83 virtual ~ScrollConnector();
86 * Downcast a BaseHandle to ScrollConnector handle.
87 * @return A handle to a ScrollConnector or an empty handle.
89 static ScrollConnector DownCast( BaseHandle handle );
92 * Set The min/max values, corresponding to the start & end position of the scrollable content.
93 * @param[in] min The minimum value.
94 * @param[in] max The maximum value.
96 void SetLimits( float min, float max );
99 * Retrieve the min limit.
100 * @return The minimum value.
102 float GetMinLimit() const;
105 * Retrieve the max limit.
106 * @return The maximum value.
108 float GetMaxLimit() const;
111 * Signal emitted after the SetLimits() method has been called.
113 ScrollConnector::LimitsChangedSignalType& LimitsChangedSignal();
116 * Retrieve the object which provides the "scroll-position" property.
117 * @return The scroll-position object.
119 Constrainable GetScrollPositionObject() const;
121 public: // Not intended for application developers
124 * Creates a handle using the Toolkit::Internal implementation.
125 * @param[in] impl The Control implementation.
127 ScrollConnector( Internal::ScrollConnector* impl );
130 } // namespace Toolkit
134 #endif // __DALI_TOOLKIT_SCROLL_CONNECTOR_H__