modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUi_TouchLongPressGestureDetectorImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an ”AS IS” BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file                FUi_TouchLongPressGestureDetectorImpl.cpp
19  * @brief               This is the implementation file for %_TouchLongPressGestureDetectorImpl class
20  * @version             2.0
21  *
22  * This file contains the implementation of %_TouchLongPressGestureDetectorImpl class.
23  *
24  */
25
26 #include <FUiTouchLongPressGestureDetector.h>
27 #include "FUi_TouchLongPressGestureDetectorImpl.h"
28 #include "FUi_TouchLongPressGestureDetector.h"
29
30 namespace Tizen { namespace Ui
31 {
32
33 _TouchLongPressGestureDetectorImpl::_TouchLongPressGestureDetectorImpl(TouchLongPressGestureDetector* pPublic, _TouchLongPressGestureDetector* pCore)
34         : _TouchGestureDetectorImpl(pPublic, pCore)
35 {
36 }
37
38 _TouchLongPressGestureDetectorImpl::~_TouchLongPressGestureDetectorImpl(void)
39 {
40 }
41
42 _TouchLongPressGestureDetectorImpl*
43 _TouchLongPressGestureDetectorImpl::CreateInstanceN(TouchLongPressGestureDetector* pPublic)
44 {
45         ClearLastResult();
46
47         _TouchLongPressGestureDetector* pCore = null;
48         pCore = new (std::nothrow) _TouchLongPressGestureDetector;
49         SysTryReturn(NID_UI, pCore, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
50
51         _TouchLongPressGestureDetectorImpl* pImpl = new (std::nothrow) _TouchLongPressGestureDetectorImpl(pPublic, pCore);
52         SysTryCatch(NID_UI, pImpl, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
53
54         return pImpl;
55
56 CATCH:
57         delete pCore;
58
59         return null;
60 }
61
62 const _TouchLongPressGestureDetector&
63 _TouchLongPressGestureDetectorImpl::GetCore(void) const
64 {
65         return static_cast<const _TouchLongPressGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
66 }
67
68 _TouchLongPressGestureDetector&
69 _TouchLongPressGestureDetectorImpl::GetCore(void)
70 {
71         return static_cast<_TouchLongPressGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
72 }
73
74 _TouchLongPressGestureDetectorImpl*
75 _TouchLongPressGestureDetectorImpl::GetInstance(TouchLongPressGestureDetector& gestureDetector)
76 {
77         return static_cast<_TouchLongPressGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
78 }
79
80 const _TouchLongPressGestureDetectorImpl*
81 _TouchLongPressGestureDetectorImpl::GetInstance(const TouchLongPressGestureDetector& gestureDetector)
82 {
83         return static_cast<const _TouchLongPressGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
84 }
85
86 result
87 _TouchLongPressGestureDetectorImpl::SetDuration(int duration)
88 {
89         return GetCore().SetDuration(duration);
90 }
91
92 int
93 _TouchLongPressGestureDetectorImpl::GetDuration(void) const
94 {
95         ClearLastResult();
96
97         return GetCore().GetDuration();
98 }
99
100 result
101 _TouchLongPressGestureDetectorImpl::SetMoveAllowance(int allowance)
102 {
103         return GetCore().SetMoveAllowance(allowance);
104 }
105
106 int
107 _TouchLongPressGestureDetectorImpl::GetMoveAllowance(void) const
108 {
109         ClearLastResult();
110
111         return GetCore().GetMoveAllowance();
112 }
113
114 result
115 _TouchLongPressGestureDetectorImpl::SetMoveAllowance(float allowance)
116 {
117         return GetCore().SetMoveAllowance(allowance);
118 }
119
120 float
121 _TouchLongPressGestureDetectorImpl::GetMoveAllowanceF(void) const
122 {
123         ClearLastResult();
124
125         return GetCore().GetMoveAllowanceF();
126 }
127
128 result
129 _TouchLongPressGestureDetectorImpl::SetTouchCount(int count)
130 {
131         return GetCore().SetTouchCount(count);
132 }
133
134 int
135 _TouchLongPressGestureDetectorImpl::GetTouchCount(void) const
136 {
137         ClearLastResult();
138
139         return GetCore().GetTouchCount();
140 }
141
142 } } // Tizen::Ui