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