1/* This file is part of the KDE project
2 Copyright 2009 Harald Hvaal <haraldhv@stud.ntnu.no>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) version 3.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18#ifndef _KONQ_DNDPOPUPMENUPLUGIN_H_
19#define _KONQ_DNDPOPUPMENUPLUGIN_H_
20
21#include "libkonq_export.h"
22#include <QtCore/QObject>
23
24class QMenu;
25class KActionCollection;
26class KFileItemListProperties;
27class KUrl;
28class QAction;
29
30/**
31 * Base class for drag and drop popup menus
32 *
33 * This can be used for adding dynamic menu items to the normal copy/move/link
34 * here menu appearing in dolphin/konqueror. In the setup-method you may check
35 * the properties of the dropped files, and if applicable, append your own
36 * QAction that the user may trigger in the menu.
37 *
38 * @author Harald Hvaal <metellius@gmail.com>
39 */
40class LIBKONQ_EXPORT KonqDndPopupMenuPlugin : public QObject
41{
42 Q_OBJECT
43public:
44
45 /**
46 * Constructor.
47 */
48 KonqDndPopupMenuPlugin(QObject* parent);
49 virtual ~KonqDndPopupMenuPlugin();
50
51 /**
52 * Implement the setup method in the plugin in order to create actions
53 * in the given actionCollection and add it to the menu using menu->addAction().
54 *
55 * @param popupMenuInfo all the information about the popupmenu being shown
56 * (which file items, their common mimetype, etc.)
57 * @param destination the URL to where the file(s) were dropped
58 * @param pluginActions a QList with the QActions that will be plugged into
59 * the menu.
60 */
61 virtual void setup(const KFileItemListProperties& popupMenuInfo,
62 KUrl destination,
63 QList<QAction*>& pluginActions) = 0;
64};
65
66#endif /* _KONQ_DNDPOPUPMENUPLUGIN_H_ */
67