1 #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__
2 #define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__
5 * Copyright (c) 2014 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/math/vector3.h>
33 /// Some helper methods with common functionality used in scroll view constraints
34 namespace ScrollViewHelperFunctions
38 * Checks whether the we're looking straight at the page and if we are, it returns true.
40 * @param[in] position The position of the page.
42 bool IsStraightOnView( const Vector3& position );
45 * Modifies the position to wrap within the given domain.
47 * @param[in/out] position The position of the page, this is modified accordingly.
48 * @param[in] pageSize The size of each page.
49 * @param[in] min The minimum position of the scroll-view.
50 * @param[in] max The maximum position of the scroll-view.
52 void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max );
55 * Checks whether the page is positioned outside of our view and returns true if it is.
57 * @param[in] position The position of the page.
58 * @param[in] pageSize The size of each page.
60 bool IsOutsideView( const Vector3& position, const Vector3& pageSize );
62 } // namespace ScrollViewHelperFunctions
64 } // namespace Internal
66 } // namespace Toolkit
70 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__