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_TouchEventInfoImpl.cpp
19 * @brief This is the implementation for the _TouchEventInfoImpl class.
25 #include <FBaseDataType.h>
26 #include <FBaseErrors.h>
27 #include <FBaseSysLog.h>
28 #include "FUi_TouchEventInfoImpl.h"
29 #include "FUi_UiTouchEvent.h"
31 using namespace Tizen::Graphics;
33 namespace Tizen { namespace Ui
37 _TouchEventInfoImpl::CreateInstanceN(TouchEventInfo* pPublic)
41 _TouchEventInfoImpl* pImpl = new (std::nothrow) _TouchEventInfoImpl(pPublic);
42 SysTryReturn(NID_UI, pImpl, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
47 _TouchEventInfoImpl::_TouchEventInfoImpl(TouchEventInfo* pPublic)
50 , __touchStatus(_TOUCH_PRESSED)
51 , __startPosition(0, 0)
52 , __currentPosition(0, 0)
57 _TouchEventInfoImpl::~_TouchEventInfoImpl(void)
62 _TouchEventInfoImpl::SetTouchEventInfo(const _TouchInfo& touchInfo, const Point startPosition)
64 __pointId = touchInfo.GetPointId();
65 __startPosition.x = startPosition.x;
66 __startPosition.y = startPosition.y;
67 __currentPosition.x = touchInfo.GetCurrentPosition().x;
68 __currentPosition.y = touchInfo.GetCurrentPosition().y;
69 __isFlicked = touchInfo.IsFlicked();
70 __touchStatus = touchInfo.GetTouchStatus();
74 _TouchEventInfoImpl::GetPointId(void) const
80 _TouchEventInfoImpl::GetStartPosition(void) const
82 return Point(__startPosition.x, __startPosition.y);
86 _TouchEventInfoImpl::GetStartPositionF(void) const
88 return __startPosition;
92 _TouchEventInfoImpl::GetCurrentPosition(void) const
94 return Point(__currentPosition.x, __currentPosition.y);
98 _TouchEventInfoImpl::GetCurrentPositionF(void) const
100 return __currentPosition;
104 _TouchEventInfoImpl::GetTouchStatus(void) const
106 return __touchStatus;
110 _TouchEventInfoImpl::IsFlicked(void) const