License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-core.git] / dali / public-api / events / pan-gesture-detector.cpp
1 /*
2  * Copyright (c) 2014 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 char* const PanGestureDetector::SIGNAL_PAN_DETECTED = "pan-detected";
28
29 const Radian PanGestureDetector::DIRECTION_LEFT( -Math::PI );
30 const Radian PanGestureDetector::DIRECTION_RIGHT( 0.0f );
31 const Radian PanGestureDetector::DIRECTION_UP( -0.5f * Math::PI );
32 const Radian PanGestureDetector::DIRECTION_DOWN( 0.5f * Math::PI );
33 const Radian PanGestureDetector::DIRECTION_HORIZONTAL( Math::PI );
34 const Radian PanGestureDetector::DIRECTION_VERTICAL( -0.5f * Math::PI );
35 const Radian PanGestureDetector::DEFAULT_THRESHOLD( 0.25f * Math::PI );
36
37 PanGestureDetector::PanGestureDetector(Internal::PanGestureDetector* internal)
38 : GestureDetector(internal)
39 {
40 }
41
42 PanGestureDetector::PanGestureDetector()
43 {
44 }
45
46 PanGestureDetector PanGestureDetector::New()
47 {
48   Internal::PanGestureDetectorPtr internal = Internal::PanGestureDetector::New();
49
50   return PanGestureDetector(internal.Get());
51 }
52
53 PanGestureDetector PanGestureDetector::DownCast( BaseHandle handle )
54 {
55   return PanGestureDetector( dynamic_cast<Dali::Internal::PanGestureDetector*>(handle.GetObjectPtr()) );
56 }
57
58 PanGestureDetector::~PanGestureDetector()
59 {
60 }
61
62 void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
63 {
64   GetImplementation(*this).SetMinimumTouchesRequired(minimum);
65 }
66
67 void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
68 {
69   GetImplementation(*this).SetMaximumTouchesRequired(maximum);
70 }
71
72 unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
73 {
74   return GetImplementation(*this).GetMinimumTouchesRequired();
75 }
76
77 unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
78 {
79   return GetImplementation(*this).GetMaximumTouchesRequired();
80 }
81
82 void PanGestureDetector::AddAngle( Radian angle, Radian threshold )
83 {
84   GetImplementation(*this).AddAngle( angle, threshold );
85 }
86
87 void PanGestureDetector::AddDirection( Radian direction, Radian threshold )
88 {
89   GetImplementation(*this).AddDirection( direction, threshold );
90 }
91
92 const PanGestureDetector::AngleContainer& PanGestureDetector::GetAngles() const
93 {
94   return GetImplementation(*this).GetAngles();
95 }
96
97 void PanGestureDetector::ClearAngles()
98 {
99   GetImplementation(*this).ClearAngles();
100 }
101
102 void PanGestureDetector::RemoveAngle( Radian angle )
103 {
104   GetImplementation(*this).RemoveAngle( angle );
105 }
106
107 void PanGestureDetector::RemoveDirection( Radian direction )
108 {
109   GetImplementation(*this).RemoveDirection( direction );
110 }
111
112 PanGestureDetector::DetectedSignalV2& PanGestureDetector::DetectedSignal()
113 {
114   return GetImplementation(*this).DetectedSignal();
115 }
116
117 void PanGestureDetector::SetPanGestureProperties( const PanGesture& pan )
118 {
119   Internal::PanGestureDetector::SetPanGestureProperties( pan );
120 }
121
122 } // namespace Dali