Purpose

menu.h
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 PURPOSEMENU_H
9
10#include "purposewidgets_export.h"
11
12#include <QMenu>
13
14namespace Purpose
15{
16class MenuPrivate;
17
18class AlternativesModel;
19
20class PURPOSEWIDGETS_EXPORT Menu : public QMenu
21{
22 Q_OBJECT
23public:
24 explicit Menu(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 *model() const;
31
32 /**
33 * Forces a reload of the menu in case something changed in the model
34 */
35 void reload();
36
37Q_SIGNALS:
38 /**
39 * Emitted when a triggered job finishes
40 *
41 * @p output contains the information offered by the plugin. The information offered will depend on the plugin type.
42 * @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
43 * @p errorMessage the error message
44 *
45 * @see Purpose::Job
46 */
47 void finished(const QJsonObject &output, int error, const QString &errorMessage);
48
49private:
50 Q_DECLARE_PRIVATE(Menu)
51 MenuPrivate *const d_ptr;
52};
53
54}
55
56#endif
const QList< QKeySequence > & reload()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.