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

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2019 Friedrich W. H. Kossebau <kossebau@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KABOUT_PLUGIN_DIALOG_H
0009 #define KABOUT_PLUGIN_DIALOG_H
0010 
0011 #include <kxmlgui_export.h>
0012 // Qt
0013 #include <QDialog>
0014 #include <memory>
0015 
0016 class KPluginMetaData;
0017 class KAboutPluginDialogPrivate;
0018 
0019 /**
0020  * @class KAboutPluginDialog kaboutplugindialog.h KAboutPluginDialog
0021  *
0022  * @short Standard "About Plugin" dialog box.
0023  *
0024  * This class provides a standard "About Plugin" dialog box.
0025  *
0026  * @since 5.65
0027  */
0028 
0029 class KXMLGUI_EXPORT KAboutPluginDialog : public QDialog
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034     /**
0035      * Defines some options which can be applied to the about dialog
0036      * @see Options
0037      */
0038     enum Option {
0039         NoOptions = 0x0, ///< No options, show the standard about dialog
0040         HideTranslators = 0x1, ///< Don't show the translators tab
0041     };
0042     /**
0043      * Stores a combination of #Option values.
0044      */
0045     Q_DECLARE_FLAGS(Options, Option)
0046     Q_FLAG(Options)
0047 
0048     /**
0049      * Constructor. Creates a fully featured "About Plugin" dialog box.
0050      *
0051      * @param pluginMetaData the data about the plugin to show in the dialog.
0052      * @param options options to apply, such as hiding the translators tab.
0053      * @param parent The parent of the dialog box. You should use the
0054      *        toplevel window so that the dialog becomes centered.
0055      */
0056     explicit KAboutPluginDialog(const KPluginMetaData &pluginMetaData, Options options, QWidget *parent = nullptr);
0057 
0058     /**
0059      * Constructor. Creates a fully featured "About Plugin" dialog box.
0060      *
0061      * @param pluginMetaData the data about the plugin to show in the dialog.
0062      * @param parent The parent of the dialog box. You should use the
0063      *        toplevel window so that the dialog becomes centered.
0064      */
0065     explicit KAboutPluginDialog(const KPluginMetaData &pluginMetaData, QWidget *parent = nullptr);
0066 
0067     ~KAboutPluginDialog() override;
0068 
0069 private:
0070     std::unique_ptr<KAboutPluginDialogPrivate> const d;
0071 
0072     Q_DISABLE_COPY(KAboutPluginDialog)
0073 };
0074 
0075 Q_DECLARE_OPERATORS_FOR_FLAGS(KAboutPluginDialog::Options)
0076 
0077 #endif