Libplasma

dropmenu.h
1/*
2 SPDX-FileCopyrightText: 2008-2013 Aaron Seigo <aseigo@kde.org>
3 SPDX-FileCopyrightText: 2010-2013 Marco Martin <mart@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef DROPMENU_H
9#define DROPMENU_H
10
11#include <QObject>
12#include <QPoint>
13
14class QJSValue;
15class QMenu;
16class QAction;
17
18namespace KIO
19{
20class DropJob;
21}
22
23class ContainmentItem;
24
25class DropMenu : public QObject
26{
28
29public:
30 DropMenu(KIO::DropJob *dropJob, const QPoint &dropPoint, ContainmentItem *parent = nullptr);
31 ~DropMenu() override;
32
33 QList<QUrl> urls() const;
34 QPoint dropPoint() const;
35 void setUrls(const QList<QUrl> &urls);
36 void setMultipleMimetypes(bool multipleMimetypes);
37
38 void addAction(QAction *action);
39 bool isDropjobMenu() const;
40 bool isMultipleMimetypes() const;
41 void show();
42
43private:
44 QPoint m_dropPoint;
45 QMenu *m_menu = nullptr;
46 KIO::DropJob *m_dropJob = nullptr;
47 QList<QAction *> m_dropActions = QList<QAction *>();
48 QList<QUrl> m_urls = QList<QUrl>();
49 bool m_multipleMimetypes = false;
50};
51
52#endif
This class is exposed to containments QML as the attached property Plasmoid.
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.