1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Quick Controls module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#ifndef QQUICKWHEELAREA_P_H
41#define QQUICKWHEELAREA_P_H
42
43#include <QtGui/qevent.h>
44#include <QtQuick/qquickitem.h>
45
46QT_BEGIN_NAMESPACE
47
48class QQuickWheelArea1 : public QQuickItem
49{
50 Q_OBJECT
51 Q_PROPERTY(qreal verticalDelta READ verticalDelta WRITE setVerticalDelta NOTIFY verticalWheelMoved)
52 Q_PROPERTY(qreal horizontalDelta READ horizontalDelta WRITE setHorizontalDelta NOTIFY horizontalWheelMoved)
53 Q_PROPERTY(qreal horizontalMinimumValue READ horizontalMinimumValue WRITE setHorizontalMinimumValue NOTIFY horizontalMinimumValueChanged)
54 Q_PROPERTY(qreal horizontalMaximumValue READ horizontalMaximumValue WRITE setHorizontalMaximumValue NOTIFY horizontalMaximumValueChanged)
55 Q_PROPERTY(qreal verticalMinimumValue READ verticalMinimumValue WRITE setVerticalMinimumValue NOTIFY verticalMinimumValueChanged)
56 Q_PROPERTY(qreal verticalMaximumValue READ verticalMaximumValue WRITE setVerticalMaximumValue NOTIFY verticalMaximumValueChanged)
57 Q_PROPERTY(qreal horizontalValue READ horizontalValue WRITE setHorizontalValue NOTIFY horizontalValueChanged)
58 Q_PROPERTY(qreal verticalValue READ verticalValue WRITE setVerticalValue NOTIFY verticalValueChanged)
59 Q_PROPERTY(qreal scrollSpeed READ scrollSpeed WRITE setScrollSpeed NOTIFY scrollSpeedChanged)
60 Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
61 Q_PROPERTY(bool inverted READ isInverted)
62
63public:
64 QQuickWheelArea1(QQuickItem *parent = 0);
65 virtual ~QQuickWheelArea1();
66
67 void setHorizontalMinimumValue(qreal value);
68 qreal horizontalMinimumValue() const;
69
70 void setHorizontalMaximumValue(qreal value);
71 qreal horizontalMaximumValue() const;
72
73 void setVerticalMinimumValue(qreal value);
74 qreal verticalMinimumValue() const;
75
76 void setVerticalMaximumValue(qreal value);
77 qreal verticalMaximumValue() const;
78
79 void setHorizontalValue(qreal value);
80 qreal horizontalValue() const;
81
82 void setVerticalValue(qreal value);
83 qreal verticalValue() const;
84
85 void setVerticalDelta(qreal value);
86 qreal verticalDelta() const;
87
88 void setHorizontalDelta(qreal value);
89 qreal horizontalDelta() const;
90
91 void setScrollSpeed(qreal value);
92 qreal scrollSpeed() const;
93
94 bool isActive() const;
95 void setActive(bool active);
96 bool isInverted() const;
97
98#ifndef QT_NO_WHEELEVENT
99 void wheelEvent(QWheelEvent *event) override;
100#endif
101
102 bool isAtXEnd() const;
103 bool isAtXBeginning() const;
104 bool isAtYEnd() const;
105 bool isAtYBeginning() const;
106
107Q_SIGNALS:
108 void verticalValueChanged();
109 void verticalMinimumValueChanged();
110 void verticalMaximumValueChanged();
111 void horizontalValueChanged();
112 void horizontalMinimumValueChanged();
113 void horizontalMaximumValueChanged();
114 void verticalWheelMoved();
115 void horizontalWheelMoved();
116 void scrollSpeedChanged();
117 void activeChanged();
118
119private:
120 qreal m_horizontalMinimumValue;
121 qreal m_horizontalMaximumValue;
122 qreal m_verticalMinimumValue;
123 qreal m_verticalMaximumValue;
124 qreal m_horizontalValue;
125 qreal m_verticalValue;
126 qreal m_verticalDelta;
127 qreal m_horizontalDelta;
128 qreal m_scrollSpeed;
129 bool m_active;
130 bool m_inverted;
131
132 Q_DISABLE_COPY(QQuickWheelArea1)
133};
134
135QT_END_NAMESPACE
136
137QML_DECLARE_TYPE(QQuickWheelArea1)
138
139#endif // QQUICKWHEELAREA_P_H
140

source code of qtquickcontrols/src/controls/Private/qquickwheelarea_p.h