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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
24 #include <dali-toolkit/public-api/controls/control-impl.h>
25 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
26 #include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
34 class ScrollComponentImpl;
35 typedef IntrusivePtr<ScrollComponentImpl> ScrollComponentPtr;
38 * Base class for scroll component implementations.
39 * Scroll-components such as scroll bars, indicators etc. are connected to scrollable containers via ScrollConnector.
41 class ScrollComponentImpl : public Internal::Control
46 * @brief Sets the scroll connector.
48 * @param[in] connector The scroll-connector used to connect with a scrollable container.
50 void SetScrollConnector( Toolkit::ScrollConnector connector );
53 * @brief Retrieve the scroll connector.
55 * @return The scroll-connector used to connect with a scrollable container.
57 Toolkit::ScrollConnector GetScrollConnector() const;
60 * Called when the scroll component is disconnected from a scrollable container.
62 virtual void OnDisconnect() {}
67 * Construct a new ScrollComponentImpl.
69 ScrollComponentImpl();
72 * A reference counted object may only be deleted by calling Unreference()
74 virtual ~ScrollComponentImpl();
77 * @brief Called when a scroll component is connected to a scrollable UI control.
79 * @param[in] oldConnector The previous connector, or an empty handle.
81 virtual void OnScrollConnectorSet( Toolkit::ScrollConnector oldConnector );
86 ScrollComponentImpl(const ScrollComponentImpl&);
89 ScrollComponentImpl& operator=(const ScrollComponentImpl& rhs);
93 Toolkit::ScrollConnector mScrollConnector;
96 // Helpers for public-api forwarding methods
98 inline Toolkit::ScrollComponentImpl& GetImpl(Toolkit::ScrollComponent& scrollComponent)
100 DALI_ASSERT_ALWAYS(scrollComponent);
102 Dali::RefObject& handle = scrollComponent.GetImplementation();
104 return static_cast<Toolkit::ScrollComponentImpl&>(handle);
107 inline const Toolkit::ScrollComponentImpl& GetImpl(const Toolkit::ScrollComponent& scrollComponent)
109 DALI_ASSERT_ALWAYS(scrollComponent);
111 const Dali::RefObject& handle = scrollComponent.GetImplementation();
113 return static_cast<const Toolkit::ScrollComponentImpl&>(handle);
116 } // namespace Toolkit
120 #endif // __DALI_TOOLKIT_SCROLL_COMPONENT_IMPL_H__