From e7bd514a39f0b07ddfec85f5f7b391e16af7d279 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 24 Oct 2008 22:19:23 +0000 Subject: * Move code from DolphinDropController to DragAndDropHelper. * Move code which checks whether the dragging of a MIME type is supported to DragAndDropHelper. This allows adding an improved support for dropping compressed files from Ark to Dolphin later... CCMAIL: haraldhv@stud.ntnu.no svn path=/trunk/KDE/kdebase/apps/; revision=875611 --- src/draganddrophelper.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/draganddrophelper.h') diff --git a/src/draganddrophelper.h b/src/draganddrophelper.h index 64e347e9c..920ff5135 100644 --- a/src/draganddrophelper.h +++ b/src/draganddrophelper.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2007 by Peter Penz * - * * + * Copyright (C) 2007 by David Faure * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -23,6 +23,10 @@ #include class DolphinController; +class KFileItem; +class KUrl; +class QDropEvent; +class QMimeData; class QAbstractItemView; class QBrush; class QRect; @@ -39,12 +43,33 @@ class DragAndDropHelper { public: + /** + * Returns true, if Dolphin supports the dragging of + * the given mime data. + */ + static bool isMimeDataSupported(const QMimeData* mimeData); + /** * Creates a drag object for the view \a itemView for all selected items. */ static void startDrag(QAbstractItemView* itemView, Qt::DropActions supportedActions, DolphinController* controller = 0); + + /** + * Handles the dropping of URLs to the given + * destination. A context menu with the options + * 'Move Here', 'Copy Here', 'Link Here' and + * 'Cancel' is offered to the user. + * @param destItem Item of the destination (can be null, see KFileItem::isNull()). + * @param destPath Path of the destination. + * @param event Drop event. + * @param widget Source widget where the dragging has been started. + */ + static void dropUrls(const KFileItem& destItem, + const KUrl& destPath, + QDropEvent* event, + QWidget* widget); }; #endif -- cgit v1.3