|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 /* |
|
23 W A R N I N G |
|
24 ------------- |
|
25 THIS IS A TEMPORARY GESTURE CODE. WOULD BE REPLACED WHEN BROWSER HAS ITS OWN GESTURE FRAMEWORK |
|
26 */ |
|
27 |
|
28 #include "GestureEvent.h" |
|
29 |
|
30 namespace GVA { |
|
31 |
|
32 GestureEvent::GestureEvent() |
|
33 : m_type(GestureEvent::None) |
|
34 , m_pos(QPoint(-1,-1)) |
|
35 , m_delta(QPoint(-1,-1)) |
|
36 , m_velocity(QPointF(0,0)) |
|
37 {} |
|
38 |
|
39 GestureEvent::GestureEvent(const GestureEvent& gesture) |
|
40 { |
|
41 m_type = gesture.m_type; |
|
42 m_pos = gesture.m_pos; |
|
43 m_delta = gesture.m_delta; |
|
44 m_velocity = gesture.m_velocity; |
|
45 } |
|
46 |
|
47 GestureEvent& GestureEvent::operator=(const GestureEvent& gesture) |
|
48 { |
|
49 m_type = gesture.m_type; |
|
50 m_pos = gesture.m_pos; |
|
51 m_delta = gesture.m_delta; |
|
52 m_velocity = gesture.m_velocity; |
|
53 |
|
54 return *this; |
|
55 } |
|
56 |
|
57 GestureEvent::~GestureEvent() |
|
58 { } |
|
59 |
|
60 GestureEvent::Type GestureEvent::type() const |
|
61 { |
|
62 return m_type; |
|
63 } |
|
64 |
|
65 void GestureEvent::setType(GestureEvent::Type type) |
|
66 { |
|
67 m_type = type; |
|
68 } |
|
69 |
|
70 QPointF GestureEvent::position() const |
|
71 { |
|
72 return m_pos; |
|
73 } |
|
74 |
|
75 void GestureEvent::setPosition(const QPointF& pos) |
|
76 { |
|
77 m_pos = pos; |
|
78 } |
|
79 |
|
80 |
|
81 QPoint GestureEvent::delta() const |
|
82 { |
|
83 return m_delta; |
|
84 } |
|
85 |
|
86 void GestureEvent::setDelta(const QPoint& delta) |
|
87 { |
|
88 m_delta = delta; |
|
89 } |
|
90 |
|
91 QPointF GestureEvent::velocity() const |
|
92 { |
|
93 return m_velocity; |
|
94 } |
|
95 |
|
96 void GestureEvent::setVelocity(const QPointF& velocity) |
|
97 { |
|
98 m_velocity = velocity; |
|
99 } |
|
100 |
|
101 } //namespace GVA |