1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 2007 Urs Wolfer <uwolfer at kde.org> |
3 | |
4 | Parts of this class have been take from the KAboutApplication class, which was |
5 | Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and Espen Sand (espen@kde.org) |
6 | |
7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public |
9 | License version 2 as published by the Free Software Foundation. |
10 | |
11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. |
15 | |
16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 | Boston, MA 02110-1301, USA. |
20 | */ |
21 | |
22 | #ifndef KABOUT_APPLICATION_DIALOG_H |
23 | #define KABOUT_APPLICATION_DIALOG_H |
24 | |
25 | #include "kdialog.h" |
26 | |
27 | #include <QtCore/QFlags> |
28 | |
29 | class KAboutData; |
30 | |
31 | /** |
32 | * @short Standard "About Application" dialog box. |
33 | * |
34 | * This class provides the standard "About Application" dialog box |
35 | * that is used by KHelpMenu. It uses the information of the global |
36 | * KAboutData that is specified at the start of your program in |
37 | * main(). Normally you should not use this class directly but rather |
38 | * the KHelpMenu class or even better just subclass your toplevel |
39 | * window from KMainWindow. If you do the latter, the help menu and |
40 | * thereby this dialog box is available through the |
41 | * KMainWindow::helpMenu() function. |
42 | * |
43 | * \image html kaboutapplicationdialog.png "KDE About Application Dialog" |
44 | * |
45 | * @author Urs Wolfer uwolfer @ kde.org |
46 | */ |
47 | |
48 | class KDEUI_EXPORT KAboutApplicationDialog : public KDialog |
49 | { |
50 | Q_OBJECT |
51 | Q_FLAGS( Options ) |
52 | public: |
53 | |
54 | /** |
55 | * Defines some options which can be applied to the about dialog |
56 | * |
57 | * @since 4.4 |
58 | */ |
59 | enum Option { |
60 | NoOptions = 0x0, ///< No options, show the standard about dialog |
61 | HideTranslators = 0x1, ///< Don't show the translators tab |
62 | HideKdeVersion = 0x2 ///< Don't show the KDE version next to the application name and version |
63 | }; |
64 | Q_DECLARE_FLAGS( Options, Option ) |
65 | |
66 | /** |
67 | * Constructor. Creates a fully featured "About Application" dialog box. |
68 | * |
69 | * @param aboutData A pointer to a KAboutData object which data |
70 | * will be used for filling the dialog. |
71 | * @param opts Additional options that can be applied, such as hiding the KDE version |
72 | * or the translators tab. |
73 | * @param parent The parent of the dialog box. You should use the |
74 | * toplevel window so that the dialog becomes centered. |
75 | * |
76 | * @since 4.4 |
77 | */ |
78 | explicit KAboutApplicationDialog(const KAboutData *aboutData, Options opts, QWidget *parent = 0); |
79 | |
80 | /** |
81 | * Constructor. Creates a fully featured "About Application" dialog box. |
82 | * |
83 | * @param aboutData A pointer to a KAboutData object which data |
84 | * will be used for filling the dialog. |
85 | * @param parent The parent of the dialog box. You should use the |
86 | * toplevel window so that the dialog becomes centered. |
87 | */ |
88 | explicit KAboutApplicationDialog(const KAboutData *aboutData, QWidget *parent = 0); |
89 | |
90 | virtual ~KAboutApplicationDialog(); |
91 | |
92 | private: |
93 | class Private; |
94 | Private* const d; |
95 | |
96 | Q_PRIVATE_SLOT( d, void _k_showLicense(const QString&) ) |
97 | |
98 | Q_DISABLE_COPY( KAboutApplicationDialog ) |
99 | }; |
100 | |
101 | Q_DECLARE_OPERATORS_FOR_FLAGS( KAboutApplicationDialog::Options ) |
102 | |
103 | #endif |
104 | |