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 QQUICKDIALOG_P_H |
5 | #define QQUICKDIALOG_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/qquickabstractbutton_p.h> |
19 | #include <QtQuickTemplates2/private/qquickpopup_p.h> |
20 | #include <QtGui/qpa/qplatformdialoghelper.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QQuickDialogPrivate; |
25 | |
26 | class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDialog : public QQuickPopup |
27 | { |
28 | Q_OBJECT |
29 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) |
30 | Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL) |
31 | Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL) |
32 | Q_PROPERTY(QPlatformDialogHelper::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged FINAL) |
33 | // 2.3 (Qt 5.10) |
34 | Q_PROPERTY(int result READ result WRITE setResult NOTIFY resultChanged FINAL REVISION(2, 3)) |
35 | QML_EXTENDED_NAMESPACE(QPlatformDialogHelper) |
36 | // 2.5 (Qt 5.12) |
37 | Q_PROPERTY(qreal implicitHeaderWidth READ implicitHeaderWidth NOTIFY implicitHeaderWidthChanged FINAL REVISION(2, 5)) |
38 | Q_PROPERTY(qreal implicitHeaderHeight READ implicitHeaderHeight NOTIFY implicitHeaderHeightChanged FINAL REVISION(2, 5)) |
39 | Q_PROPERTY(qreal implicitFooterWidth READ implicitFooterWidth NOTIFY implicitFooterWidthChanged FINAL REVISION(2, 5)) |
40 | Q_PROPERTY(qreal implicitFooterHeight READ implicitFooterHeight NOTIFY implicitFooterHeightChanged FINAL REVISION(2, 5)) |
41 | QML_NAMED_ELEMENT(Dialog) |
42 | QML_ADDED_IN_VERSION(2, 1) |
43 | |
44 | public: |
45 | explicit QQuickDialog(QObject *parent = nullptr); |
46 | ~QQuickDialog(); |
47 | |
48 | QString title() const; |
49 | void setTitle(const QString &title); |
50 | |
51 | QQuickItem *() const; |
52 | void (QQuickItem *); |
53 | |
54 | QQuickItem *() const; |
55 | void (QQuickItem *); |
56 | |
57 | QPlatformDialogHelper::StandardButtons standardButtons() const; |
58 | void setStandardButtons(QPlatformDialogHelper::StandardButtons buttons); |
59 | Q_REVISION(2, 3) Q_INVOKABLE QQuickAbstractButton *standardButton(QPlatformDialogHelper::StandardButton button) const; |
60 | |
61 | // 2.3 (Qt 5.10) |
62 | enum StandardCode { Rejected, Accepted }; |
63 | Q_ENUM(StandardCode) |
64 | |
65 | int result() const; |
66 | void setResult(int result); |
67 | |
68 | // 2.5 (Qt 5.12) |
69 | qreal () const; |
70 | qreal () const; |
71 | |
72 | qreal () const; |
73 | qreal () const; |
74 | |
75 | public Q_SLOTS: |
76 | virtual void accept(); |
77 | virtual void reject(); |
78 | virtual void done(int result); |
79 | |
80 | Q_SIGNALS: |
81 | void accepted(); |
82 | void rejected(); |
83 | void titleChanged(); |
84 | void (); |
85 | void (); |
86 | void standardButtonsChanged(); |
87 | // 2.3 (Qt 5.10) |
88 | Q_REVISION(2, 3) void applied(); |
89 | Q_REVISION(2, 3) void reset(); |
90 | Q_REVISION(2, 3) void discarded(); |
91 | Q_REVISION(2, 3) void helpRequested(); |
92 | Q_REVISION(2, 3) void resultChanged(); |
93 | // 2.5 (Qt 5.12) |
94 | void (); |
95 | void (); |
96 | void (); |
97 | void (); |
98 | |
99 | protected: |
100 | QQuickDialog(QQuickDialogPrivate &dd, QObject *parent); |
101 | |
102 | #if QT_CONFIG(accessibility) |
103 | QAccessible::Role accessibleRole() const override; |
104 | void accessibilityActiveChanged(bool active) override; |
105 | #endif |
106 | |
107 | private: |
108 | Q_DISABLE_COPY(QQuickDialog) |
109 | Q_DECLARE_PRIVATE(QQuickDialog) |
110 | }; |
111 | |
112 | QT_END_NAMESPACE |
113 | |
114 | QML_DECLARE_TYPE(QQuickDialog) |
115 | |
116 | #endif // QQUICKDIALOG_P_H |
117 | |