File indexing completed on 2024-04-14 03:54:11

0001 /*
0002     SPDX-FileCopyrightText: 2021 Oleg Solovyov <mcpain@altlinux.org>
0003     SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-or-later
0006 */
0007 
0008 #ifndef KNEWSTUFF3ACTION_H
0009 #define KNEWSTUFF3ACTION_H
0010 
0011 #include <KNSCore/Entry>
0012 #include <QAction>
0013 
0014 #include "knewstuffwidgets_export.h"
0015 
0016 namespace KNSWidgets
0017 {
0018 class ActionPrivate;
0019 /**
0020  * @class Action action.h <KNSWidgets/Action>
0021  *
0022  * QAction subclass that encapsulates the logic for showing the KNewStuff dialog.
0023  * If KNewStuff is disabled using KAuthorized, the action is hidden.
0024  * @see KAuthorized::GenericRestriction::GHNS
0025  *
0026  * @since 5.90
0027  */
0028 class KNEWSTUFFWIDGETS_EXPORT Action : public QAction
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     /**
0034      * Constrcuts a KNSWidgets::Action instance
0035      *
0036      * @param text describing what is being downloaded.
0037      *        It should be a text beginning with "Download New ..." for consistency
0038      * @param configFile the name of the .knsrc file
0039      * @param parent the parent object
0040      */
0041     explicit Action(const QString &text, const QString &configFile, QObject *parent);
0042 
0043     ~Action();
0044 
0045 Q_SIGNALS:
0046     /**
0047      * Emitted when the dialog has been closed.
0048      */
0049     void dialogFinished(const QList<KNSCore::Entry> &changedEntries);
0050 
0051 private:
0052     std::unique_ptr<ActionPrivate> d;
0053 };
0054 
0055 }
0056 
0057 #endif // KNEWSTUFFACTION_H