2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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.
18 * @file FUiTouchTapGestureDetector.cpp
19 * @brief This is the implementation file for %TouchTapGestureDetector class
22 * This file contains the implementation of %TouchTapGestureDetector class.
26 #include <FUiITouchTapGestureEventListener.h>
27 #include <FBaseSysLog.h>
28 #include "FUi_TouchTapGestureDetectorImpl.h"
30 namespace Tizen { namespace Ui
32 TouchTapGestureDetector::TouchTapGestureDetector(void)
36 TouchTapGestureDetector::~TouchTapGestureDetector(void)
41 TouchTapGestureDetector::Construct(void)
43 SysAssertf(__pTouchGestureDetectorImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
45 _TouchGestureDetectorImpl* pImpl = _TouchTapGestureDetectorImpl::CreateInstanceN(this);
46 result r = GetLastResult();
47 SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
49 __pTouchGestureDetectorImpl = pImpl;
55 TouchTapGestureDetector::AddTapGestureEventListener(ITouchTapGestureEventListener& listener)
57 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
59 return __pTouchGestureDetectorImpl->AddGestureEventListener(listener);
63 TouchTapGestureDetector::RemoveTapGestureEventListener(ITouchTapGestureEventListener& listener)
65 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
67 return __pTouchGestureDetectorImpl->RemoveGestureEventListener(listener);
71 TouchTapGestureDetector::SetTapCount(int count)
73 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
75 _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
76 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
78 return pTouchTapGestureDetectorImpl->SetTapCount(count);
82 TouchTapGestureDetector::GetTapCount(void) const
84 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
86 const _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
87 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
89 return pTouchTapGestureDetectorImpl->GetTapCount();
93 TouchTapGestureDetector::SetTapInterval(int intarval)
95 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
97 _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
98 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
100 return pTouchTapGestureDetectorImpl->SetTapInterval(intarval);
104 TouchTapGestureDetector::GetTapInterval(void) const
106 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
108 const _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
109 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
111 return pTouchTapGestureDetectorImpl->GetTapInterval();
115 TouchTapGestureDetector::SetMoveAllowance(int allowance)
117 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
119 _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
120 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
122 return pTouchTapGestureDetectorImpl->SetMoveAllowance(allowance);
126 TouchTapGestureDetector::SetMoveAllowance(float allowance)
128 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
130 _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
131 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
133 return pTouchTapGestureDetectorImpl->SetMoveAllowance(allowance);
137 TouchTapGestureDetector::GetMoveAllowance(void) const
139 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
141 const _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
142 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
144 return pTouchTapGestureDetectorImpl->GetMoveAllowance();
148 TouchTapGestureDetector::GetMoveAllowanceF(void) const
150 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
152 const _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
153 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
155 return pTouchTapGestureDetectorImpl->GetMoveAllowanceF();
159 TouchTapGestureDetector::SetTouchCount(int count)
161 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
163 _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
164 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
166 return pTouchTapGestureDetectorImpl->SetTouchCount(count);
170 TouchTapGestureDetector::GetTouchCount(void) const
172 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
174 const _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this);
175 SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
177 return pTouchTapGestureDetectorImpl->GetTouchCount();