Partial fix for homescreen panning issue
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-helper-functions.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__
2 #define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
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
10 //
11 //     http://floralicense.org/license/
12 //
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.
18 //
19
20 // INTERNAL INCLUDES
21 #include <dali/dali.h>
22
23 namespace Dali
24 {
25
26 namespace Toolkit
27 {
28
29 namespace Internal
30 {
31
32 /// Some helper methods with common functionality used in scroll view constraints
33 namespace ScrollViewHelperFunctions
34 {
35
36 /**
37  * Checks whether the we're looking straight at the page and if we are, it returns true.
38  *
39  * @param[in]  position  The position of the page.
40  */
41 bool IsStraightOnView( const Vector3& position );
42
43 /**
44  * Modifies the position to wrap within the given domain.
45  *
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.
50  */
51 void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max );
52
53 /**
54  * Checks whether the page is positioned outside of our view and returns true if it is.
55  *
56  * @param[in]  position  The position of the page.
57  * @param[in]  pageSize  The size of each page.
58  */
59 bool IsOutsideView( const Vector3& position, const Vector3& pageSize );
60
61 } // namespace ScrollViewHelperFunctions
62
63 } // namespace Internal
64
65 } // namespace Toolkit
66
67 } // namespace Dali
68
69 #endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__