[dali_2.3.23] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / public-api / events / long-press-gesture-detector.cpp
1 /*
2  * Copyright (c) 2022 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/long-press-gesture-detector-impl.h>
23
24 namespace Dali
25 {
26 LongPressGestureDetector::LongPressGestureDetector(Internal::LongPressGestureDetector* internal)
27 : GestureDetector(internal)
28 {
29 }
30
31 LongPressGestureDetector::LongPressGestureDetector() = default;
32
33 LongPressGestureDetector LongPressGestureDetector::New()
34 {
35   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New();
36
37   return LongPressGestureDetector(internal.Get());
38 }
39
40 LongPressGestureDetector LongPressGestureDetector::New(uint32_t touchesRequired)
41 {
42   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(touchesRequired);
43
44   return LongPressGestureDetector(internal.Get());
45 }
46
47 LongPressGestureDetector LongPressGestureDetector::New(uint32_t minTouches, uint32_t maxTouches)
48 {
49   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(minTouches, maxTouches);
50
51   return LongPressGestureDetector(internal.Get());
52 }
53
54 LongPressGestureDetector LongPressGestureDetector::DownCast(BaseHandle handle)
55 {
56   return LongPressGestureDetector(dynamic_cast<Dali::Internal::LongPressGestureDetector*>(handle.GetObjectPtr()));
57 }
58
59 LongPressGestureDetector::~LongPressGestureDetector() = default;
60
61 LongPressGestureDetector::LongPressGestureDetector(const LongPressGestureDetector& handle) = default;
62
63 LongPressGestureDetector& LongPressGestureDetector::operator=(const LongPressGestureDetector& rhs) = default;
64
65 LongPressGestureDetector::LongPressGestureDetector(LongPressGestureDetector&& handle) noexcept = default;
66
67 LongPressGestureDetector& LongPressGestureDetector::operator=(LongPressGestureDetector&& rhs) noexcept = default;
68
69 void LongPressGestureDetector::SetTouchesRequired(uint32_t touches)
70 {
71   GetImplementation(*this).SetTouchesRequired(touches);
72 }
73
74 void LongPressGestureDetector::SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches)
75 {
76   GetImplementation(*this).SetTouchesRequired(minTouches, maxTouches);
77 }
78
79 uint32_t LongPressGestureDetector::GetMinimumTouchesRequired() const
80 {
81   return GetImplementation(*this).GetMinimumTouchesRequired();
82 }
83
84 uint32_t LongPressGestureDetector::GetMaximumTouchesRequired() const
85 {
86   return GetImplementation(*this).GetMaximumTouchesRequired();
87 }
88
89 LongPressGestureDetector::DetectedSignalType& LongPressGestureDetector::DetectedSignal()
90 {
91   return GetImplementation(*this).DetectedSignal();
92 }
93
94 } // namespace Dali