1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKPAGEINDICATOR_P_H
5#define QQUICKPAGEINDICATOR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTemplates2/private/qquickcontrol_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQmlComponent;
23class QQuickPageIndicatorPrivate;
24
25class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPageIndicator : public QQuickControl
26{
27 Q_OBJECT
28 Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged FINAL)
29 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL)
30 Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL)
31 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
32 QML_NAMED_ELEMENT(PageIndicator)
33 QML_ADDED_IN_VERSION(2, 0)
34
35public:
36 explicit QQuickPageIndicator(QQuickItem *parent = nullptr);
37 ~QQuickPageIndicator() override;
38
39 int count() const;
40 void setCount(int count);
41
42 int currentIndex() const;
43 void setCurrentIndex(int index);
44
45 bool isInteractive() const;
46 void setInteractive(bool interactive);
47
48 QQmlComponent *delegate() const;
49 void setDelegate(QQmlComponent *delegate);
50
51Q_SIGNALS:
52 void countChanged();
53 void currentIndexChanged();
54 void interactiveChanged();
55 void delegateChanged();
56
57protected:
58 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
59
60#if QT_CONFIG(quicktemplates2_multitouch)
61 void touchEvent(QTouchEvent *event) override;
62#endif
63
64#if QT_CONFIG(accessibility)
65 QAccessible::Role accessibleRole() const override;
66#endif
67
68private:
69 Q_DISABLE_COPY(QQuickPageIndicator)
70 Q_DECLARE_PRIVATE(QQuickPageIndicator)
71};
72
73QT_END_NAMESPACE
74
75QML_DECLARE_TYPE(QQuickPageIndicator)
76
77#endif // QQUICKPAGEINDICATOR_P_H
78

source code of qtdeclarative/src/quicktemplates/qquickpageindicator_p.h