1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2007 Urs Wolfer <uwolfer at kde.org> |
4 | |
5 | Parts of this class have been take from the KAboutApplication class, which was: |
6 | SPDX-FileCopyrightText: 2000 Waldo Bastian <bastian@kde.org> |
7 | SPDX-FileCopyrightText: 2000 Espen Sand <espen@kde.org> |
8 | |
9 | SPDX-License-Identifier: LGPL-2.0-only |
10 | */ |
11 | |
12 | #ifndef KABOUT_APPLICATION_DIALOG_H |
13 | #define KABOUT_APPLICATION_DIALOG_H |
14 | |
15 | #include <QDialog> |
16 | #include <memory> |
17 | |
18 | #include <kxmlgui_export.h> |
19 | |
20 | class KAboutData; |
21 | |
22 | /** |
23 | * @class KAboutApplicationDialog kaboutapplicationdialog.h KAboutApplicationDialog |
24 | * |
25 | * @short Standard "About Application" dialog box. |
26 | * |
27 | * This class provides the standard "About Application" dialog box |
28 | * that is used by KHelpMenu. It uses the information of the global |
29 | * KAboutData that is specified at the start of your program in |
30 | * main(). Normally you should not use this class directly but rather |
31 | * the KHelpMenu class or even better just subclass your toplevel |
32 | * window from KMainWindow. If you do the latter, the help menu and |
33 | * thereby this dialog box is available through the |
34 | * KMainWindow::helpMenu() function. |
35 | * |
36 | * \image html kaboutapplicationdialog.png "KAboutApplicationDialog" |
37 | * |
38 | * @author Urs Wolfer uwolfer @ kde.org |
39 | */ |
40 | |
41 | class KXMLGUI_EXPORT KAboutApplicationDialog : public QDialog |
42 | { |
43 | Q_OBJECT |
44 | public: |
45 | /** |
46 | * Defines some options which can be applied to the about dialog |
47 | * |
48 | * @see Options |
49 | * @since 4.4 |
50 | */ |
51 | enum Option { |
52 | NoOptions = 0x0, ///< No options, show the standard about dialog |
53 | HideTranslators = 0x1, ///< Don't show the translators tab |
54 | HideLibraries = 0x2, /**< Don't show the libraries tab @since 5.77 |
55 | * |
56 | * Since 5.87 Don't show the components tab (which replaced the libraries tab) |
57 | */ |
58 | }; |
59 | /** |
60 | * Stores a combination of #Option values. |
61 | */ |
62 | Q_DECLARE_FLAGS(Options, Option) |
63 | Q_FLAG(Options) |
64 | |
65 | /** |
66 | * Constructor. Creates a fully featured "About Application" dialog box. |
67 | * |
68 | * @param aboutData A KAboutData object which data |
69 | * will be used for filling the dialog. |
70 | * @param opts Additional options that can be applied, such as hiding the KDE version |
71 | * or the translators tab. |
72 | * @param parent The parent of the dialog box. You should use the |
73 | * toplevel window so that the dialog becomes centered. |
74 | * |
75 | * @since 4.4 |
76 | */ |
77 | explicit KAboutApplicationDialog(const KAboutData &aboutData, Options opts, QWidget *parent = nullptr); |
78 | |
79 | /** |
80 | * Constructor. Creates a fully featured "About Application" dialog box. |
81 | * |
82 | * @param aboutData A KAboutData object which data |
83 | * will be used for filling the dialog. |
84 | * @param parent The parent of the dialog box. You should use the |
85 | * toplevel window so that the dialog becomes centered. |
86 | */ |
87 | explicit KAboutApplicationDialog(const KAboutData &aboutData, QWidget *parent = nullptr); |
88 | |
89 | ~KAboutApplicationDialog() override; |
90 | |
91 | private: |
92 | std::unique_ptr<class KAboutApplicationDialogPrivate> const d; |
93 | |
94 | Q_DISABLE_COPY(KAboutApplicationDialog) |
95 | }; |
96 | |
97 | Q_DECLARE_OPERATORS_FOR_FLAGS(KAboutApplicationDialog::Options) |
98 | |
99 | #endif |
100 | |