2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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 FUiTouchPanningGestureDetector.cpp
19 * @brief This is the implementation file for %TouchPanningGestureDetector class
22 * This file contains the implementation of %TouchPanningGestureDetector class.
26 #include <FUiITouchPanningGestureEventListener.h>
27 #include <FBaseSysLog.h>
28 #include "FUi_TouchPanningGestureDetectorImpl.h"
30 using namespace Tizen::Base::Collection;
32 namespace Tizen { namespace Ui
34 TouchPanningGestureDetector::TouchPanningGestureDetector(void)
38 TouchPanningGestureDetector::~TouchPanningGestureDetector(void)
43 TouchPanningGestureDetector::Construct(void)
45 SysAssertf(__pTouchGestureDetectorImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
47 _TouchGestureDetectorImpl* pImpl = _TouchPanningGestureDetectorImpl::CreateInstanceN(this);
48 result r = GetLastResult();
49 SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagatin.", GetErrorMessage(r));
51 __pTouchGestureDetectorImpl = pImpl;
57 TouchPanningGestureDetector::AddPanningGestureEventListener(ITouchPanningGestureEventListener& listener)
59 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
61 return __pTouchGestureDetectorImpl->AddGestureEventListener(listener);
65 TouchPanningGestureDetector::RemovePanningGestureEventListener(ITouchPanningGestureEventListener& listener)
67 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
69 return __pTouchGestureDetectorImpl->RemoveGestureEventListener(listener);
73 TouchPanningGestureDetector::GetTouchInfoListN(void) const
75 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
77 const _TouchPanningGestureDetectorImpl* pTouchPanningGestureDetectorImpl = _TouchPanningGestureDetectorImpl::GetInstance(*this);
78 SysAssertf(pTouchPanningGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
80 return pTouchPanningGestureDetectorImpl->GetTouchInfoListN();
84 TouchPanningGestureDetector::SetTouchCount(int count)
86 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
88 _TouchPanningGestureDetectorImpl* pTouchPanningGestureDetectorImpl = _TouchPanningGestureDetectorImpl::GetInstance(*this);
89 SysAssertf(pTouchPanningGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
91 return pTouchPanningGestureDetectorImpl->SetTouchCount(count);
95 TouchPanningGestureDetector::GetTouchCount(void) const
97 SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
99 const _TouchPanningGestureDetectorImpl* pTouchPanningGestureDetectorImpl = _TouchPanningGestureDetectorImpl::GetInstance(*this);
100 SysAssertf(pTouchPanningGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
102 return pTouchPanningGestureDetectorImpl->GetTouchCount();