modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUi_TouchRotationGestureDetectorImpl.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_TouchRotationGestureDetectorImpl.cpp
19  * @brief               This is the implementation file for %_TouchRotationGestureDetectorImpl class
20  * @version             2.0
21  *
22  * This file contains the implementation of %_TouchRotationGestureDetectorImpl class.
23  *
24  */
25
26 // includes
27 #include <FUiTouchRotationGestureDetector.h>
28 #include "FUi_TouchRotationGestureDetector.h"
29 #include "FUi_TouchRotationGestureDetectorImpl.h"
30
31 namespace Tizen { namespace Ui
32 {
33
34 _TouchRotationGestureDetectorImpl::_TouchRotationGestureDetectorImpl(TouchRotationGestureDetector* pPublic, _TouchRotationGestureDetector* pCore)
35         : _TouchGestureDetectorImpl(pPublic, pCore)
36 {
37 }
38
39 _TouchRotationGestureDetectorImpl::~_TouchRotationGestureDetectorImpl(void)
40 {
41 }
42
43 _TouchRotationGestureDetectorImpl*
44 _TouchRotationGestureDetectorImpl::CreateInstanceN(TouchRotationGestureDetector* pPublic)
45 {
46         ClearLastResult();
47
48         _TouchRotationGestureDetector* pCore = null;
49         pCore = new (std::nothrow) _TouchRotationGestureDetector;
50         SysTryReturn(NID_UI, pCore, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is shortage.");
51
52         _TouchRotationGestureDetectorImpl* pImpl = new (std::nothrow) _TouchRotationGestureDetectorImpl(pPublic, pCore);
53         SysTryCatch(NID_UI, pImpl, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is shortage.");
54
55         return pImpl;
56
57 CATCH:
58         delete pCore;
59
60         return null;
61 }
62
63 const _TouchRotationGestureDetector&
64 _TouchRotationGestureDetectorImpl::GetCore(void) const
65 {
66         return static_cast<const _TouchRotationGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
67 }
68
69 _TouchRotationGestureDetector&
70 _TouchRotationGestureDetectorImpl::GetCore(void)
71 {
72         return static_cast<_TouchRotationGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
73 }
74
75 _TouchRotationGestureDetectorImpl*
76 _TouchRotationGestureDetectorImpl::GetInstance(TouchRotationGestureDetector& gestureDetector)
77 {
78         return static_cast<_TouchRotationGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
79 }
80
81 const _TouchRotationGestureDetectorImpl*
82 _TouchRotationGestureDetectorImpl::GetInstance(const TouchRotationGestureDetector& gestureDetector)
83 {
84         return static_cast<const _TouchRotationGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
85 }
86
87 float
88 _TouchRotationGestureDetectorImpl::GetAngle(void) const
89 {
90         ClearLastResult();
91
92         return GetCore().GetAngle();
93 }
94
95 int
96 _TouchRotationGestureDetectorImpl::GetDistance(void) const
97 {
98         ClearLastResult();
99
100         return GetCore().GetDistance();
101 }
102
103 float
104 _TouchRotationGestureDetectorImpl::GetDistanceF(void) const
105 {
106         ClearLastResult();
107
108         return GetCore().GetDistance();
109 }
110
111 }} // Tizen::Ui