1 #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_COMPONENTS_H__
2 #define __DALI_TOOLKIT_INTERNAL_SCROLL_COMPONENTS_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/control-impl.h>
22 #include <dali-toolkit/public-api/controls/scroll-component/scroll-component.h>
23 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
34 class ScrollComponent;
36 typedef IntrusivePtr<ScrollComponent> ScrollComponentPtr;
40 * Base class for derived ScrollComponents
41 * ScrollComponents such as ScrollBar are derived from this class.
42 * To instantiate these ScrollBars and other derived components.
44 class ScrollComponent : public ControlImpl
49 * Create an initialized ScrollComponent
50 * @param[in] scrollable reference to ScrollView implementation
51 * @param[in] type the type of scroll component to create.
52 * @return A pointer to the created ScrollComponent.
54 static Toolkit::ScrollComponent New(Toolkit::Scrollable& scrollable, Toolkit::Scrollable::ScrollComponentType type);
57 * Called when the scroll component is disconnected from a Scrollable container.
59 virtual void OnDisconnect()
66 * Construct a new ScrollComponent.
71 * A reference counted object may only be deleted by calling Unreference()
73 virtual ~ScrollComponent();
78 ScrollComponent(const ScrollComponent&);
81 ScrollComponent& operator=(const ScrollComponent& rhs);
85 } // namespace Internal
87 // Helpers for public-api forwarding methods
89 inline Toolkit::Internal::ScrollComponent& GetImpl(Toolkit::ScrollComponent& scrollComponent)
91 DALI_ASSERT_ALWAYS(scrollComponent);
93 Dali::RefObject& handle = scrollComponent.GetImplementation();
95 return static_cast<Toolkit::Internal::ScrollComponent&>(handle);
98 inline const Toolkit::Internal::ScrollComponent& GetImpl(const Toolkit::ScrollComponent& scrollComponent)
100 DALI_ASSERT_ALWAYS(scrollComponent);
102 const Dali::RefObject& handle = scrollComponent.GetImplementation();
104 return static_cast<const Toolkit::Internal::ScrollComponent&>(handle);
107 } // namespace Toolkit
111 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_COMPONENTS_H__