1 #ifndef __DALI_TOOLKIT_SCROLL_COMPONENT_IMPL_H__
2 #define __DALI_TOOLKIT_SCROLL_COMPONENT_IMPL_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-toolkit/public-api/controls/scrollable/scroll-component.h>
23 #include <dali-toolkit/public-api/controls/control-impl.h>
24 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
25 #include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
33 class ScrollComponentImpl;
34 typedef IntrusivePtr<ScrollComponentImpl> ScrollComponentPtr;
37 * Base class for scroll component implementations.
38 * Scroll-components such as scroll bars, indicators etc. are connected to scrollable containers via ScrollConnector.
40 class ScrollComponentImpl : public ControlImpl
45 * @brief Sets the scroll connector.
47 * @param[in] connector The scroll-connector used to connect with a scrollable container.
49 void SetScrollConnector( Toolkit::ScrollConnector connector );
52 * @brief Retrieve the scroll connector.
54 * @return The scroll-connector used to connect with a scrollable container.
56 Toolkit::ScrollConnector GetScrollConnector() const;
59 * Called when the scroll component is disconnected from a scrollable container.
61 virtual void OnDisconnect() {}
66 * Construct a new ScrollComponentImpl.
68 ScrollComponentImpl();
71 * A reference counted object may only be deleted by calling Unreference()
73 virtual ~ScrollComponentImpl();
76 * @brief Called when a scroll component is connected to a scrollable UI control.
78 * @param[in] oldConnector The previous connector, or an empty handle.
80 virtual void OnScrollConnectorSet( Toolkit::ScrollConnector oldConnector );
85 ScrollComponentImpl(const ScrollComponentImpl&);
88 ScrollComponentImpl& operator=(const ScrollComponentImpl& rhs);
92 Toolkit::ScrollConnector mScrollConnector;
95 // Helpers for public-api forwarding methods
97 inline Toolkit::ScrollComponentImpl& GetImpl(Toolkit::ScrollComponent& scrollComponent)
99 DALI_ASSERT_ALWAYS(scrollComponent);
101 Dali::RefObject& handle = scrollComponent.GetImplementation();
103 return static_cast<Toolkit::ScrollComponentImpl&>(handle);
106 inline const Toolkit::ScrollComponentImpl& GetImpl(const Toolkit::ScrollComponent& scrollComponent)
108 DALI_ASSERT_ALWAYS(scrollComponent);
110 const Dali::RefObject& handle = scrollComponent.GetImplementation();
112 return static_cast<const Toolkit::ScrollComponentImpl&>(handle);
115 } // namespace Toolkit
119 #endif // __DALI_TOOLKIT_SCROLL_COMPONENT_IMPL_H__