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 | /*! |
21 | * \class Purpose::Menu |
22 | * \inheaderfile Purpose/Menu |
23 | * \inmodule PurposeWidgets |
24 | * |
25 | * \brief A menu showing different alternatives. |
26 | */ |
27 | class PURPOSEWIDGETS_EXPORT : public QMenu |
28 | { |
29 | Q_OBJECT |
30 | public: |
31 | /*! |
32 | * |
33 | */ |
34 | explicit (QWidget *parent = nullptr); |
35 | |
36 | /*! |
37 | * Exposes the used AlternativesModel so that it can be configured to suit |
38 | * the application needs |
39 | */ |
40 | AlternativesModel *() const; |
41 | |
42 | /*! |
43 | * Forces a reload of the menu in case something changed in the model |
44 | */ |
45 | void (); |
46 | |
47 | Q_SIGNALS: |
48 | |
49 | /*! |
50 | * Emitted just before triggered, just before starting the share operation. |
51 | * |
52 | * Can be used to do adjustments to the configuration, such as setting a new Url. |
53 | * \since 6.2 |
54 | */ |
55 | void (); |
56 | |
57 | /*! |
58 | * Emitted when a triggered job finishes |
59 | * |
60 | * \a output contains the information offered by the plugin. The information offered will depend on the plugin type. |
61 | * |
62 | * \a 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 |
63 | * |
64 | * \a errorMessage the error message |
65 | * |
66 | * \sa Purpose::Job |
67 | */ |
68 | void (const QJsonObject &output, int error, const QString &errorMessage); |
69 | |
70 | private: |
71 | Q_DECLARE_PRIVATE(Menu) |
72 | MenuPrivate *const ; |
73 | }; |
74 | |
75 | } |
76 | |
77 | #endif |
78 | |