rhodes 5.5.0.3 → 5.5.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +20 -8
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +1 -2
- data/lib/commonAPI/coreapi/ext/system.xml +1 -1
- data/platform/android/build/android.rake +1 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +44 -3
- data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +4 -3
- data/platform/iphone/Classes/NativeView/RhoNativeViewManagerOC.h +1 -1
- data/platform/iphone/Classes/RhoMainView.h +8 -2
- data/platform/iphone/Classes/RhoUIWebView.h +75 -0
- data/platform/iphone/Classes/RhoUIWebView.m +142 -0
- data/platform/iphone/Classes/RhoWKWebView.h +87 -0
- data/platform/iphone/Classes/RhoWKWebView.m +187 -0
- data/platform/iphone/Classes/RhoWebView.h +72 -0
- data/platform/iphone/Classes/RhoWebViewFabrique.h +35 -0
- data/platform/iphone/Classes/RhoWebViewFabrique.m +87 -0
- data/platform/iphone/Classes/Rhodes.m +17 -6
- data/platform/iphone/Classes/Signature.old/SignatureDelegate.m +11 -4
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +3 -4
- data/platform/iphone/Classes/SimpleMainView.h +7 -5
- data/platform/iphone/Classes/SimpleMainView.m +174 -179
- data/platform/iphone/Classes/SplitView/RightViewController.h +2 -2
- data/platform/iphone/Classes/SplitView/RightViewController.m +9 -10
- data/platform/iphone/Classes/SplitView/SplittedMainView.h +2 -3
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +10 -7
- data/platform/iphone/Classes/TabbedMainView.h +2 -1
- data/platform/iphone/Classes/TabbedMainView.m +13 -10
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -5
- data/platform/iphone/Classes/WebView.m +1 -1
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +40 -3
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
- data/platform/iphone/rbuild/iphone.rake +51 -0
- data/platform/shared/common/RhoNativeViewManager.h +9 -9
- data/platform/shared/common/RhodesApp.cpp +13 -1
- data/platform/shared/net/HttpServer.cpp +12 -2
- data/platform/shared/qt/rhodes/ExternalWebView.ui +11 -2
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +9 -7
- data/platform/shared/qt/rhodes/QtMainWindow.ui +13 -4
- data/platform/shared/qt/rhodes/qkineticscroller.cpp +1245 -0
- data/platform/shared/qt/rhodes/qkineticscroller.h +165 -0
- data/platform/shared/qt/rhodes/qkineticscroller_p.h +168 -0
- data/platform/shared/qt/rhodes/qtflickgesture.cpp +696 -0
- data/platform/shared/qt/rhodes/qtflickgesture_p.h +107 -0
- data/platform/shared/qt/rhodes/qtscroller.cpp +2080 -0
- data/platform/shared/qt/rhodes/qtscroller.h +138 -0
- data/platform/shared/qt/rhodes/qtscroller_p.h +205 -0
- data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +350 -0
- data/platform/shared/qt/rhodes/qtscrollerfilter_p.h +110 -0
- data/platform/shared/qt/rhodes/qtscrollerproperties.cpp +412 -0
- data/platform/shared/qt/rhodes/qtscrollerproperties.h +135 -0
- data/platform/shared/qt/rhodes/qtscrollerproperties_p.h +90 -0
- data/platform/shared/qt/rhodes/qtscrollevent.cpp +190 -0
- data/platform/shared/qt/rhodes/qtscrollevent.h +100 -0
- data/platform/shared/qt/rhodes/qtscrollevent_p.h +33 -0
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +347 -0
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +90 -0
- data/platform/shared/qt/rhodes/qwebviewselectionsuppressor.h +113 -0
- data/platform/shared/qt/rhodes/rhodes.pro +19 -0
- data/res/generators/rhogen.rb +307 -15
- data/res/generators/templates/application/app/Settings/err_sync.erb +12 -6
- data/res/generators/templates/application/app/Settings/home.erb +32 -17
- data/res/generators/templates/application/app/Settings/index.erb +55 -26
- data/res/generators/templates/application/app/Settings/javascript_index.html +111 -0
- data/res/generators/templates/application/app/Settings/javascript_login.html +65 -0
- data/res/generators/templates/application/app/Settings/login.erb +25 -19
- data/res/generators/templates/application/app/Settings/reset.erb +18 -9
- data/res/generators/templates/application/app/Settings/wait.erb +10 -7
- data/res/generators/templates/application/app/index.erb +32 -20
- data/res/generators/templates/application/app/javascript_index.html +66 -0
- data/res/generators/templates/application/app/javascript_index.js +250 -0
- data/res/generators/templates/application/app/layout.erb +12 -67
- data/res/generators/templates/application/javascript_build.yml +41 -0
- data/res/generators/templates/application/javascript_rhoconfig.txt +123 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.css +587 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.min.css +6 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap-theme.min.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.css +6757 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.min.css +6 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/css/bootstrap.min.css.map +1 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.eot +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.svg +288 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/js/bootstrap.js +2377 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/js/bootstrap.min.js +7 -0
- data/res/generators/templates/application/public/bootstrap-3.3.7/js/npm.js +13 -0
- data/res/generators/templates/application/public/css/style.css +3 -0
- data/res/generators/templates/application/public/jquery/jquery-3.1.1.min.js +4 -0
- data/res/generators/templates/application/public/jquery/jquery-3.1.1.min.map +1 -0
- data/res/generators/templates/application/rhoconfig.txt +16 -0
- data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +4 -0
- data/res/generators/templates/model/edit.erb +22 -21
- data/res/generators/templates/model/index.erb +24 -22
- data/res/generators/templates/model/javascript_edit.html +65 -0
- data/res/generators/templates/model/javascript_index.html +56 -0
- data/res/generators/templates/model/javascript_index.js +83 -0
- data/res/generators/templates/model/javascript_model.js +16 -0
- data/res/generators/templates/model/javascript_new.html +64 -0
- data/res/generators/templates/model/javascript_show.html +66 -0
- data/res/generators/templates/model/new.erb +22 -19
- data/res/generators/templates/model/show.erb +22 -14
- data/res/prebuild_base_app/app/index.erb +31 -18
- data/res/prebuild_base_app/app/layout.erb +11 -56
- data/version +1 -1
- metadata +59 -24
- data/res/generators/templates/application/public/css/android.css +0 -418
- data/res/generators/templates/application/public/css/iphone.css +0 -378
- data/res/generators/templates/application/public/css/jqmobile-patch.css +0 -62
- data/res/generators/templates/application/public/css/re_webkit.css +0 -736
- data/res/generators/templates/application/public/css/re_webkit_flat.css +0 -753
- data/res/generators/templates/application/public/css/windows_mobile.css +0 -327
- data/res/generators/templates/application/public/jqmobile/images/ajax-loader.gif +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.css +0 -3
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.js +0 -10
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.4.5.min.map +0 -1
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.4.5.min.css +0 -3
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.theme-1.4.5.min.css +0 -3
- data/res/generators/templates/application/public/jquery/jquery-1.9.1.min.js +0 -5
- data/res/generators/templates/application/public/jquery/jquery-1.9.1.min.map +0 -1
- data/res/generators/templates/application/public/js/application.js +0 -1
- data/res/generators/templates/application/public/js/jqmobile-patch.js +0 -466
- data/res/generators/templates/application/public/js/syncengine.js +0 -504
@@ -0,0 +1,110 @@
|
|
1
|
+
/****************************************************************************
|
2
|
+
**
|
3
|
+
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
** All rights reserved.
|
5
|
+
** Contact: Nokia Corporation (qt-info@nokia.com)
|
6
|
+
**
|
7
|
+
** This file is part of the QtGui module of the Qt Toolkit.
|
8
|
+
**
|
9
|
+
** $QT_BEGIN_LICENSE:LGPL$
|
10
|
+
** No Commercial Usage
|
11
|
+
** This file contains pre-release code and may not be distributed.
|
12
|
+
** You may use this file in accordance with the terms and conditions
|
13
|
+
** contained in the Technology Preview License Agreement accompanying
|
14
|
+
** this package.
|
15
|
+
**
|
16
|
+
** GNU Lesser General Public License Usage
|
17
|
+
** Alternatively, this file may be used under the terms of the GNU Lesser
|
18
|
+
** General Public License version 2.1 as published by the Free Software
|
19
|
+
** Foundation and appearing in the file LICENSE.LGPL included in the
|
20
|
+
** packaging of this file. Please review the following information to
|
21
|
+
** ensure the GNU Lesser General Public License version 2.1 requirements
|
22
|
+
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
23
|
+
**
|
24
|
+
** In addition, as a special exception, Nokia gives you certain additional
|
25
|
+
** rights. These rights are described in the Nokia Qt LGPL Exception
|
26
|
+
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
27
|
+
**
|
28
|
+
** If you have questions regarding the use of this file, please contact
|
29
|
+
** Nokia at qt-info@nokia.com.
|
30
|
+
**
|
31
|
+
**
|
32
|
+
**
|
33
|
+
**
|
34
|
+
**
|
35
|
+
**
|
36
|
+
**
|
37
|
+
**
|
38
|
+
** $QT_END_LICENSE$
|
39
|
+
**
|
40
|
+
****************************************************************************/
|
41
|
+
|
42
|
+
#ifndef QTSCROLLERFILTER_P_H
|
43
|
+
#define QTSCROLLERFILTER_P_H
|
44
|
+
|
45
|
+
//
|
46
|
+
// W A R N I N G
|
47
|
+
// -------------
|
48
|
+
//
|
49
|
+
// This file is not part of the Qt API. It exists for the convenience
|
50
|
+
// of other Qt classes. This header file may change from version to
|
51
|
+
// version without notice, or even be removed.
|
52
|
+
//
|
53
|
+
// We mean it.
|
54
|
+
//
|
55
|
+
|
56
|
+
#include <QObject>
|
57
|
+
#include <QItemSelection>
|
58
|
+
#include <QMap>
|
59
|
+
#include <QPoint>
|
60
|
+
#include "qtscroller.h"
|
61
|
+
|
62
|
+
class QAbstractScrollArea;
|
63
|
+
class QAbstractItemView;
|
64
|
+
class QWebView;
|
65
|
+
class QWebFrame;
|
66
|
+
|
67
|
+
class QtScrollerFilter : public QObject {
|
68
|
+
Q_OBJECT
|
69
|
+
|
70
|
+
public:
|
71
|
+
static QtScrollerFilter *instance();
|
72
|
+
|
73
|
+
void add(QObject *);
|
74
|
+
void remove(QObject *);
|
75
|
+
|
76
|
+
protected:
|
77
|
+
QtScrollerFilter();
|
78
|
+
|
79
|
+
bool eventFilter(QObject *o, QEvent *e);
|
80
|
+
|
81
|
+
#ifndef QTSCROLLER_NO_WEBKIT
|
82
|
+
//+++ QWebView
|
83
|
+
bool eventFilter_QWebView(QWebView *web, QEvent *event);
|
84
|
+
QWebFrame *scrollingFrameAt_QWebView(QWebView *web, const QPoint &pos) const;
|
85
|
+
//WebCore::VisibleSelection oldWebSelection;
|
86
|
+
QMap<QWebView *, QWebFrame *> scrollingFrames;
|
87
|
+
#endif
|
88
|
+
|
89
|
+
//+++ QAbstractScrollArea
|
90
|
+
bool eventFilter_QAbstractScrollArea(QAbstractScrollArea *area, QEvent *event);
|
91
|
+
bool canStartScrollingAt_QAbstractScrollArea(QAbstractScrollArea *area, const QPoint &pos) const;
|
92
|
+
QMap<QAbstractScrollArea *, QPoint> overshoot;
|
93
|
+
bool ignoreMove;
|
94
|
+
|
95
|
+
//+++ QAbstractItemView
|
96
|
+
bool eventFilter_QAbstractItemView(QAbstractItemView *view, QEvent *event);
|
97
|
+
void stateChanged_QAbstractItemView(QAbstractItemView *view, QtScroller::State state);
|
98
|
+
|
99
|
+
// the selection before the last mouse down. In case we have to restore it for scrolling
|
100
|
+
QItemSelection oldSelection;
|
101
|
+
QModelIndex oldCurrent;
|
102
|
+
|
103
|
+
protected slots:
|
104
|
+
void stateChanged(QtScroller::State state);
|
105
|
+
|
106
|
+
private:
|
107
|
+
static QtScrollerFilter *inst;
|
108
|
+
};
|
109
|
+
|
110
|
+
#endif // QTSCROLLERFILTER_P_H
|
@@ -0,0 +1,412 @@
|
|
1
|
+
/****************************************************************************
|
2
|
+
**
|
3
|
+
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
** All rights reserved.
|
5
|
+
** Contact: Nokia Corporation (qt-info@nokia.com)
|
6
|
+
**
|
7
|
+
** This file is part of the QtGui module of the Qt Toolkit.
|
8
|
+
**
|
9
|
+
** $QT_BEGIN_LICENSE:LGPL$
|
10
|
+
** No Commercial Usage
|
11
|
+
** This file contains pre-release code and may not be distributed.
|
12
|
+
** You may use this file in accordance with the terms and conditions
|
13
|
+
** contained in the Technology Preview License Agreement accompanying
|
14
|
+
** this package.
|
15
|
+
**
|
16
|
+
** GNU Lesser General Public License Usage
|
17
|
+
** Alternatively, this file may be used under the terms of the GNU Lesser
|
18
|
+
** General Public License version 2.1 as published by the Free Software
|
19
|
+
** Foundation and appearing in the file LICENSE.LGPL included in the
|
20
|
+
** packaging of this file. Please review the following information to
|
21
|
+
** ensure the GNU Lesser General Public License version 2.1 requirements
|
22
|
+
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
23
|
+
**
|
24
|
+
** In addition, as a special exception, Nokia gives you certain additional
|
25
|
+
** rights. These rights are described in the Nokia Qt LGPL Exception
|
26
|
+
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
27
|
+
**
|
28
|
+
** If you have questions regarding the use of this file, please contact
|
29
|
+
** Nokia at qt-info@nokia.com.
|
30
|
+
**
|
31
|
+
**
|
32
|
+
**
|
33
|
+
**
|
34
|
+
**
|
35
|
+
**
|
36
|
+
**
|
37
|
+
**
|
38
|
+
** $QT_END_LICENSE$
|
39
|
+
**
|
40
|
+
****************************************************************************/
|
41
|
+
|
42
|
+
#include <QPointer>
|
43
|
+
#include <QObject>
|
44
|
+
#include <QtCore/qmath.h>
|
45
|
+
|
46
|
+
#ifdef Q_WS_WIN
|
47
|
+
# include <QLibrary>
|
48
|
+
#endif
|
49
|
+
|
50
|
+
#include "qtscrollerproperties.h"
|
51
|
+
#include "qtscrollerproperties_p.h"
|
52
|
+
|
53
|
+
static QtScrollerPropertiesPrivate *userDefaults = 0;
|
54
|
+
static QtScrollerPropertiesPrivate *systemDefaults = 0;
|
55
|
+
|
56
|
+
QtScrollerPropertiesPrivate *QtScrollerPropertiesPrivate::defaults()
|
57
|
+
{
|
58
|
+
if (!systemDefaults) {
|
59
|
+
QtScrollerPropertiesPrivate spp;
|
60
|
+
#ifdef Q_WS_MAEMO_5
|
61
|
+
spp.mousePressEventDelay = qreal(0);
|
62
|
+
spp.dragStartDistance = qreal(2.5 / 1000);
|
63
|
+
spp.dragVelocitySmoothingFactor = qreal(0.85);
|
64
|
+
spp.axisLockThreshold = qreal(0);
|
65
|
+
spp.scrollingCurve.setType(QEasingCurve::OutQuad);
|
66
|
+
spp.decelerationFactor = 1.0;
|
67
|
+
spp.minimumVelocity = qreal(0.0195);
|
68
|
+
spp.maximumVelocity = qreal(6.84);
|
69
|
+
spp.maximumClickThroughVelocity = qreal(0.0684);
|
70
|
+
spp.acceleratingFlickMaximumTime = qreal(0.125);
|
71
|
+
spp.acceleratingFlickSpeedupFactor = qreal(3.0);
|
72
|
+
spp.snapPositionRatio = qreal(0.25);
|
73
|
+
spp.snapTime = qreal(1);
|
74
|
+
spp.overshootDragResistanceFactor = qreal(1);
|
75
|
+
spp.overshootDragDistanceFactor = qreal(0.3);
|
76
|
+
spp.overshootScrollDistanceFactor = qreal(0.3);
|
77
|
+
spp.overshootScrollTime = qreal(0.5);
|
78
|
+
spp.hOvershootPolicy = QtScrollerProperties::OvershootWhenScrollable;
|
79
|
+
spp.vOvershootPolicy = QtScrollerProperties::OvershootWhenScrollable;
|
80
|
+
spp.frameRate = QtScrollerProperties::Fps30;
|
81
|
+
#else
|
82
|
+
spp.mousePressEventDelay = qreal(0.25);
|
83
|
+
spp.dragStartDistance = qreal(5.0 / 1000);
|
84
|
+
spp.dragVelocitySmoothingFactor = qreal(0.8);
|
85
|
+
spp.axisLockThreshold = qreal(0);
|
86
|
+
spp.scrollingCurve.setType(QEasingCurve::OutQuad);
|
87
|
+
spp.decelerationFactor = qreal(0.125);
|
88
|
+
spp.minimumVelocity = qreal(50.0 / 1000);
|
89
|
+
spp.maximumVelocity = qreal(500.0 / 1000);
|
90
|
+
spp.maximumClickThroughVelocity = qreal(66.5 / 1000);
|
91
|
+
spp.acceleratingFlickMaximumTime = qreal(1.25);
|
92
|
+
spp.acceleratingFlickSpeedupFactor = qreal(3.0);
|
93
|
+
spp.snapPositionRatio = qreal(0.5);
|
94
|
+
spp.snapTime = qreal(0.3);
|
95
|
+
spp.overshootDragResistanceFactor = qreal(0.5);
|
96
|
+
spp.overshootDragDistanceFactor = qreal(1);
|
97
|
+
spp.overshootScrollDistanceFactor = qreal(0.5);
|
98
|
+
spp.overshootScrollTime = qreal(0.7);
|
99
|
+
# ifdef Q_WS_WIN
|
100
|
+
if (QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback"))
|
101
|
+
spp.overshootScrollTime = qreal(0.35);
|
102
|
+
# endif
|
103
|
+
spp.hOvershootPolicy = QtScrollerProperties::OvershootWhenScrollable;
|
104
|
+
spp.vOvershootPolicy = QtScrollerProperties::OvershootWhenScrollable;
|
105
|
+
spp.frameRate = QtScrollerProperties::Standard;
|
106
|
+
#endif
|
107
|
+
systemDefaults = new QtScrollerPropertiesPrivate(spp);
|
108
|
+
}
|
109
|
+
return new QtScrollerPropertiesPrivate(userDefaults ? *userDefaults : *systemDefaults);
|
110
|
+
}
|
111
|
+
|
112
|
+
/*!
|
113
|
+
\class QtScrollerProperties
|
114
|
+
\brief The QtScrollerProperties class stores the settings for a QtScroller.
|
115
|
+
\since 4.8
|
116
|
+
|
117
|
+
The QtScrollerProperties class stores the parameters used by QtScroller.
|
118
|
+
|
119
|
+
The default settings are platform dependent so that Qt emulates the
|
120
|
+
platform behaviour for kinetic scrolling.
|
121
|
+
|
122
|
+
As a convention the QtScrollerProperties are in physical units (meter,
|
123
|
+
seconds) and are converted by QtScroller using the current DPI.
|
124
|
+
|
125
|
+
\sa QtScroller
|
126
|
+
*/
|
127
|
+
|
128
|
+
/*!
|
129
|
+
Constructs new scroller properties.
|
130
|
+
*/
|
131
|
+
QtScrollerProperties::QtScrollerProperties()
|
132
|
+
: d(QtScrollerPropertiesPrivate::defaults())
|
133
|
+
{
|
134
|
+
}
|
135
|
+
|
136
|
+
/*!
|
137
|
+
Constructs a copy of \a sp.
|
138
|
+
*/
|
139
|
+
QtScrollerProperties::QtScrollerProperties(const QtScrollerProperties &sp)
|
140
|
+
: d(new QtScrollerPropertiesPrivate(*sp.d))
|
141
|
+
{
|
142
|
+
}
|
143
|
+
|
144
|
+
/*!
|
145
|
+
Assigns \a sp to these scroller properties and returns a reference to these scroller properties.
|
146
|
+
*/
|
147
|
+
QtScrollerProperties &QtScrollerProperties::operator=(const QtScrollerProperties &sp)
|
148
|
+
{
|
149
|
+
*d.data() = *sp.d.data();
|
150
|
+
return *this;
|
151
|
+
}
|
152
|
+
|
153
|
+
/*!
|
154
|
+
Destroys the scroller properties.
|
155
|
+
*/
|
156
|
+
QtScrollerProperties::~QtScrollerProperties()
|
157
|
+
{
|
158
|
+
}
|
159
|
+
|
160
|
+
/*!
|
161
|
+
Returns true if these scroller properties are equal to \a sp; otherwise returns false.
|
162
|
+
*/
|
163
|
+
bool QtScrollerProperties::operator==(const QtScrollerProperties &sp) const
|
164
|
+
{
|
165
|
+
return *d.data() == *sp.d.data();
|
166
|
+
}
|
167
|
+
|
168
|
+
/*!
|
169
|
+
Returns true if these scroller properties are different from \a sp; otherwise returns false.
|
170
|
+
*/
|
171
|
+
bool QtScrollerProperties::operator!=(const QtScrollerProperties &sp) const
|
172
|
+
{
|
173
|
+
return !(*d.data() == *sp.d.data());
|
174
|
+
}
|
175
|
+
|
176
|
+
bool QtScrollerPropertiesPrivate::operator==(const QtScrollerPropertiesPrivate &p) const
|
177
|
+
{
|
178
|
+
bool same = true;
|
179
|
+
same &= (mousePressEventDelay == p.mousePressEventDelay);
|
180
|
+
same &= (dragStartDistance == p.dragStartDistance);
|
181
|
+
same &= (dragVelocitySmoothingFactor == p.dragVelocitySmoothingFactor);
|
182
|
+
same &= (axisLockThreshold == p.axisLockThreshold);
|
183
|
+
same &= (scrollingCurve == p.scrollingCurve);
|
184
|
+
same &= (decelerationFactor == p.decelerationFactor);
|
185
|
+
same &= (minimumVelocity == p.minimumVelocity);
|
186
|
+
same &= (maximumVelocity == p.maximumVelocity);
|
187
|
+
same &= (maximumClickThroughVelocity == p.maximumClickThroughVelocity);
|
188
|
+
same &= (acceleratingFlickMaximumTime == p.acceleratingFlickMaximumTime);
|
189
|
+
same &= (acceleratingFlickSpeedupFactor == p.acceleratingFlickSpeedupFactor);
|
190
|
+
same &= (snapPositionRatio == p.snapPositionRatio);
|
191
|
+
same &= (snapTime == p.snapTime);
|
192
|
+
same &= (overshootDragResistanceFactor == p.overshootDragResistanceFactor);
|
193
|
+
same &= (overshootDragDistanceFactor == p.overshootDragDistanceFactor);
|
194
|
+
same &= (overshootScrollDistanceFactor == p.overshootScrollDistanceFactor);
|
195
|
+
same &= (overshootScrollTime == p.overshootScrollTime);
|
196
|
+
same &= (hOvershootPolicy == p.hOvershootPolicy);
|
197
|
+
same &= (vOvershootPolicy == p.vOvershootPolicy);
|
198
|
+
same &= (frameRate == p.frameRate);
|
199
|
+
return same;
|
200
|
+
}
|
201
|
+
|
202
|
+
/*!
|
203
|
+
Sets the scroller properties for all new QtScrollerProperties objects to \a sp.
|
204
|
+
|
205
|
+
Use this function to override the platform default properties returned by the default
|
206
|
+
constructor. If you only want to change the scroller properties of a single scroller, use
|
207
|
+
QtScroller::setScrollerProperties()
|
208
|
+
|
209
|
+
\note Calling this function will not change the content of already existing
|
210
|
+
QtScrollerProperties objects.
|
211
|
+
|
212
|
+
\sa unsetDefaultScrollerProperties()
|
213
|
+
*/
|
214
|
+
void QtScrollerProperties::setDefaultScrollerProperties(const QtScrollerProperties &sp)
|
215
|
+
{
|
216
|
+
if (!userDefaults)
|
217
|
+
userDefaults = new QtScrollerPropertiesPrivate(*sp.d);
|
218
|
+
else
|
219
|
+
*userDefaults = *sp.d;
|
220
|
+
}
|
221
|
+
|
222
|
+
/*!
|
223
|
+
Sets the scroller properties returned by the default constructor back to the platform default
|
224
|
+
properties.
|
225
|
+
|
226
|
+
\sa setDefaultScrollerProperties()
|
227
|
+
*/
|
228
|
+
void QtScrollerProperties::unsetDefaultScrollerProperties()
|
229
|
+
{
|
230
|
+
delete userDefaults;
|
231
|
+
userDefaults = 0;
|
232
|
+
}
|
233
|
+
|
234
|
+
/*!
|
235
|
+
Query the \a metric value of the scroller properties.
|
236
|
+
|
237
|
+
\sa setScrollMetric(), ScrollMetric
|
238
|
+
*/
|
239
|
+
QVariant QtScrollerProperties::scrollMetric(ScrollMetric metric) const
|
240
|
+
{
|
241
|
+
switch (metric) {
|
242
|
+
case MousePressEventDelay: return d->mousePressEventDelay;
|
243
|
+
case DragStartDistance: return d->dragStartDistance;
|
244
|
+
case DragVelocitySmoothingFactor: return d->dragVelocitySmoothingFactor;
|
245
|
+
case AxisLockThreshold: return d->axisLockThreshold;
|
246
|
+
case ScrollingCurve: return QVariant::fromValue(d->scrollingCurve);
|
247
|
+
case DecelerationFactor: return d->decelerationFactor;
|
248
|
+
case MinimumVelocity: return d->minimumVelocity;
|
249
|
+
case MaximumVelocity: return d->maximumVelocity;
|
250
|
+
case MaximumClickThroughVelocity: return d->maximumClickThroughVelocity;
|
251
|
+
case AcceleratingFlickMaximumTime: return d->acceleratingFlickMaximumTime;
|
252
|
+
case AcceleratingFlickSpeedupFactor:return d->acceleratingFlickSpeedupFactor;
|
253
|
+
case SnapPositionRatio: return d->snapPositionRatio;
|
254
|
+
case SnapTime: return d->snapTime;
|
255
|
+
case OvershootDragResistanceFactor: return d->overshootDragResistanceFactor;
|
256
|
+
case OvershootDragDistanceFactor: return d->overshootDragDistanceFactor;
|
257
|
+
case OvershootScrollDistanceFactor: return d->overshootScrollDistanceFactor;
|
258
|
+
case OvershootScrollTime: return d->overshootScrollTime;
|
259
|
+
case HorizontalOvershootPolicy: return QVariant::fromValue(d->hOvershootPolicy);
|
260
|
+
case VerticalOvershootPolicy: return QVariant::fromValue(d->vOvershootPolicy);
|
261
|
+
case FrameRate: return QVariant::fromValue(d->frameRate);
|
262
|
+
case ScrollMetricCount: break;
|
263
|
+
}
|
264
|
+
return QVariant();
|
265
|
+
}
|
266
|
+
|
267
|
+
/*!
|
268
|
+
Set a specific value of the \a metric ScrollerMetric to \a value.
|
269
|
+
|
270
|
+
\sa scrollMetric(), ScrollMetric
|
271
|
+
*/
|
272
|
+
void QtScrollerProperties::setScrollMetric(ScrollMetric metric, const QVariant &value)
|
273
|
+
{
|
274
|
+
switch (metric) {
|
275
|
+
case MousePressEventDelay: d->mousePressEventDelay = value.toReal(); break;
|
276
|
+
case DragStartDistance: d->dragStartDistance = value.toReal(); break;
|
277
|
+
case DragVelocitySmoothingFactor: d->dragVelocitySmoothingFactor = qBound(qreal(0), value.toReal(), qreal(1)); break;
|
278
|
+
case AxisLockThreshold: d->axisLockThreshold = qBound(qreal(0), value.toReal(), qreal(1)); break;
|
279
|
+
case ScrollingCurve: d->scrollingCurve = value.value<QEasingCurve>(); break;
|
280
|
+
case DecelerationFactor: d->decelerationFactor = value.toReal(); break;
|
281
|
+
case MinimumVelocity: d->minimumVelocity = value.toReal(); break;
|
282
|
+
case MaximumVelocity: d->maximumVelocity = value.toReal(); break;
|
283
|
+
case MaximumClickThroughVelocity: d->maximumClickThroughVelocity = value.toReal(); break;
|
284
|
+
case AcceleratingFlickMaximumTime: d->acceleratingFlickMaximumTime = value.toReal(); break;
|
285
|
+
case AcceleratingFlickSpeedupFactor:d->acceleratingFlickSpeedupFactor = value.toReal(); break;
|
286
|
+
case SnapPositionRatio: d->snapPositionRatio = qBound(qreal(0), value.toReal(), qreal(1)); break;
|
287
|
+
case SnapTime: d->snapTime = value.toReal(); break;
|
288
|
+
case OvershootDragResistanceFactor: d->overshootDragResistanceFactor = value.toReal(); break;
|
289
|
+
case OvershootDragDistanceFactor: d->overshootDragDistanceFactor = qBound(qreal(0), value.toReal(), qreal(1)); break;
|
290
|
+
case OvershootScrollDistanceFactor: d->overshootScrollDistanceFactor = qBound(qreal(0), value.toReal(), qreal(1)); break;
|
291
|
+
case OvershootScrollTime: d->overshootScrollTime = value.toReal(); break;
|
292
|
+
case HorizontalOvershootPolicy: d->hOvershootPolicy = value.value<QtScrollerProperties::OvershootPolicy>(); break;
|
293
|
+
case VerticalOvershootPolicy: d->vOvershootPolicy = value.value<QtScrollerProperties::OvershootPolicy>(); break;
|
294
|
+
case FrameRate: d->frameRate = value.value<QtScrollerProperties::FrameRates>(); break;
|
295
|
+
case ScrollMetricCount: break;
|
296
|
+
}
|
297
|
+
}
|
298
|
+
|
299
|
+
/*!
|
300
|
+
\enum QtScrollerProperties::FrameRates
|
301
|
+
|
302
|
+
This enum describes the available frame rates used while dragging or scrolling.
|
303
|
+
|
304
|
+
\value Fps60 60 frames per second
|
305
|
+
\value Fps30 30 frames per second
|
306
|
+
\value Fps20 20 frames per second
|
307
|
+
\value Standard the default value is 60 frames per second (which corresponds to QAbstractAnimation).
|
308
|
+
*/
|
309
|
+
|
310
|
+
/*!
|
311
|
+
\enum QtScrollerProperties::OvershootPolicy
|
312
|
+
|
313
|
+
This enum describes the various modes of overshooting.
|
314
|
+
|
315
|
+
\value OvershootWhenScrollable Overshooting is possible when the content is scrollable. This is the
|
316
|
+
default.
|
317
|
+
|
318
|
+
\value OvershootAlwaysOff Overshooting is never enabled, even when the content is scrollable.
|
319
|
+
|
320
|
+
\value OvershootAlwaysOn Overshooting is always enabled, even when the content is not
|
321
|
+
scrollable.
|
322
|
+
*/
|
323
|
+
|
324
|
+
/*!
|
325
|
+
\enum QtScrollerProperties::ScrollMetric
|
326
|
+
|
327
|
+
This enum contains the different scroll metric types. When not indicated otherwise the
|
328
|
+
setScrollMetric function expects a QVariant of type qreal.
|
329
|
+
|
330
|
+
See the QtScroller documentation for further details of the concepts behind the different
|
331
|
+
values.
|
332
|
+
|
333
|
+
\value MousePressEventDelay This is the time a mouse press event is delayed when starting
|
334
|
+
a flick gesture in \c{[s]}. If the gesture is triggered within that time, no mouse press or
|
335
|
+
release is sent to the scrolled object. If it triggers after that delay the delayed
|
336
|
+
mouse press plus a faked release event at global postion \c{QPoint(-QWIDGETSIZE_MAX,
|
337
|
+
-QWIDGETSIZE_MAX)} is sent. If the gesture is canceled, then both the delayed mouse
|
338
|
+
press plus the real release event are delivered.
|
339
|
+
|
340
|
+
\value DragStartDistance This is the minimum distance the touch or mouse point needs to be
|
341
|
+
moved before the flick gesture is triggered in \c m.
|
342
|
+
|
343
|
+
\value DragVelocitySmoothingFactor A value that describes to which extent new drag velocities are
|
344
|
+
included in the final scrolling velocity. This value should be in the range between \c 0 and
|
345
|
+
\c 1. The lower the value, the more smoothing is applied to the dragging velocity.
|
346
|
+
|
347
|
+
\value AxisLockThreshold Restricts the movement to one axis if the movement is inside an angle
|
348
|
+
around the axis. The threshold must be in the range \c 0 to \c 1.
|
349
|
+
|
350
|
+
\value ScrollingCurve The QEasingCurve used when decelerating the scrolling velocity after an
|
351
|
+
user initiated flick. Please note that this is the easing curve for the positions, \bold{not}
|
352
|
+
the velocity: the default is QEasingCurve::OutQuad, which results in a linear decrease in
|
353
|
+
velocity (1st derivative) and a constant deceleration (2nd derivative).
|
354
|
+
|
355
|
+
\value DecelerationFactor This factor influences how long it takes the scroller to decelerate
|
356
|
+
to 0 velocity. The actual value depends on the chosen ScrollingCurve. For most
|
357
|
+
types the value should be in the range from \c 0.1 to \c 2.0
|
358
|
+
|
359
|
+
\value MinimumVelocity The minimum velocity that is needed after ending the touch or releasing
|
360
|
+
the mouse to start scrolling in \c{m/s}.
|
361
|
+
|
362
|
+
\value MaximumVelocity This is the maximum velocity that can be reached in \c{m/s}.
|
363
|
+
|
364
|
+
\value MaximumClickThroughVelocity This is the maximum allowed scroll speed for a click-through
|
365
|
+
in \c{m/s}. This means that a click on a currently (slowly) scrolling object will not only stop
|
366
|
+
the scrolling but the click event will also be delivered to the UI control. This is
|
367
|
+
useful when using exponential-type scrolling curves.
|
368
|
+
|
369
|
+
\value AcceleratingFlickMaximumTime This is the maximum time in \c seconds that a flick gesture
|
370
|
+
can take to be recognized as an accelerating flick. If set to zero no such gesture is
|
371
|
+
detected. An "accelerating flick" is a flick gesture executed on an already scrolling object.
|
372
|
+
In such cases the scrolling speed is multiplied by AcceleratingFlickSpeedupFactor in order to
|
373
|
+
accelerate it.
|
374
|
+
|
375
|
+
\value AcceleratingFlickSpeedupFactor The current speed is multiplied by this number if an
|
376
|
+
accelerating flick is detected. Should be \c{>= 1}.
|
377
|
+
|
378
|
+
\value SnapPositionRatio This is the distance that the user must drag the area beween two snap
|
379
|
+
points in order to snap it to the next position. \c{0.33} means that the scroll must only
|
380
|
+
reach one third of the distance between two snap points to snap to the next one. The ratio must
|
381
|
+
be between \c 0 and \c 1.
|
382
|
+
|
383
|
+
\value SnapTime This is the time factor for the scrolling curve. A lower value means that the
|
384
|
+
scrolling will take longer. The scrolling distance is independet of this value.
|
385
|
+
|
386
|
+
\value OvershootDragResistanceFactor This value is the factor between the mouse dragging and
|
387
|
+
the actual scroll area movement (during overshoot). The factor must be between \c 0 and \c 1.
|
388
|
+
|
389
|
+
\value OvershootDragDistanceFactor This is the maximum distance for overshoot movements while
|
390
|
+
dragging. The actual overshoot distance is calculated by multiplying this value with the
|
391
|
+
viewport size of the scrolled object. The factor must be between \c 0 and \c 1.
|
392
|
+
|
393
|
+
\value OvershootScrollDistanceFactor This is the maximum distance for overshoot movements while
|
394
|
+
scrolling. The actual overshoot distance is calculated by multiplying this value with the
|
395
|
+
viewport size of the scrolled object. The factor must be between \c 0 and \c 1.
|
396
|
+
|
397
|
+
\value OvershootScrollTime This is the time in \c seconds that is used to play the
|
398
|
+
complete overshoot animation.
|
399
|
+
|
400
|
+
\value HorizontalOvershootPolicy This is the horizontal overshooting policy (see OvershootPolicy).
|
401
|
+
|
402
|
+
\value VerticalOvershootPolicy This is the horizontal overshooting policy (see OvershootPolicy).
|
403
|
+
|
404
|
+
\value FrameRate This is the frame rate which should be used while dragging or scrolling.
|
405
|
+
QtScroller uses a QAbstractAnimation timer internally to sync all scrolling operations to other
|
406
|
+
animations that might be active at the same time. If the standard value of 60 frames per
|
407
|
+
second is too fast, it can be lowered with this setting,
|
408
|
+
while still being in-sync with QAbstractAnimation. Please note that only the values of the
|
409
|
+
FrameRates enum are allowed here.
|
410
|
+
|
411
|
+
\value ScrollMetricCount This is always the last entry.
|
412
|
+
*/
|