1/* This file is part of the KDE project
2 Copyright (C) 1999 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19#ifndef KBUGREPORT_H
20#define KBUGREPORT_H
21
22#include <kdialog.h>
23
24class KAboutData;
25class KBugReportPrivate;
26
27/**
28 * @short A dialog box for sending bug reports.
29 *
30 * All the information needed by the dialog box
31 * (program name, version, bug-report address, etc.)
32 * comes from the KAboutData class.
33 * Make sure you create an instance of KAboutData and pass it
34 * to KCmdLineArgs.
35 *
36 * \image html kbugreport.png "KDE Bug Report Dialog"
37 *
38 * @author David Faure <faure@kde.org>
39 */
40class KDEUI_EXPORT KBugReport : public KDialog
41{
42 Q_OBJECT
43
44public:
45 /**
46 * Creates a bug-report dialog.
47 * Note that you shouldn't have to do this manually,
48 * since KHelpMenu takes care of the menu item
49 * for "Report Bug..." and of creating a KBugReport dialog.
50 */
51 // ###KDE5: remove modal argument
52 explicit KBugReport(QWidget *parent = 0L, bool modal=true, const KAboutData *aboutData = 0L);
53
54 /**
55 * Destructor
56 */
57 virtual ~KBugReport();
58
59 /**
60 * The message body of the bug report
61 * @return The message body of the bug report.
62 */
63 QString messageBody() const;
64
65 /**
66 * Sets the message body of the bug report.
67 */
68 void setMessageBody(const QString &messageBody);
69
70 /**
71 * OK has been clicked
72 */
73 virtual void accept();
74
75private:
76 /**
77 * "Configure email" has been clicked - this calls kcmshell4 System/email
78 */
79 Q_PRIVATE_SLOT(d, void _k_slotConfigureEmail())
80
81 /**
82 * Sets the "From" field from the e-mail configuration
83 * Called at creation time, but also after "Configure email" is closed.
84 */
85 Q_PRIVATE_SLOT(d, void _k_slotSetFrom())
86
87 /**
88 * Application combo selection changed (and was activated)
89 */
90 Q_PRIVATE_SLOT(d, void _k_appChanged(int))
91
92 /**
93 * Update the url to match the current os, compiler, selected app, etc
94 */
95 Q_PRIVATE_SLOT(d, void _k_updateUrl())
96
97protected:
98 /**
99 * A complete copy of the bug report
100 * @return QString copy of the bug report.
101 */
102 QString text() const;
103
104 /**
105 * Attempt to e-mail the bug report.
106 * @return true on success
107 */
108 bool sendBugReport();
109
110 virtual void closeEvent(QCloseEvent *e);
111
112private:
113 friend class KBugReportPrivate;
114 KBugReportPrivate *const d;
115
116 Q_DISABLE_COPY(KBugReport)
117};
118
119#endif
120
121