blob: f388a0b4b01acd9e0753be7792cabcb8f692e7cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
/*
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this program; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef QtFlickProvider_h
#define QtFlickProvider_h
#include <QDeclarativeListProperty>
#include <QMetaMethod>
#include <QMetaProperty>
#include <QObject>
QT_BEGIN_NAMESPACE
class QPointF;
class QSizeF;
class QQuickItem;
class QQuickWebPage;
class QQuickWebView;
class QTouchEvent;
QT_END_NAMESPACE
class QtFlickProvider : public QObject {
Q_OBJECT
public:
QtFlickProvider(QQuickWebView* viewItem, QQuickWebPage* pageItem);
void handleTouchFlickEvent(QTouchEvent*);
QQuickItem* contentItem();
QDeclarativeListProperty<QObject> flickableData();
QPointF contentPos() const;
void setContentPos(const QPointF&);
QSizeF viewportSize() const;
void setViewportSize(const QSizeF&);
void returnToBounds();
void cancelFlick();
bool isMoving() const;
bool isDragging() const;
bool isFlicking() const;
qreal contentWidth() const;
void setContentWidth(qreal);
qreal contentHeight() const;
void setContentHeight(qreal);
qreal contentX() const;
void setContentX(qreal);
qreal contentY() const;
void setContentY(qreal);
Q_SIGNALS:
void contentWidthChanged();
void contentHeightChanged();
void contentXChanged();
void contentYChanged();
void movingChanged();
void flickingChanged();
void draggingChanged();
private:
QMetaMethod m_returnToBoundsMethod;
QMetaMethod m_cancelFlickMethod;
QMetaProperty m_contentWidth;
QMetaProperty m_contentHeight;
QMetaProperty m_contentX;
QMetaProperty m_contentY;
QMetaProperty m_moving;
QMetaProperty m_dragging;
QMetaProperty m_flicking;
QMetaProperty m_flickableData;
QQuickItem* m_contentItem;
QQuickItem* m_flickable;
};
#endif // QtFlickProvider_h
|