2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/public-api/events/pan-gesture-detector.h>
22 #include <dali/internal/event/events/pan-gesture-detector-impl.h>
27 const char* const PanGestureDetector::SIGNAL_PAN_DETECTED = "pan-detected";
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 );
37 PanGestureDetector::PanGestureDetector(Internal::PanGestureDetector* internal)
38 : GestureDetector(internal)
42 PanGestureDetector::PanGestureDetector()
46 PanGestureDetector PanGestureDetector::New()
48 Internal::PanGestureDetectorPtr internal = Internal::PanGestureDetector::New();
50 return PanGestureDetector(internal.Get());
53 PanGestureDetector PanGestureDetector::DownCast( BaseHandle handle )
55 return PanGestureDetector( dynamic_cast<Dali::Internal::PanGestureDetector*>(handle.GetObjectPtr()) );
58 PanGestureDetector::~PanGestureDetector()
62 PanGestureDetector::PanGestureDetector(const PanGestureDetector& handle)
63 : GestureDetector(handle)
67 PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
69 BaseHandle::operator=(rhs);
73 void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
75 GetImplementation(*this).SetMinimumTouchesRequired(minimum);
78 void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
80 GetImplementation(*this).SetMaximumTouchesRequired(maximum);
83 unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
85 return GetImplementation(*this).GetMinimumTouchesRequired();
88 unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
90 return GetImplementation(*this).GetMaximumTouchesRequired();
93 void PanGestureDetector::AddAngle( Radian angle, Radian threshold )
95 GetImplementation(*this).AddAngle( angle, threshold );
98 void PanGestureDetector::AddDirection( Radian direction, Radian threshold )
100 GetImplementation(*this).AddDirection( direction, threshold );
103 const PanGestureDetector::AngleContainer& PanGestureDetector::GetAngles() const
105 return GetImplementation(*this).GetAngles();
108 void PanGestureDetector::ClearAngles()
110 GetImplementation(*this).ClearAngles();
113 void PanGestureDetector::RemoveAngle( Radian angle )
115 GetImplementation(*this).RemoveAngle( angle );
118 void PanGestureDetector::RemoveDirection( Radian direction )
120 GetImplementation(*this).RemoveDirection( direction );
123 PanGestureDetector::DetectedSignalV2& PanGestureDetector::DetectedSignal()
125 return GetImplementation(*this).DetectedSignal();
128 void PanGestureDetector::SetPanGestureProperties( const PanGesture& pan )
130 Internal::PanGestureDetector::SetPanGestureProperties( pan );