File indexing completed on 2024-04-21 03:59:33

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KBUGREPORT_H
0009 #define KBUGREPORT_H
0010 
0011 #include <QDialog>
0012 #include <kxmlgui_export.h>
0013 #include <memory>
0014 
0015 class KAboutData;
0016 class KBugReportPrivate;
0017 
0018 /**
0019  * @class KBugReport kbugreport.h KBugReport
0020  *
0021  * @short A dialog box for sending bug reports.
0022  *
0023  * All the information needed by the dialog box
0024  * (program name, version, bug-report address, etc.)
0025  * comes from the KAboutData class.
0026  * Make sure you create an instance of KAboutData and call
0027  * KAboutData::setApplicationData(<aboutData>).
0028  *
0029  * \image html kbugreport.png "KBugReport"
0030  *
0031  * @author David Faure <faure@kde.org>
0032  */
0033 class KXMLGUI_EXPORT KBugReport : public QDialog
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038     /**
0039      * Creates a bug-report dialog.
0040      * Note that you shouldn't have to do this manually,
0041      * since KHelpMenu takes care of the menu item
0042      * for "Report Bug..." and of creating a KBugReport dialog.
0043      */
0044     explicit KBugReport(const KAboutData &aboutData, QWidget *parent = nullptr);
0045 
0046     /**
0047      * Destructor
0048      */
0049     ~KBugReport() override;
0050 
0051     /**
0052      * OK has been clicked
0053      */
0054     void accept() override;
0055 
0056 protected:
0057     /**
0058      * Attempt to e-mail the bug report.
0059      * @return true on success
0060      */
0061     bool sendBugReport();
0062 
0063 private:
0064     friend class KBugReportPrivate;
0065     std::unique_ptr<KBugReportPrivate> const d;
0066 
0067     Q_DISABLE_COPY(KBugReport)
0068 };
0069 
0070 #endif