Falkon
Develop
Cross-platform Qt-based web browser
QjtMouseGesture.h
Go to the documentation of this file.
1
/*
2
* This file is part of the mouse gesture package.
3
* Copyright (C) 2006 Johan Thelin <e8johan@gmail.com>
4
* All rights reserved.
5
*
6
* Redistribution and use in source and binary forms, with or
7
* without modification, are permitted provided that the
8
* following conditions are met:
9
*
10
* - Redistributions of source code must retain the above
11
* copyright notice, this list of conditions and the
12
* following disclaimer.
13
* - Redistributions in binary form must reproduce the
14
* above copyright notice, this list of conditions and
15
* the following disclaimer in the documentation and/or
16
* other materials provided with the distribution.
17
* - The names of its contributors may be used to endorse
18
* or promote products derived from this software without
19
* specific prior written permission.
20
*
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
23
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGE.
35
*
36
*/
37
38
#ifndef QJTMOUSEGESTURE_H
39
#define QJTMOUSEGESTURE_H
40
41
#include <QObject>
42
#include <QList>
43
44
#include "
mousegesturerecognizer.h
"
45
46
class
GestureCallbackToSignal
;
47
48
/*
49
* A Direction can be any of the following:
50
*
51
* Up
52
* Down
53
* Left
54
* Right
55
* AnyHorizontal (Left or Right)
56
* AnyVertical (Up or Down)
57
* UpLeft (diagnonal)
58
* UpRight (diagnonal)
59
* DownLeft (diagnonal)
60
* DownRight (diagnonal)
61
*
62
* In addition to these, the NoMatch enum is
63
* available. A gesture holding only the NoMatch
64
* enum is gestured when no other gesture can be
65
* matched to the mouse gesture performed.
66
*/
67
typedef
Gesture::Direction
Direction
;
68
69
using
Gesture::Up
;
70
using
Gesture::Down
;
71
using
Gesture::Left
;
72
using
Gesture::Right
;
73
using
Gesture::AnyHorizontal
;
74
using
Gesture::AnyVertical
;
75
using
Gesture::UpLeft
;
76
using
Gesture::UpRight
;
77
using
Gesture::DownLeft
;
78
using
Gesture::DownRight
;
79
using
Gesture::NoMatch
;
80
81
/*
82
* A list of Directions
83
*/
84
typedef
QList<Direction>
DirectionList
;
85
86
/*
87
* A mouse gesture is a list of Directions that
88
* trigger the gestured signal. Create instances
89
* and add to a QjtMouseGestureFilter object.
90
*/
91
class
QjtMouseGesture
:
public
QObject
92
{
93
Q_OBJECT
94
public
:
95
QjtMouseGesture
(
const
DirectionList
&
directions
, QObject* parent =
nullptr
);
96
~QjtMouseGesture
();
97
98
const
DirectionList
directions
()
const
;
99
100
Q_SIGNALS:
101
void
gestured
();
102
103
private
:
104
friend
class
GestureCallbackToSignal
;
105
106
/*
107
* Emits the gestured signal.
108
*
109
* Required to connect this to the toolkit
110
* independent recognizer in a tidy way.
111
*/
112
void
emitGestured();
113
114
DirectionList
m_directions;
115
};
116
117
#endif
// QJTMOUSEGESTURE_H
Direction
Gesture::Direction Direction
Definition:
QjtMouseGesture.h:46
DirectionList
QList< Direction > DirectionList
Definition:
QjtMouseGesture.h:84
GestureCallbackToSignal
Definition:
QjtMouseGestureFilter.cpp:52
QjtMouseGesture
Definition:
QjtMouseGesture.h:92
QjtMouseGesture::~QjtMouseGesture
~QjtMouseGesture()
Definition:
QjtMouseGesture.cpp:45
QjtMouseGesture::gestured
void gestured()
QjtMouseGesture::directions
const DirectionList directions() const
Definition:
QjtMouseGesture.cpp:54
QjtMouseGesture::QjtMouseGesture
QjtMouseGesture(const DirectionList &directions, QObject *parent=nullptr)
Definition:
QjtMouseGesture.cpp:40
mousegesturerecognizer.h
Gesture::Direction
Direction
Definition:
mousegesturerecognizer.h:60
Gesture::Right
@ Right
Definition:
mousegesturerecognizer.h:60
Gesture::UpLeft
@ UpLeft
Definition:
mousegesturerecognizer.h:60
Gesture::Up
@ Up
Definition:
mousegesturerecognizer.h:60
Gesture::AnyVertical
@ AnyVertical
Definition:
mousegesturerecognizer.h:60
Gesture::Left
@ Left
Definition:
mousegesturerecognizer.h:60
Gesture::DownLeft
@ DownLeft
Definition:
mousegesturerecognizer.h:60
Gesture::NoMatch
@ NoMatch
Definition:
mousegesturerecognizer.h:60
Gesture::Down
@ Down
Definition:
mousegesturerecognizer.h:60
Gesture::AnyHorizontal
@ AnyHorizontal
Definition:
mousegesturerecognizer.h:60
Gesture::UpRight
@ UpRight
Definition:
mousegesturerecognizer.h:60
Gesture::DownRight
@ DownRight
Definition:
mousegesturerecognizer.h:60
src
plugins
MouseGestures
3rdparty
QjtMouseGesture.h
Generated by
1.9.3