1 #ifndef DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H
2 #define DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H
5 * Copyright (c) 2020 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-view/scroll-view-effect.h>
25 #include <dali-toolkit/public-api/dali-toolkit-common.h>
34 namespace Internal DALI_INTERNAL
36 class ScrollViewPagePathEffect;
39 * @addtogroup dali_toolkit_controls_scroll_view
44 * @brief ScrollView Page Path Effect.
46 * This effect causes Actors to follow a given path. The opacity of the actor will be 0.0 at
47 * the beginning of the path and will go to 1.0 as it is approximating to half of the path to return
48 * to 0.0 at the end of the path.
55 * You should ensure ScrollView's default constraints have been removed,
56 * by calling ScrollView::RemoveConstraintsFromChildren() before applying
57 * this effect to ScrollView.
60 * ApplyToPage(...) method should be called on every page.
62 * Automatic operation:
66 class DALI_TOOLKIT_API ScrollViewPagePathEffect : public ScrollViewEffect
70 * @brief Creates an initialized ScrollViewPagePathEffect.
72 * @param[in] path The path that will be used by the scroll effect
73 * @param[in] forward Vector in page object space which will be aligned with the tangent of the path
74 * @param[in] inputPropertyIndex Index of a property of the scroll-view which will be used as the input for the path
75 * @param[in] viewPageSize Size of a page in the scrollview
76 * @param[in] pageCount Total number of pages in the scrollview
77 * @return A handle to a newly allocated Dali resource
79 static ScrollViewPagePathEffect New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount);
82 * @brief Creates an uninitialized ScrollViewPagePathEffect; this can be initialized with ScrollViewPagePathEffect::New().
83 * Calling member functions with an uninitialized Toolkit::ScrollViewPagePathEffect is not allowed.
86 ScrollViewPagePathEffect();
89 * @brief Downcasts a handle to ScrollViewPagePathEffect handle.
91 * If handle points to a ScrollViewPagePathEffect, the downcast produces valid handle.
92 * If not, the returned handle is left uninitialized.
94 * @param[in] handle Handle to an object
95 * @return Handle to a ScrollViewPagePathEffect or an uninitialized handle
97 static ScrollViewPagePathEffect DownCast(BaseHandle handle);
100 * @brief Manually apply effect to a page in the scroll-view.
102 * @param[in] page The page to be affected by this effect
103 * @param[in] pageOrder The order of the page in the scroll view
105 void ApplyToPage(Actor page, unsigned int pageOrder);
110 * @brief This constructor is used by Dali New() methods.
112 * @param[in] impl A pointer to a newly allocated Dali resource
114 explicit DALI_INTERNAL ScrollViewPagePathEffect(Internal::ScrollViewPagePathEffect* impl);
121 } // namespace Toolkit
125 #endif // DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H