modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUi_TouchPinchGestureDetectorImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
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_TouchPinchGestureDetectorImpl.cpp
19  * @brief               This is the implementation file for %_TouchPinchGestureDetectorImpl class
20  * @version             2.0
21  *
22  * This file contains the implementation of %_TouchPinchGestureDetectorImpl class.
23  *
24  */
25
26 #include <FUiTouchPinchGestureDetector.h>
27 #include "FUi_TouchPinchGestureDetectorImpl.h"
28 #include "FUi_TouchPinchGestureDetector.h"
29
30 using namespace Tizen::Graphics;
31
32 namespace Tizen { namespace Ui
33 {
34
35 _TouchPinchGestureDetectorImpl::_TouchPinchGestureDetectorImpl(TouchPinchGestureDetector* pPublic, _TouchPinchGestureDetector* pCore)
36         : _TouchGestureDetectorImpl(pPublic, pCore)
37 {
38 }
39
40 _TouchPinchGestureDetectorImpl::~_TouchPinchGestureDetectorImpl(void)
41 {
42 }
43
44 _TouchPinchGestureDetectorImpl*
45 _TouchPinchGestureDetectorImpl::CreateInstanceN(TouchPinchGestureDetector* pPublic)
46 {
47         ClearLastResult();
48
49         _TouchPinchGestureDetector* pCore = null;
50         pCore = new (std::nothrow) _TouchPinchGestureDetector;
51         SysTryReturn(NID_UI, pCore, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
52
53         _TouchPinchGestureDetectorImpl* pImpl = new (std::nothrow) _TouchPinchGestureDetectorImpl(pPublic, pCore);
54         SysTryCatch(NID_UI, pImpl, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
55
56         return pImpl;
57
58 CATCH:
59         delete pCore;
60
61         return null;
62 }
63
64 const _TouchPinchGestureDetector&
65 _TouchPinchGestureDetectorImpl::GetCore(void) const
66 {
67         return static_cast<const _TouchPinchGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
68 }
69
70 _TouchPinchGestureDetector&
71 _TouchPinchGestureDetectorImpl::GetCore(void)
72 {
73         return static_cast<_TouchPinchGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
74 }
75
76 _TouchPinchGestureDetectorImpl*
77 _TouchPinchGestureDetectorImpl::GetInstance(TouchPinchGestureDetector& gestureDetector)
78 {
79         return static_cast<_TouchPinchGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
80 }
81
82 const _TouchPinchGestureDetectorImpl*
83 _TouchPinchGestureDetectorImpl::GetInstance(const TouchPinchGestureDetector& gestureDetector)
84 {
85         return static_cast<const _TouchPinchGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
86 }
87
88 Point
89 _TouchPinchGestureDetectorImpl::GetCenterPoint(void) const
90 {
91         ClearLastResult();
92
93         return GetCore().GetCenterPoint();
94 }
95
96 FloatPoint
97 _TouchPinchGestureDetectorImpl::GetCenterPointF(void) const
98 {
99         ClearLastResult();
100
101         return GetCore().GetCenterPointF();
102 }
103
104 int
105 _TouchPinchGestureDetectorImpl::GetScale(void) const
106 {
107         ClearLastResult();
108
109         return GetCore().GetScale();
110 }
111
112 float
113 _TouchPinchGestureDetectorImpl::GetScaleF(void) const
114 {
115         ClearLastResult();
116
117         return GetCore().GetScaleF();
118 }
119
120 } }  //Tizen::Ui