Clean up the code to build successfully on macOS
[platform/core/uifw/dali-core.git] / dali / public-api / events / pan-gesture-detector.cpp
1 /*
2  * Copyright (c) 2020 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/pan-gesture-detector-impl.h>
23
24 namespace Dali
25 {
26 const Radian PanGestureDetector::DIRECTION_LEFT(-Math::PI);
27 const Radian PanGestureDetector::DIRECTION_RIGHT(0.0f);
28 const Radian PanGestureDetector::DIRECTION_UP(-0.5f * Math::PI);
29 const Radian PanGestureDetector::DIRECTION_DOWN(0.5f * Math::PI);
30 const Radian PanGestureDetector::DIRECTION_HORIZONTAL(Math::PI);
31 const Radian PanGestureDetector::DIRECTION_VERTICAL(-0.5f * Math::PI);
32 const Radian PanGestureDetector::DEFAULT_THRESHOLD(0.25f * Math::PI);
33
34 PanGestureDetector::PanGestureDetector(Internal::PanGestureDetector* internal)
35 : GestureDetector(internal)
36 {
37 }
38
39 PanGestureDetector::PanGestureDetector()
40 {
41 }
42
43 PanGestureDetector PanGestureDetector::New()
44 {
45   Internal::PanGestureDetectorPtr internal = Internal::PanGestureDetector::New();
46
47   return PanGestureDetector(internal.Get());
48 }
49
50 PanGestureDetector PanGestureDetector::DownCast(BaseHandle handle)
51 {
52   return PanGestureDetector(dynamic_cast<Dali::Internal::PanGestureDetector*>(handle.GetObjectPtr()));
53 }
54
55 PanGestureDetector::~PanGestureDetector()
56 {
57 }
58
59 PanGestureDetector::PanGestureDetector(const PanGestureDetector& handle)
60 : GestureDetector(handle)
61 {
62 }
63
64 PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
65 {
66   BaseHandle::operator=(rhs);
67   return *this;
68 }
69
70 void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
71 {
72   GetImplementation(*this).SetMinimumTouchesRequired(minimum);
73 }
74
75 void PanGestureDetector::SetMaximumTouchesRequired(uint32_t maximum)
76 {
77   GetImplementation(*this).SetMaximumTouchesRequired(maximum);
78 }
79
80 uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
81 {
82   return GetImplementation(*this).GetMinimumTouchesRequired();
83 }
84
85 uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
86 {
87   return GetImplementation(*this).GetMaximumTouchesRequired();
88 }
89
90 void PanGestureDetector::AddAngle(Radian angle, Radian threshold)
91 {
92   GetImplementation(*this).AddAngle(angle, threshold);
93 }
94
95 void PanGestureDetector::AddDirection(Radian direction, Radian threshold)
96 {
97   GetImplementation(*this).AddDirection(direction, threshold);
98 }
99
100 size_t PanGestureDetector::GetAngleCount() const
101 {
102   return GetImplementation(*this).GetAngleCount();
103 }
104
105 PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(size_t index) const
106 {
107   return GetImplementation(*this).GetAngle(static_cast<uint32_t>(index));
108 }
109
110 void PanGestureDetector::ClearAngles()
111 {
112   GetImplementation(*this).ClearAngles();
113 }
114
115 void PanGestureDetector::RemoveAngle(Radian angle)
116 {
117   GetImplementation(*this).RemoveAngle(angle);
118 }
119
120 void PanGestureDetector::RemoveDirection(Radian direction)
121 {
122   GetImplementation(*this).RemoveDirection(direction);
123 }
124
125 PanGestureDetector::DetectedSignalType& PanGestureDetector::DetectedSignal()
126 {
127   return GetImplementation(*this).DetectedSignal();
128 }
129
130 void PanGestureDetector::SetPanGestureProperties(const Dali::PanGesture& pan)
131 {
132   Internal::PanGestureDetector::SetPanGestureProperties(pan);
133 }
134
135 } // namespace Dali