Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / FUi_TouchTapGestureDetectorImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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_TouchTapGestureDetectorImpl.cpp
19  * @brief               This is the implementation file for %_TouchTapGestureDetectorImpl class
20  * @version             2.0
21  *
22  * This file contains the implementation of% _TouchTapGestureDetectorImpl class.
23  *
24  */
25
26 #include "FUi_TouchTapGestureDetectorImpl.h"
27
28 namespace Tizen { namespace Ui
29 {
30
31 _TouchTapGestureDetectorImpl::_TouchTapGestureDetectorImpl(TouchTapGestureDetector* pPublic, _TouchTapGestureDetector* pCore)
32         : _TouchGestureDetectorImpl(pPublic, pCore)
33 {
34 }
35
36 _TouchTapGestureDetectorImpl::~_TouchTapGestureDetectorImpl(void)
37 {
38 }
39
40 _TouchTapGestureDetectorImpl*
41 _TouchTapGestureDetectorImpl::CreateInstanceN(TouchTapGestureDetector* pPublic)
42 {
43         ClearLastResult();
44
45         _TouchTapGestureDetector* pCore = null;
46         pCore = new (std::nothrow) _TouchTapGestureDetector;
47         SysTryReturn(NID_UI, pCore, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
48
49         _TouchTapGestureDetectorImpl* pImpl = new (std::nothrow) _TouchTapGestureDetectorImpl(pPublic, pCore);
50         SysTryCatch(NID_UI, pImpl, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
51
52         return pImpl;
53
54 CATCH:
55         delete pCore;
56
57         return null;
58 }
59
60 const _TouchTapGestureDetector&
61 _TouchTapGestureDetectorImpl::GetCore(void) const
62 {
63         return static_cast<const _TouchTapGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
64 }
65
66 _TouchTapGestureDetector&
67 _TouchTapGestureDetectorImpl::GetCore(void)
68 {
69         return static_cast<_TouchTapGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
70 }
71
72 _TouchTapGestureDetectorImpl*
73 _TouchTapGestureDetectorImpl::GetInstance(TouchTapGestureDetector& gestureDetector)
74 {
75         return static_cast<_TouchTapGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
76 }
77
78 const _TouchTapGestureDetectorImpl*
79 _TouchTapGestureDetectorImpl::GetInstance(const TouchTapGestureDetector& gestureDetector)
80 {
81         return static_cast<const _TouchTapGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
82 }
83
84 result
85 _TouchTapGestureDetectorImpl::SetTapCount(int count)
86 {
87         return GetCore().SetTapCount(count);
88 }
89
90 int
91 _TouchTapGestureDetectorImpl::GetTapCount(void) const
92 {
93         ClearLastResult();
94
95         return GetCore().GetTapCount();
96 }
97
98 result
99 _TouchTapGestureDetectorImpl::SetTapInterval(long intarval)
100 {
101         return GetCore().SetTapInterval(intarval);
102 }
103
104 long
105 _TouchTapGestureDetectorImpl::GetTapInterval(void) const
106 {
107         ClearLastResult();
108
109         return GetCore().GetTapInterval();
110 }
111
112 result
113 _TouchTapGestureDetectorImpl::SetMoveAllowance(int allowance)
114 {
115         return GetCore().SetMoveAllowance(allowance);
116 }
117
118 int
119 _TouchTapGestureDetectorImpl::GetMoveAllowance(void) const
120 {
121         return GetCore().GetMoveAllowance();
122 }
123
124 result
125 _TouchTapGestureDetectorImpl::SetTouchCount(int count)
126 {
127         return GetCore().SetTouchCount(count);
128 }
129
130 int
131 _TouchTapGestureDetectorImpl::GetTouchCount(void) const
132 {
133         ClearLastResult();
134
135         return GetCore().GetTouchCount();
136 }
137
138 } } //Tizen::Ui