1 #ifndef __DALI_TOOLKIT_SCROLLABLE_H__
2 #define __DALI_TOOLKIT_SCROLLABLE_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 * @addtogroup CAPI_DALI_FRAMEWORK
26 #include <dali-toolkit/public-api/controls/control.h>
28 namespace Dali DALI_IMPORT_API
34 namespace Internal DALI_INTERNAL
60 * Base class for derived Scrollables that contains actors that can be scrolled manually
61 * (via touch) or automatically. Scrollables such as ScrollView and ItemView can be derived
64 class Scrollable : public Control
69 * Clamp signal event's data
73 ClampState3 scale; ///< Clamp information for scale axes
74 ClampState3 position; ///< Clamp information for position axes
75 ClampState rotation; ///< Clamp information for rotation
79 * Scroll component types
81 enum ScrollComponentType
90 static const std::string SCROLL_RELATIVE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-relative-position", type VECTOR3
91 static const std::string SCROLL_POSITION_MIN_PROPERTY_NAME; ///< Property, name "scroll-position-min", type VECTOR3
92 static const std::string SCROLL_POSITION_MAX_PROPERTY_NAME; ///< Property, name "scroll-position-max", type VECTOR3
93 static const std::string SCROLL_DIRECTION_PROPERTY_NAME; ///< Property, name "scroll-direction", type VECTOR2
96 static const char* const SIGNAL_SCROLL_STARTED;
97 static const char* const SIGNAL_SCROLL_COMPLETED;
98 static const char* const SIGNAL_SCROLL_UPDATED;
99 static const char* const SIGNAL_SCROLL_CLAMPED;
103 typedef SignalV2< void ( const Vector3& ) > ScrollStartedSignalV2;
105 typedef SignalV2< void ( const Vector3& ) > ScrollUpdatedSignalV2;
107 typedef SignalV2< void ( const Vector3& ) > ScrollCompletedSignalV2;
109 typedef SignalV2< void ( const ClampEvent& ) > ScrollClampedSignalV2;
112 * Signal emitted when the Scrollable has moved (whether by touch or animation)
114 ScrollStartedSignalV2& ScrollStartedSignal();
117 * Signal emitted when the Scrollable has moved (whether by touch or animation)
119 ScrollUpdatedSignalV2& ScrollUpdatedSignal();
122 * Signal emitted when the Scrollable has completed movement (whether by touch or animation)
124 ScrollCompletedSignalV2& ScrollCompletedSignal();
127 * Signal emitted when the Scrollable is pushing against a domain boundary
128 * (in either position, scale, or rotation)
130 ScrollClampedSignalV2& ScrollClampedSignal();
135 * Creates an uninitialized Scrollable handle
140 * Copy constructor. Creates another handle that points to the same real object
141 * @param handle to copy from
143 Scrollable( const Scrollable& handle );
146 * Assignment operator. Changes this handle to point to another real object
148 Scrollable& operator=( const Scrollable& handle );
151 * Virtual destructor.
152 * Dali::Object derived classes typically do not contain member data.
154 virtual ~Scrollable();
157 * Downcast an Object handle to Scrollable. If handle points to a Scrollable the
158 * downcast produces valid handle. If not the returned handle is left uninitialized.
159 * @param[in] handle Handle to an object
160 * @return handle to a Scrollable or an uninitialized handle
162 static Scrollable DownCast( BaseHandle handle );
165 * Checks if a ScrollComponent has been enabled or not.
166 * @param[in] type The Scroll Component Type to check
167 * @return True (if Enabled)
169 bool IsScrollComponentEnabled(Scrollable::ScrollComponentType type) const;
172 * Enables a ScrollComponent
173 * @param[in] type The Scroll Component Type to enable
175 void EnableScrollComponent(Scrollable::ScrollComponentType type);
178 * Disables a ScrollComponent
179 * @param[in] type The Scroll Component Type to disable
181 void DisableScrollComponent(Scrollable::ScrollComponentType type);
183 public: // Not intended for application developers
186 * Creates a handle using the Toolkit::Internal implementation.
187 * @param[in] implementation The Control implementation.
189 Scrollable(Internal::Scrollable& implementation);
192 * Allows the creation of this Control from an Internal::CustomActor pointer.
193 * @param[in] internal A pointer to the internal CustomActor.
195 Scrollable( Dali::Internal::CustomActor* internal );
198 } // namespace Toolkit
205 #endif // __DALI_TOOLKIT_SCROLLABLE_H__