File indexing completed on 2024-03-24 04:02:22

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2007 Urs Wolfer <uwolfer at kde.org>
0004 
0005     Parts of this class have been take from the KAboutApplication class, which was:
0006     SPDX-FileCopyrightText: 2000 Waldo Bastian <bastian@kde.org>
0007     SPDX-FileCopyrightText: 2000 Espen Sand <espen@kde.org>
0008 
0009     SPDX-License-Identifier: LGPL-2.0-only
0010 */
0011 
0012 #ifndef KABOUT_APPLICATION_DIALOG_H
0013 #define KABOUT_APPLICATION_DIALOG_H
0014 
0015 #include <QDialog>
0016 #include <memory>
0017 
0018 #include <kxmlgui_export.h>
0019 
0020 class KAboutData;
0021 
0022 /**
0023  * @class KAboutApplicationDialog kaboutapplicationdialog.h KAboutApplicationDialog
0024  *
0025  * @short Standard "About Application" dialog box.
0026  *
0027  * This class provides the standard "About Application" dialog box
0028  * that is used by KHelpMenu. It uses the information of the global
0029  * KAboutData that is specified at the start of your program in
0030  * main(). Normally you should not use this class directly but rather
0031  * the KHelpMenu class or even better just subclass your toplevel
0032  * window from KMainWindow. If you do the latter, the help menu and
0033  * thereby this dialog box is available through the
0034  * KMainWindow::helpMenu() function.
0035  *
0036  * \image html kaboutapplicationdialog.png "KAboutApplicationDialog"
0037  *
0038  * @author Urs Wolfer uwolfer @ kde.org
0039  */
0040 
0041 class KXMLGUI_EXPORT KAboutApplicationDialog : public QDialog
0042 {
0043     Q_OBJECT
0044 public:
0045     /**
0046      * Defines some options which can be applied to the about dialog
0047      *
0048      * @see Options
0049      * @since 4.4
0050      */
0051     enum Option {
0052         NoOptions = 0x0, ///< No options, show the standard about dialog
0053         HideTranslators = 0x1, ///< Don't show the translators tab
0054         HideLibraries = 0x2, /**< Don't show the libraries tab @since 5.77
0055                               *
0056                               * Since 5.87 Don't show the components tab (which replaced the libraries tab)
0057                               */
0058     };
0059     /**
0060      * Stores a combination of #Option values.
0061      */
0062     Q_DECLARE_FLAGS(Options, Option)
0063     Q_FLAG(Options)
0064 
0065     /**
0066      * Constructor. Creates a fully featured "About Application" dialog box.
0067      *
0068      * @param aboutData A KAboutData object which data
0069      *        will be used for filling the dialog.
0070      * @param opts Additional options that can be applied, such as hiding the KDE version
0071      *             or the translators tab.
0072      * @param parent The parent of the dialog box. You should use the
0073      *        toplevel window so that the dialog becomes centered.
0074      *
0075      * @since 4.4
0076      */
0077     explicit KAboutApplicationDialog(const KAboutData &aboutData, Options opts, QWidget *parent = nullptr);
0078 
0079     /**
0080      * Constructor. Creates a fully featured "About Application" dialog box.
0081      *
0082      * @param aboutData A KAboutData object which data
0083      *        will be used for filling the dialog.
0084      * @param parent The parent of the dialog box. You should use the
0085      *        toplevel window so that the dialog becomes centered.
0086      */
0087     explicit KAboutApplicationDialog(const KAboutData &aboutData, QWidget *parent = nullptr);
0088 
0089     ~KAboutApplicationDialog() override;
0090 
0091 private:
0092     std::unique_ptr<class KAboutApplicationDialogPrivate> const d;
0093 
0094     Q_DISABLE_COPY(KAboutApplicationDialog)
0095 };
0096 
0097 Q_DECLARE_OPERATORS_FOR_FLAGS(KAboutApplicationDialog::Options)
0098 
0099 #endif