Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[platform/core/uifw/dali-core.git] / dali / public-api / events / long-press-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/long-press-gesture-detector.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/events/long-press-gesture-detector-impl.h>
23
24 namespace Dali
25 {
26
27 LongPressGestureDetector::LongPressGestureDetector(Internal::LongPressGestureDetector* internal)
28 : GestureDetector(internal)
29 {
30 }
31
32 LongPressGestureDetector::LongPressGestureDetector()
33 {
34 }
35
36 LongPressGestureDetector LongPressGestureDetector::New()
37 {
38   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New();
39
40   return LongPressGestureDetector(internal.Get());
41 }
42
43 LongPressGestureDetector LongPressGestureDetector::New(uint32_t touchesRequired)
44 {
45   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(touchesRequired);
46
47   return LongPressGestureDetector(internal.Get());
48 }
49
50 LongPressGestureDetector LongPressGestureDetector::New(uint32_t minTouches, uint32_t maxTouches)
51 {
52   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(minTouches, maxTouches);
53
54   return LongPressGestureDetector(internal.Get());
55 }
56
57 LongPressGestureDetector LongPressGestureDetector::DownCast( BaseHandle handle )
58 {
59   return LongPressGestureDetector( dynamic_cast<Dali::Internal::LongPressGestureDetector*>(handle.GetObjectPtr()) );
60 }
61
62 LongPressGestureDetector::~LongPressGestureDetector()
63 {
64 }
65
66 LongPressGestureDetector::LongPressGestureDetector(const LongPressGestureDetector& handle)
67 : GestureDetector(handle)
68 {
69 }
70
71 LongPressGestureDetector& LongPressGestureDetector::operator=(const LongPressGestureDetector& rhs)
72 {
73   BaseHandle::operator=(rhs);
74   return *this;
75 }
76
77 void LongPressGestureDetector::SetTouchesRequired(uint32_t touches)
78 {
79   GetImplementation(*this).SetTouchesRequired(touches);
80 }
81
82 void LongPressGestureDetector::SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches)
83 {
84   GetImplementation(*this).SetTouchesRequired(minTouches, maxTouches);
85 }
86
87 uint32_t LongPressGestureDetector::GetMinimumTouchesRequired() const
88 {
89   return GetImplementation(*this).GetMinimumTouchesRequired();
90 }
91
92 uint32_t LongPressGestureDetector::GetMaximumTouchesRequired() const
93 {
94   return GetImplementation(*this).GetMaximumTouchesRequired();
95 }
96
97 LongPressGestureDetector::DetectedSignalType& LongPressGestureDetector::DetectedSignal()
98 {
99   return GetImplementation(*this).DetectedSignal();
100 }
101
102 } // namespace Dali