File indexing completed on 2024-09-08 12:23:19
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 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 77) 0059 HideKdeVersion KXMLGUI_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 83, 5, 77, "Use HideLibraries") = 0060 HideLibraries /**< 0061 * Before 5.13: Don't show the KDE Frameworks version next to the application name and version 0062 * 0063 * Since 5.13: Don't show the Qt and KDE Frameworks libraries in the versions tab 0064 * 0065 * Since 5.30 Don't show the Qt and KDE Frameworks libraries in the libraries tab 0066 * 0067 * Since 5.75 Don't show the libraries tab 0068 * 0069 * @deprecated Since 5.77, use @c HideLibraries instead. 0070 */ 0071 #endif 0072 }; 0073 /** 0074 * Stores a combination of #Option values. 0075 */ 0076 Q_DECLARE_FLAGS(Options, Option) 0077 Q_FLAG(Options) 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 opts Additional options that can be applied, such as hiding the KDE version 0085 * or the translators tab. 0086 * @param parent The parent of the dialog box. You should use the 0087 * toplevel window so that the dialog becomes centered. 0088 * 0089 * @since 4.4 0090 */ 0091 explicit KAboutApplicationDialog(const KAboutData &aboutData, Options opts, QWidget *parent = nullptr); 0092 0093 /** 0094 * Constructor. Creates a fully featured "About Application" dialog box. 0095 * 0096 * @param aboutData A KAboutData object which data 0097 * will be used for filling the dialog. 0098 * @param parent The parent of the dialog box. You should use the 0099 * toplevel window so that the dialog becomes centered. 0100 */ 0101 explicit KAboutApplicationDialog(const KAboutData &aboutData, QWidget *parent = nullptr); 0102 0103 ~KAboutApplicationDialog() override; 0104 0105 private: 0106 std::unique_ptr<class KAboutApplicationDialogPrivate> const d; 0107 0108 Q_DISABLE_COPY(KAboutApplicationDialog) 0109 }; 0110 0111 Q_DECLARE_OPERATORS_FOR_FLAGS(KAboutApplicationDialog::Options) 0112 0113 #endif