1 | /* |
2 | SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <aleixpol@blue-systems.com> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.1-or-later |
5 | */ |
6 | |
7 | #ifndef PURPOSEMENU_H |
8 | #define |
9 | |
10 | #include "purposewidgets_export.h" |
11 | |
12 | #include <QMenu> |
13 | |
14 | namespace Purpose |
15 | { |
16 | class ; |
17 | |
18 | class AlternativesModel; |
19 | |
20 | class PURPOSEWIDGETS_EXPORT : public QMenu |
21 | { |
22 | Q_OBJECT |
23 | public: |
24 | explicit (QWidget *parent = nullptr); |
25 | |
26 | /** |
27 | * Exposes the used AlternativesModel so that it can be configured to suit |
28 | * the application needs |
29 | */ |
30 | AlternativesModel *() const; |
31 | |
32 | /** |
33 | * Forces a reload of the menu in case something changed in the model |
34 | */ |
35 | void (); |
36 | |
37 | Q_SIGNALS: |
38 | |
39 | /** |
40 | * Emitted just before triggered, just before starting the share operation |
41 | * Can be used to do adjustments to the configuration, such as setting a new Url |
42 | * @since 6.2 |
43 | */ |
44 | void (); |
45 | |
46 | /** |
47 | * Emitted when a triggered job finishes |
48 | * |
49 | * @p output contains the information offered by the plugin. The information offered will depend on the plugin type. |
50 | * @p error will be 0 if the execution was successful, KIO::ERR_USER_CANCELED if cancelled by the user, otherwise it will provide an error message |
51 | * @p errorMessage the error message |
52 | * |
53 | * @see Purpose::Job |
54 | */ |
55 | void (const QJsonObject &output, int error, const QString &errorMessage); |
56 | |
57 | private: |
58 | Q_DECLARE_PRIVATE(Menu) |
59 | MenuPrivate *const ; |
60 | }; |
61 | |
62 | } |
63 | |
64 | #endif |
65 | |