Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[platform/core/uifw/dali-core.git] / dali / public-api / events / pan-gesture-detector.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/events/pan-gesture-detector.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/events/pan-gesture-detector-impl.h>
23
24 namespace Dali
25 {
26
27 const Radian PanGestureDetector::DIRECTION_LEFT( -Math::PI );
28 const Radian PanGestureDetector::DIRECTION_RIGHT( 0.0f );
29 const Radian PanGestureDetector::DIRECTION_UP( -0.5f * Math::PI );
30 const Radian PanGestureDetector::DIRECTION_DOWN( 0.5f * Math::PI );
31 const Radian PanGestureDetector::DIRECTION_HORIZONTAL( Math::PI );
32 const Radian PanGestureDetector::DIRECTION_VERTICAL( -0.5f * Math::PI );
33 const Radian PanGestureDetector::DEFAULT_THRESHOLD( 0.25f * Math::PI );
34
35 PanGestureDetector::PanGestureDetector(Internal::PanGestureDetector* internal)
36 : GestureDetector(internal)
37 {
38 }
39
40 PanGestureDetector::PanGestureDetector()
41 {
42 }
43
44 PanGestureDetector PanGestureDetector::New()
45 {
46   Internal::PanGestureDetectorPtr internal = Internal::PanGestureDetector::New();
47
48   return PanGestureDetector(internal.Get());
49 }
50
51 PanGestureDetector PanGestureDetector::DownCast( BaseHandle handle )
52 {
53   return PanGestureDetector( dynamic_cast<Dali::Internal::PanGestureDetector*>(handle.GetObjectPtr()) );
54 }
55
56 PanGestureDetector::~PanGestureDetector()
57 {
58 }
59
60 PanGestureDetector::PanGestureDetector(const PanGestureDetector& handle)
61 : GestureDetector(handle)
62 {
63 }
64
65 PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
66 {
67   BaseHandle::operator=(rhs);
68   return *this;
69 }
70
71 void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
72 {
73   GetImplementation(*this).SetMinimumTouchesRequired(minimum);
74 }
75
76 void PanGestureDetector::SetMaximumTouchesRequired(uint32_t maximum)
77 {
78   GetImplementation(*this).SetMaximumTouchesRequired(maximum);
79 }
80
81 uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
82 {
83   return GetImplementation(*this).GetMinimumTouchesRequired();
84 }
85
86 uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
87 {
88   return GetImplementation(*this).GetMaximumTouchesRequired();
89 }
90
91 void PanGestureDetector::AddAngle( Radian angle, Radian threshold )
92 {
93   GetImplementation(*this).AddAngle( angle, threshold );
94 }
95
96 void PanGestureDetector::AddDirection( Radian direction, Radian threshold )
97 {
98   GetImplementation(*this).AddDirection( direction, threshold );
99 }
100
101 size_t PanGestureDetector::GetAngleCount() const
102 {
103   return GetImplementation(*this).GetAngleCount();
104 }
105
106 PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(size_t index) const
107 {
108   return GetImplementation(*this).GetAngle(index);
109 }
110
111 void PanGestureDetector::ClearAngles()
112 {
113   GetImplementation(*this).ClearAngles();
114 }
115
116 void PanGestureDetector::RemoveAngle( Radian angle )
117 {
118   GetImplementation(*this).RemoveAngle( angle );
119 }
120
121 void PanGestureDetector::RemoveDirection( Radian direction )
122 {
123   GetImplementation(*this).RemoveDirection( direction );
124 }
125
126 PanGestureDetector::DetectedSignalType& PanGestureDetector::DetectedSignal()
127 {
128   return GetImplementation(*this).DetectedSignal();
129 }
130
131 void PanGestureDetector::SetPanGestureProperties( const PanGesture& pan )
132 {
133   Internal::PanGestureDetector::SetPanGestureProperties( pan );
134 }
135
136 } // namespace Dali