Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / FUi_TouchFlickGestureDetectorImpl.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_TouchFlickGestureDetectorImpl.cpp
19  * @brief               This is the implementation file for %_TouchFlickGestureDetectorImpl class
20  * @version     2.0
21  *
22  * This file contains the implementation of %_TouchFlickGestureDetectorImpl class.
23  *
24  */
25
26 #include <FUiTouchFlickGestureDetector.h>
27 #include "FUi_TouchFlickGestureDetectorImpl.h"
28 #include "FUi_TouchFlickGestureDetector.h"
29
30 using namespace Tizen::Graphics;
31
32 namespace Tizen { namespace Ui
33 {
34
35 _TouchFlickGestureDetectorImpl::_TouchFlickGestureDetectorImpl(TouchFlickGestureDetector* pPublic, _TouchFlickGestureDetector* pCore)
36         : _TouchGestureDetectorImpl(pPublic, pCore)
37 {
38 }
39
40 _TouchFlickGestureDetectorImpl::~_TouchFlickGestureDetectorImpl(void)
41 {
42 }
43
44 _TouchFlickGestureDetectorImpl*
45 _TouchFlickGestureDetectorImpl::CreateInstanceN(TouchFlickGestureDetector* pPublic)
46 {
47         ClearLastResult();
48
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.");
52
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.");
55
56         return pImpl;
57
58 CATCH:
59         delete pCore;
60
61         return null;
62 }
63
64 _TouchFlickGestureDetectorImpl*
65 _TouchFlickGestureDetectorImpl::GetInstance(TouchFlickGestureDetector& gestureDetector)
66 {
67         return static_cast<_TouchFlickGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
68 }
69
70 const _TouchFlickGestureDetectorImpl*
71 _TouchFlickGestureDetectorImpl::GetInstance(const TouchFlickGestureDetector& gestureDetector)
72 {
73         return static_cast<const _TouchFlickGestureDetectorImpl*> (gestureDetector.__pTouchGestureDetectorImpl);
74 }
75
76 const _TouchFlickGestureDetector&
77 _TouchFlickGestureDetectorImpl::GetCore(void) const
78 {
79         return static_cast<const _TouchFlickGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
80 }
81
82 _TouchFlickGestureDetector&
83 _TouchFlickGestureDetectorImpl::GetCore(void)
84 {
85         return static_cast<_TouchFlickGestureDetector&>(_TouchGestureDetectorImpl::GetCore());
86 }
87
88 result
89 _TouchFlickGestureDetectorImpl::GetDistance(int &x, int &y) const
90 {
91         GetCore().GetDistance(x, y);
92
93         return E_SUCCESS;
94 }
95
96 result
97 _TouchFlickGestureDetectorImpl::GetDistance(float &x, float &y) const
98 {
99         GetCore().GetDistance(x, y);
100
101         return E_SUCCESS;
102 }
103
104 int
105 _TouchFlickGestureDetectorImpl::GetDuration(void) const
106 {
107         ClearLastResult();
108
109         return GetCore().GetDuration();
110 }
111
112 FlickDirection
113 _TouchFlickGestureDetectorImpl::GetDirection(void) const
114 {
115         ClearLastResult();
116
117         return static_cast<FlickDirection>(GetCore().GetDirection());
118 }
119
120 }} //Tizen::Ui