1/*
2 Copyright (c) 2008 Volker Krause <vkrause@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef AKONADI_PASTEHELPER_P_H
21#define AKONADI_PASTEHELPER_P_H
22
23#include <akonadi/collection.h>
24
25#include <QtCore/QList>
26
27class KJob;
28class QMimeData;
29
30namespace Akonadi {
31
32class Session;
33
34/**
35 @internal
36
37 Helper methods for pasting/droping content into a collection.
38
39 @todo Use in item/collection models as well for dnd
40*/
41namespace PasteHelper
42{
43/**
44 Check whether the given mime data can be pasted into the given collection.
45 @param mimeData The pasted/dropped data.
46 @param collection The collection to paste/drop into.
47*/
48bool canPaste(const QMimeData *mimeData, const Collection &collection);
49
50/**
51 Paste/drop the given mime data into the given collection.
52 @param mimeData The pasted/dropped data.
53 @param collection The target collection.
54 @param copy Indicate whether this is a copy or a move.
55 @returns The job performing the paste, 0 if there is nothing to paste.
56*/
57KJob *paste(const QMimeData *mimeData, const Collection &collection, bool copy = true, Session *session = 0);
58
59/**
60 URI list paste/drop.
61 @param mimeData The pasted/dropped data.
62 @param collection The target collection.
63 @param action The drop action (copy/move/link).
64 @returns The job performing the paste, 0 if there is nothing to paste.
65*/
66KJob *pasteUriList(const QMimeData *mimeData, const Collection &collection, Qt::DropAction action, Session *session = 0);
67}
68
69}
70
71#endif
72