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) 2021 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/devel-api/animation/path-constrainer.h>
23 #include <dali/public-api/animation/linear-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>
36 * @copydoc Toolkit::ScrollViewPagePathEffect
38 class ScrollViewPagePathEffect : public ScrollViewEffect
43 * @param[in] path Pages will follow this path
44 * @param[in] forward Vector in page local space which will be aligned with tangent of the path
45 * @param[in] inputPropertyIndex index of the property in the scrollview used to drivce the path
46 * @param[in] viewPageSize size of a page in the scrollview
47 * @param[in] pageCount total number of pages in the scrollview
49 ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount);
53 * @copydoc ScrollViewEffect::ApplyToActor
55 void ApplyToPage(Actor child, unsigned int pageOrder);
59 * @copydoc ScrollViewEffect::OnAttach
61 void OnAttach(Toolkit::ScrollView& scrollView) override;
64 * @copydoc ScrollViewEffect::OnDetach
66 void OnDetach(Toolkit::ScrollView& scrollView) override;
70 * A reference counted object may only be deleted by calling Unreference()
72 virtual ~ScrollViewPagePathEffect();
75 Vector3 mPageSize; ///< The logical page size for the 3D effect.
76 PathConstrainer mPathConstrainer; ///< PathConstrainer used to constraint position and orientation
77 LinearConstrainer mLinearConstrainer; ///< LinearConstrainer used to constraint opacity
78 Dali::Property::Index mInputPropertyIndex; ///< Index of the property in the scrollview used as the parameter for the path
79 unsigned int mPageCount; ///< Total number of pages (Needed for wrapping)
82 } // namespace Internal
84 // Helpers for public-api forwarding methods
86 inline Internal::ScrollViewPagePathEffect& GetImpl(Dali::Toolkit::ScrollViewPagePathEffect& obj)
88 DALI_ASSERT_ALWAYS(obj);
90 Dali::RefObject& handle = obj.GetBaseObject();
92 return static_cast<Internal::ScrollViewPagePathEffect&>(handle);
95 inline const Internal::ScrollViewPagePathEffect& GetImpl(const Dali::Toolkit::ScrollViewPagePathEffect& obj)
97 DALI_ASSERT_ALWAYS(obj);
99 const Dali::RefObject& handle = obj.GetBaseObject();
101 return static_cast<const Internal::ScrollViewPagePathEffect&>(handle);
104 } // namespace Toolkit
108 #endif // DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_H