| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef KBUGREPORT_H |
| 9 | #define KBUGREPORT_H |
| 10 | |
| 11 | #include <QDialog> |
| 12 | #include <kxmlgui_export.h> |
| 13 | #include <memory> |
| 14 | |
| 15 | class KAboutData; |
| 16 | class KBugReportPrivate; |
| 17 | |
| 18 | /*! |
| 19 | * \class KBugReport |
| 20 | * \inmodule KXmlGui |
| 21 | * |
| 22 | * \brief A dialog box for sending bug reports. |
| 23 | * |
| 24 | * All the information needed by the dialog box |
| 25 | * (program name, version, bug-report address, etc.) |
| 26 | * comes from the KAboutData class. |
| 27 | * Make sure you create an instance of KAboutData and call |
| 28 | * KAboutData::setApplicationData(<aboutData>). |
| 29 | * |
| 30 | * \image kbugreport.png "KBugReport" |
| 31 | */ |
| 32 | class KXMLGUI_EXPORT KBugReport : public QDialog |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | |
| 36 | public: |
| 37 | /*! |
| 38 | * \brief Creates a bug-report dialog using information derived from |
| 39 | * \a aboutData as a child of \a parent. |
| 40 | * |
| 41 | * Note that you shouldn't have to do this manually, |
| 42 | * since KHelpMenu takes care of the menu item |
| 43 | * for "Report Bug..." and of creating a KBugReport dialog. |
| 44 | */ |
| 45 | explicit KBugReport(const KAboutData &aboutData, QWidget *parent = nullptr); |
| 46 | |
| 47 | /*! |
| 48 | * \brief Destructor. |
| 49 | */ |
| 50 | ~KBugReport() override; |
| 51 | |
| 52 | /*! |
| 53 | * \brief OK has been clicked. |
| 54 | */ |
| 55 | void accept() override; |
| 56 | |
| 57 | protected: |
| 58 | /*! |
| 59 | * \brief Attempt to e-mail the bug report. |
| 60 | * |
| 61 | * Returns true on success. |
| 62 | */ |
| 63 | bool sendBugReport(); |
| 64 | |
| 65 | private: |
| 66 | friend class KBugReportPrivate; |
| 67 | std::unique_ptr<KBugReportPrivate> const d; |
| 68 | |
| 69 | Q_DISABLE_COPY(KBugReport) |
| 70 | }; |
| 71 | |
| 72 | #endif |
| 73 | |