pastehelper_p.h 2.23 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
    Copyright (c) 2008 Volker Krause <vkrause@kde.org>

    This library is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or (at your
    option) any later version.

    This library is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
    License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to the
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
*/

20 21
#ifndef AKONADI_PASTEHELPER_P_H
#define AKONADI_PASTEHELPER_P_H
22

23
#include "akonadicore_export.h"
Daniel Vrátil's avatar
Daniel Vrátil committed
24
#include "collection.h"
25 26 27 28 29


class KJob;
class QMimeData;

Laurent Montel's avatar
Laurent Montel committed
30 31
namespace Akonadi
{
32

33 34
class Session;

35 36 37 38 39 40 41
/**
  @internal

  Helper methods for pasting/droping content into a collection.

  @todo Use in item/collection models as well for dnd
*/
Laurent Montel's avatar
Laurent Montel committed
42 43
namespace PasteHelper
{
Guy Maurel's avatar
Guy Maurel committed
44 45 46 47 48
/**
  Check whether the given mime data can be pasted into the given collection.
  @param mimeData The pasted/dropped data.
  @param collection The collection to paste/drop into.
*/
49
AKONADICORE_EXPORT bool canPaste(const QMimeData *mimeData, const Collection &collection);
Guy Maurel's avatar
Guy Maurel committed
50 51 52 53 54 55 56 57

/**
  Paste/drop the given mime data into the given collection.
  @param mimeData The pasted/dropped data.
  @param collection The target collection.
  @param copy Indicate whether this is a copy or a move.
  @returns The job performing the paste, 0 if there is nothing to paste.
*/
Laurent Montel's avatar
Laurent Montel committed
58
AKONADICORE_EXPORT KJob *paste(const QMimeData *mimeData, const Collection &collection, bool copy = true, Session *session = nullptr);
Guy Maurel's avatar
Guy Maurel committed
59 60 61 62 63 64 65 66

/**
  URI list paste/drop.
  @param mimeData The pasted/dropped data.
  @param collection The target collection.
  @param action The drop action (copy/move/link).
  @returns The job performing the paste, 0 if there is nothing to paste.
*/
Laurent Montel's avatar
Laurent Montel committed
67
AKONADICORE_EXPORT KJob *pasteUriList(const QMimeData *mimeData, const Collection &collection, Qt::DropAction action, Session *session = nullptr);
68 69 70 71 72
}

}

#endif