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 FUi_TouchFlickGestureDetectorImpl.cpp
19 * @brief This is the implementation file for %_TouchFlickGestureDetectorImpl class
22 * This file contains the implementation of %_TouchFlickGestureDetectorImpl class.
26 #include <FUiTouchFlickGestureDetector.h>
27 #include "FUi_TouchFlickGestureDetectorImpl.h"
28 #include "FUi_TouchFlickGestureDetector.h"
30 using namespace Tizen::Graphics;
32 namespace Tizen { namespace Ui
35 _TouchFlickGestureDetectorImpl::_TouchFlickGestureDetectorImpl(TouchFlickGestureDetector* pPublic, _TouchFlickGestureDetector* pCore)
36 : _TouchGestureDetectorImpl(pPublic, pCore)
40 _TouchFlickGestureDetectorImpl::~_TouchFlickGestureDetectorImpl(void)
44 _TouchFlickGestureDetectorImpl*
45 _TouchFlickGestureDetectorImpl::CreateInstanceN(TouchFlickGestureDetector* pPublic)
49 _TouchFlickGestureDetector* pCore = null;
50 pCore = new (std::nothrow) _TouchFlickGestureDetector;
51 SysTryReturn(NID_UI, pCore, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is shortage.");
53 _TouchFlickGestureDetectorImpl* pImpl = new (std::nothrow) _TouchFlickGestureDetectorImpl(pPublic, pCore);
54 SysTryCatch(NID_UI, pImpl, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is shortage.");
64 _TouchFlickGestureDetectorImpl*
65 _TouchFlickGestureDetectorImpl::GetInstance(TouchFlickGestureDetector& gestureDetector)
67 return static_cast<_TouchFlickGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
70 const _TouchFlickGestureDetectorImpl*
71 _TouchFlickGestureDetectorImpl::GetInstance(const TouchFlickGestureDetector& gestureDetector)
73 return static_cast<const _TouchFlickGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
76 const _TouchFlickGestureDetector&
77 _TouchFlickGestureDetectorImpl::GetCore(void) const
79 return static_cast<const _TouchFlickGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
82 _TouchFlickGestureDetector&
83 _TouchFlickGestureDetectorImpl::GetCore(void)
85 return static_cast<_TouchFlickGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
89 _TouchFlickGestureDetectorImpl::GetDistance(int &x, int &y) const
91 GetCore().GetDistance(x, y);
97 _TouchFlickGestureDetectorImpl::GetDistance(float &x, float &y) const
99 GetCore().GetDistance(x, y);
105 _TouchFlickGestureDetectorImpl::GetDuration(void) const
109 return GetCore().GetDuration();
113 _TouchFlickGestureDetectorImpl::GetDirection(void) const
117 return static_cast<FlickDirection>(GetCore().GetDirection());