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 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/dali.h>
32 /// Some helper methods with common functionality used in scroll view constraints
33 namespace ScrollViewHelperFunctions
37 * Checks whether the we're looking straight at the page and if we are, it returns true.
39 * @param[in] position The position of the page.
41 bool IsStraightOnView( const Vector3& position );
44 * Modifies the position to wrap within the given domain.
46 * @param[in/out] position The position of the page, this is modified accordingly.
47 * @param[in] pageSize The size of each page.
48 * @param[in] min The minimum position of the scroll-view.
49 * @param[in] max The maximum position of the scroll-view.
51 void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max );
54 * Checks whether the page is positioned outside of our view and returns true if it is.
56 * @param[in] position The position of the page.
57 * @param[in] pageSize The size of each page.
59 bool IsOutsideView( const Vector3& position, const Vector3& pageSize );
61 } // namespace ScrollViewHelperFunctions
63 } // namespace Internal
65 } // namespace Toolkit
69 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__