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/internal/controls/scroll-component/scroll-component.h>
23 #include <dali-toolkit/public-api/controls/control-impl.h>
24 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
35 class ScrollComponent;
37 typedef IntrusivePtr<ScrollComponent> ScrollComponentPtr;
41 * Base class for derived ScrollComponents
42 * ScrollComponents such as ScrollBar are derived from this class.
43 * To instantiate these ScrollBars and other derived components.
45 class ScrollComponent : public ControlImpl
50 * Create an initialized ScrollComponent
51 * @param[in] scrollable reference to ScrollView implementation
52 * @param[in] type the type of scroll component to create.
53 * @return A pointer to the created ScrollComponent.
55 static Toolkit::ScrollComponent New(Toolkit::Scrollable& scrollable, Toolkit::Scrollable::ScrollComponentType type);
58 * Called when the scroll component is disconnected from a Scrollable container.
60 virtual void OnDisconnect()
67 * Construct a new ScrollComponent.
72 * A reference counted object may only be deleted by calling Unreference()
74 virtual ~ScrollComponent();
79 ScrollComponent(const ScrollComponent&);
82 ScrollComponent& operator=(const ScrollComponent& rhs);
86 } // namespace Internal
88 // Helpers for public-api forwarding methods
90 inline Toolkit::Internal::ScrollComponent& GetImpl(Toolkit::ScrollComponent& scrollComponent)
92 DALI_ASSERT_ALWAYS(scrollComponent);
94 Dali::RefObject& handle = scrollComponent.GetImplementation();
96 return static_cast<Toolkit::Internal::ScrollComponent&>(handle);
99 inline const Toolkit::Internal::ScrollComponent& GetImpl(const Toolkit::ScrollComponent& scrollComponent)
101 DALI_ASSERT_ALWAYS(scrollComponent);
103 const Dali::RefObject& handle = scrollComponent.GetImplementation();
105 return static_cast<const Toolkit::Internal::ScrollComponent&>(handle);
108 } // namespace Toolkit
112 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_COMPONENTS_H__