| 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 |
| 24 | * \inmodule KXmlGui |
| 25 | * |
| 26 | * \brief Standard "About Application" dialog box. |
| 27 | * |
| 28 | * This class provides the standard "About Application" dialog box |
| 29 | * that is used by KHelpMenu. It uses the information of the global |
| 30 | * KAboutData that is specified at the start of your program in |
| 31 | * main(). Normally you should not use this class directly but rather |
| 32 | * the KHelpMenu class or even better just subclass your toplevel |
| 33 | * window from KMainWindow. If you do the latter, the help menu and |
| 34 | * thereby this dialog box is available through the |
| 35 | * KMainWindow::helpMenu() function. |
| 36 | * |
| 37 | * \image kaboutapplicationdialog.png "KAboutApplicationDialog" |
| 38 | */ |
| 39 | |
| 40 | class KXMLGUI_EXPORT KAboutApplicationDialog : public QDialog |
| 41 | { |
| 42 | Q_OBJECT |
| 43 | public: |
| 44 | /*! |
| 45 | * \enum KAboutApplicationDialog::Option |
| 46 | * |
| 47 | * Defines some options that can be applied to the about dialog. |
| 48 | * |
| 49 | * \value NoOptions |
| 50 | * Shows the standard about dialog. |
| 51 | * \value HideTranslators |
| 52 | * Hides the translators tab. |
| 53 | * \value HideLibraries |
| 54 | * Since 5.77, hides the libraries tab. |
| 55 | * Since 5.87, hides the components tab (which replaces the libraries tab). |
| 56 | * \since 4.4 |
| 57 | */ |
| 58 | enum Option { |
| 59 | NoOptions = 0x0, |
| 60 | HideTranslators = 0x1, |
| 61 | HideLibraries = 0x2, |
| 62 | }; |
| 63 | Q_DECLARE_FLAGS(Options, Option) |
| 64 | Q_FLAG(Options) |
| 65 | |
| 66 | /*! |
| 67 | * Constructs a fully featured "About Application" dialog box |
| 68 | * using existing \a aboutData and the specified \a opts. |
| 69 | * |
| 70 | * You should set the toplevel window as the parent |
| 71 | * so that the dialog becomes centered. |
| 72 | * |
| 73 | * \sa Options |
| 74 | * |
| 75 | * \since 4.4 |
| 76 | */ |
| 77 | explicit KAboutApplicationDialog(const KAboutData &aboutData, Options opts, QWidget *parent = nullptr); |
| 78 | |
| 79 | /*! |
| 80 | * \brief Constructs a fully featured "About Application" dialog box |
| 81 | * using existing \a aboutData. |
| 82 | * |
| 83 | * You should set the toplevel window as the \a parent |
| 84 | * so that the dialog becomes centered. |
| 85 | */ |
| 86 | explicit KAboutApplicationDialog(const KAboutData &aboutData, QWidget *parent = nullptr); |
| 87 | |
| 88 | ~KAboutApplicationDialog() override; |
| 89 | |
| 90 | private: |
| 91 | std::unique_ptr<class KAboutApplicationDialogPrivate> const d; |
| 92 | |
| 93 | Q_DISABLE_COPY(KAboutApplicationDialog) |
| 94 | }; |
| 95 | |
| 96 | Q_DECLARE_OPERATORS_FOR_FLAGS(KAboutApplicationDialog::Options) |
| 97 | |
| 98 | #endif |
| 99 | |