1 #ifndef DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_H
2 #define DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_H
5 * Copyright (c) 2019 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/public-api/animation/linear-constrainer.h>
23 #include <dali/devel-api/animation/path-constrainer.h>
26 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
27 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h>
39 * @copydoc Toolkit::ScrollViewPagePathEffect
41 class ScrollViewPagePathEffect : public ScrollViewEffect
48 * @param[in] path Pages will follow this path
49 * @param[in] forward Vector in page local space which will be aligned with tangent of the path
50 * @param[in] inputPropertyIndex index of the property in the scrollview used to drivce the path
51 * @param[in] viewPageSize size of a page in the scrollview
52 * @param[in] pageCount total number of pages in the scrollview
54 ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount );
59 * @copydoc ScrollViewEffect::ApplyToActor
61 void ApplyToPage( Actor child, unsigned int pageOrder );
66 * @copydoc ScrollViewEffect::OnAttach
68 void OnAttach( Toolkit::ScrollView& scrollView ) override;
71 * @copydoc ScrollViewEffect::OnDetach
73 void OnDetach( Toolkit::ScrollView& scrollView ) override;
78 * A reference counted object may only be deleted by calling Unreference()
80 virtual ~ScrollViewPagePathEffect();
84 Vector3 mPageSize; ///< The logical page size for the 3D effect.
85 PathConstrainer mPathConstrainer; ///< PathConstrainer used to constraint position and orientation
86 LinearConstrainer mLinearConstrainer; ///< LinearConstrainer used to constraint opacity
87 Dali::Property::Index mInputPropertyIndex; ///< Index of the property in the scrollview used as the parameter for the path
88 unsigned int mPageCount; ///< Total number of pages (Needed for wrapping)
91 } // namespace Internal
93 // Helpers for public-api forwarding methods
95 inline Internal::ScrollViewPagePathEffect& GetImpl(Dali::Toolkit::ScrollViewPagePathEffect& obj)
97 DALI_ASSERT_ALWAYS(obj);
99 Dali::RefObject& handle = obj.GetBaseObject();
101 return static_cast<Internal::ScrollViewPagePathEffect&>(handle);
104 inline const Internal::ScrollViewPagePathEffect& GetImpl(const Dali::Toolkit::ScrollViewPagePathEffect& obj)
106 DALI_ASSERT_ALWAYS(obj);
108 const Dali::RefObject& handle = obj.GetBaseObject();
110 return static_cast<const Internal::ScrollViewPagePathEffect&>(handle);
113 } // namespace Toolkit
117 #endif // DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_H