1 | /* |
2 | SPDX-FileCopyrightText: 2021 Oleg Solovyov <mcpain@altlinux.org> |
3 | SPDX-FileCopyrightText: 2021 Alexander Lohnau <alexander.lohnau@gmx.de> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.1-or-later |
6 | */ |
7 | |
8 | #ifndef KNEWSTUFF3ACTION_H |
9 | #define KNEWSTUFF3ACTION_H |
10 | |
11 | #include <KNSCore/Entry> |
12 | #include <QAction> |
13 | |
14 | #include "knewstuffwidgets_export.h" |
15 | |
16 | /*! |
17 | * \namespace KNSWidgets |
18 | * \inmodule KNewStuffWidgets |
19 | * |
20 | * \brief Contains UX widgets for KNewStuffCore. |
21 | */ |
22 | namespace KNSWidgets |
23 | { |
24 | class ActionPrivate; |
25 | /*! |
26 | * \class KNSWidgets::Action |
27 | * \inmodule KNewStuffWidgets |
28 | * |
29 | * \brief QAction subclass that encapsulates the logic for showing the KNewStuff dialog. |
30 | * |
31 | * If KNewStuff is disabled using KAuthorized, the action is hidden. |
32 | * |
33 | * \sa KAuthorized::GenericRestriction::GHNS |
34 | * |
35 | * \since 5.90 |
36 | */ |
37 | class KNEWSTUFFWIDGETS_EXPORT Action : public QAction |
38 | { |
39 | Q_OBJECT |
40 | |
41 | public: |
42 | /*! |
43 | * Constructs a KNSWidgets::Action instance. |
44 | * |
45 | * \a text describing what is being downloaded. |
46 | * It should be a text beginning with "Download New ..." for consistency |
47 | * |
48 | * \a configFile the name of the .knsrc file |
49 | * |
50 | * \a parent the parent object |
51 | * |
52 | */ |
53 | explicit Action(const QString &text, const QString &configFile, QObject *parent); |
54 | |
55 | ~Action(); |
56 | |
57 | Q_SIGNALS: |
58 | /*! |
59 | * Emitted when the dialog has been closed. |
60 | * |
61 | * \a changedEntries contains the entries that were changed |
62 | * |
63 | */ |
64 | void dialogFinished(const QList<KNSCore::Entry> &changedEntries); |
65 | |
66 | private: |
67 | std::unique_ptr<ActionPrivate> d; |
68 | }; |
69 | |
70 | } |
71 | |
72 | #endif // KNEWSTUFFACTION_H |
73 | |