| 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 QQUICKLABSPLATFORMMESSAGEDIALOG_P_H |
| 5 | #define QQUICKLABSPLATFORMMESSAGEDIALOG_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 "qquicklabsplatformdialog_p.h" |
| 19 | #include <QtQml/qqml.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | class QQuickLabsPlatformMessageDialog : public QQuickLabsPlatformDialog |
| 24 | { |
| 25 | Q_OBJECT |
| 26 | QML_NAMED_ELEMENT(MessageDialog) |
| 27 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL) |
| 28 | Q_PROPERTY(QString informativeText READ informativeText WRITE setInformativeText NOTIFY informativeTextChanged FINAL) |
| 29 | Q_PROPERTY(QString detailedText READ detailedText WRITE setDetailedText NOTIFY detailedTextChanged FINAL) |
| 30 | Q_PROPERTY(QPlatformDialogHelper::StandardButtons buttons READ buttons WRITE setButtons NOTIFY buttonsChanged FINAL) |
| 31 | QML_EXTENDED_NAMESPACE(QPlatformDialogHelper) |
| 32 | |
| 33 | public: |
| 34 | explicit QQuickLabsPlatformMessageDialog(QObject *parent = nullptr); |
| 35 | |
| 36 | QString text() const; |
| 37 | void setText(const QString &text); |
| 38 | |
| 39 | QString informativeText() const; |
| 40 | void setInformativeText(const QString &text); |
| 41 | |
| 42 | QString detailedText() const; |
| 43 | void setDetailedText(const QString &text); |
| 44 | |
| 45 | QPlatformDialogHelper::StandardButtons buttons() const; |
| 46 | void setButtons(QPlatformDialogHelper::StandardButtons buttons); |
| 47 | |
| 48 | Q_SIGNALS: |
| 49 | void textChanged(); |
| 50 | void informativeTextChanged(); |
| 51 | void detailedTextChanged(); |
| 52 | void buttonsChanged(); |
| 53 | void clicked(QPlatformDialogHelper::StandardButton button); |
| 54 | |
| 55 | void okClicked(); |
| 56 | void saveClicked(); |
| 57 | void saveAllClicked(); |
| 58 | void openClicked(); |
| 59 | void yesClicked(); |
| 60 | void yesToAllClicked(); |
| 61 | void noClicked(); |
| 62 | void noToAllClicked(); |
| 63 | void abortClicked(); |
| 64 | void retryClicked(); |
| 65 | void ignoreClicked(); |
| 66 | void closeClicked(); |
| 67 | void cancelClicked(); |
| 68 | void discardClicked(); |
| 69 | void helpClicked(); |
| 70 | void applyClicked(); |
| 71 | void resetClicked(); |
| 72 | void restoreDefaultsClicked(); |
| 73 | |
| 74 | protected: |
| 75 | void onCreate(QPlatformDialogHelper *dialog) override; |
| 76 | void onShow(QPlatformDialogHelper *dialog) override; |
| 77 | |
| 78 | private Q_SLOTS: |
| 79 | void handleClick(QPlatformDialogHelper::StandardButton button); |
| 80 | |
| 81 | private: |
| 82 | QSharedPointer<QMessageDialogOptions> m_options; |
| 83 | }; |
| 84 | |
| 85 | QT_END_NAMESPACE |
| 86 | |
| 87 | #endif // QQUICKLABSPLATFORMMESSAGEDIALOG_P_H |
| 88 |
