LunaSysMgr
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
FlickEvent.h
Go to the documentation of this file.
1
/****************************************************************************
2
**
3
** Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
4
** All rights reserved.
5
**
6
** $QT_BEGIN_LICENSE:LGPL$
7
** GNU Lesser General Public License Usage
8
** Alternatively, this file may be used under the terms of the GNU Lesser
9
** General Public License version 2.1 as published by the Free Software
10
** Foundation and appearing in the file LICENSE.LGPL included in the
11
** packaging of this file. Please review the following information to
12
** ensure the GNU Lesser General Public License version 2.1 requirements
13
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
14
**
15
** In addition, as a special exception, Palm gives you certain additional
16
** rights. These rights are described in the Nokia Qt LGPL Exception
17
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
18
**
19
** $QT_END_LICENSE$
20
**
21
****************************************************************************/
22
23
#ifndef FLICKEVENT_H
24
#define FLICKEVENT_H
25
#include <QEvent>
26
#include <SysMgrDefs.h>
27
// this is also defined in SysMgrDefs.h
28
//enum SysMgrGesture {
29
// SysMgrGestureFlick = 0x0100 + 1,
30
// SysMgrGestureSingleClick,
31
// SysMgrGestureScreenEdgeFlick,
32
// SysMgrGestureLast = 0xFFFFFFFF
33
//};
34
35
class
SysMgrGestureEvent
:
public
QEvent
36
{
37
protected
:
38
Qt::GestureState
m_state
;
39
QPointF
m_hotSpot
;
40
SysMgrGestureEvent
(
QEvent::Type
type):
QEvent
(type) {}
41
public
:
42
QPointF
hotSpot
()
const
{
return
m_hotSpot
;}
43
void
setHotSpot
(
const
QPointF & value ) {
m_hotSpot
= value;}
44
Qt::GestureState
state
()
const
{
return
m_state
;}
45
void
setState
(Qt::GestureState value) {
m_state
= value;}
46
};
47
48
class
FlickEvent
:
public
SysMgrGestureEvent
49
{
50
public
:
51
52
FlickEvent
(
QObject
* parent = 0):
SysMgrGestureEvent
((
QEvent
::
Type
)SysMgrGestureFlick) {}
53
QPoint
velocity
()
const
{
return
m_velocity; }
54
QPoint
startPos
()
const
{
return
m_startPos; }
55
QPoint
endPos
()
const
{
return
m_endPos; }
56
57
58
59
public
:
60
static
const
QEvent::Type
myType
=
static_cast<
QEvent::Type
>
(
QEvent::User
+1);
61
62
private
:
63
64
QPoint m_velocity;
65
QPoint m_endPos;
66
QPoint m_startPos;
67
};
68
69
class
ScreenEdgeFlickEvent
:
public
SysMgrGestureEvent
70
{
71
public
:
72
73
enum
Edge
{
74
EdgeUnknown
= 0,
75
EdgeTop
,
76
EdgeBottom
,
77
EdgeLeft
,
78
EdgeRight
79
};
80
81
ScreenEdgeFlickEvent
(
QObject
* parent = 0)
82
:
SysMgrGestureEvent
((
QEvent
::
Type
)SysMgrGestureScreenEdgeFlick)
83
, m_edge(
EdgeUnknown
)
84
, m_yDistance(0){
85
}
86
87
Edge
edge
()
const
{
return
m_edge; }
88
int
yDistance
()
const
{
return
m_yDistance; }
89
90
private
:
91
92
Edge
m_edge;
93
int
m_yDistance;
94
95
};
96
#endif // FLICKEVENT_H
luna-sysmgr
Src
base
gesture
FlickEvent.h
Generated on Fri Jun 21 2013 00:53:53 for LunaSysMgr by
1.8.3.1