add more spacing
[personal-kdebase.git] / apps / lib / konq / konqmimedata.h
blobac71f09fc4fc598e091028a1d3ae914ef7ebf080
1 /* This file is part of the KDE projects
2 Copyright (C) 2005 David Faure <faure@kde.org>
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) any later version.
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 GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef KONQMIMEDATA_H
21 #define KONQMIMEDATA_H
23 #include <libkonq_export.h>
24 #include <kurl.h>
25 class QMimeData;
27 /**
28 * This class provides functions for creating and decoding clipboard/drag-n-drop data
29 * of URLs. In particular it ships: (kde) urls, most-local urls, and an "is cut" boolean.
31 class LIBKONQ_EXPORT KonqMimeData
33 public:
34 /**
35 * Populate a QMimeData with urls, and whether they were cut or copied.
37 * @param mimeData pointer to the mimeData object to be populated.
38 * Must not be 0.
39 * @param kdeURLs list of urls (which can include kde-specific protocols).
40 * This list can be empty if only local urls are being used anyway.
41 * @param mostLocalURLs "most local urls" (which try to resolve those to file:/ where possible),
42 * @param cut if true, the user selected "cut" (saved as application/x-kde-cutselection in the mimedata).
44 static void populateMimeData( QMimeData* mimeData,
45 const KUrl::List& kdeURLs,
46 const KUrl::List& mostLocalURLs,
47 bool cut = false );
49 /**
50 * Add the information whether the files were cut, into the mimedata.
51 * @param mimeData pointer to the mimeData object to be populated.
52 * Must not be 0.
53 * @param cut if true, the user selected "cut" (saved as application/x-kde-cutselection in the mimedata).
54 * @since 4.2
56 static void addIsCutSelection(QMimeData* mimeData,
57 bool cut);
59 /**
60 * @return true if the urls in @p mimeData were cut
62 static bool decodeIsCutSelection( const QMimeData *mimeData );
65 #endif /* KONQMIMEDATA_H */