modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUi_TouchEventArg.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_TouchEventArg.cpp
19  * @brief               This is the implementation file for the _TouchEventArg class.
20  */
21
22 #include "FUi_TouchEventArg.h"
23
24 using namespace Tizen::Base;
25 using namespace Tizen::Base::Runtime;
26 using namespace Tizen::Graphics;
27
28 namespace Tizen { namespace Ui
29 {
30
31 _TouchEventArg::_TouchEventArg(const Tizen::Ui::Control& source, _TouchStatus status)
32         : __PointId(0)
33         , __pSource(const_cast <Control*>(&source))
34         , __touchStatus(status)
35         , __startPosition(-1, -1)
36         , __currentPosition(-1, -1)
37         , __isFlicked(false)
38 {
39
40 }
41
42 _TouchEventArg::~_TouchEventArg(void)
43 {
44         // NOTHING
45 }
46
47 _TouchStatus
48 _TouchEventArg::GetTouchStatus(void) const
49 {
50         return (__touchStatus);
51 }
52
53 const Tizen::Ui::Control*
54 _TouchEventArg::GetSource(void) const
55 {
56         return (__pSource);
57 }
58
59 void
60 _TouchEventArg::SetTouchPosition(unsigned long PointId, float startX, float startY, float currentX, float currentY)
61 {
62         __PointId = PointId;
63         __startPosition = Tizen::Graphics::FloatPoint(startX, startY);
64         __currentPosition = Tizen::Graphics::FloatPoint(currentX, currentY);
65 }
66
67 unsigned long
68 _TouchEventArg::GetPointId(void) const
69 {
70         return __PointId;
71 }
72
73 const FloatPoint
74 _TouchEventArg::GetStartPosition(void) const
75 {
76         return __startPosition;
77 }
78
79 const FloatPoint
80 _TouchEventArg::GetCurrentPosition(void) const
81 {
82         return __currentPosition;
83 }
84
85 void
86 _TouchEventArg::SetFlickedStatus(bool isFlicked)
87 {
88         __isFlicked = isFlicked;
89 }
90
91 bool
92 _TouchEventArg::IsFlicked(void) const
93 {
94         return __isFlicked;
95 }
96
97 }} // Tizen::Ui