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 14 class QJSValue; 15 class QMenu; 16 class QAction; 17 18 namespace KIO 19 { 20 class DropJob; 21 } 22 23 class ContainmentInterface; 24 25 class DropMenu : public QObject 26 { 27 Q_OBJECT 28 29 public: 30 DropMenu(KIO::DropJob *dropJob, const QPoint &dropPoint, ContainmentInterface *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 43 private: 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 53