File indexing completed on 2024-05-26 05:14:15
0001 /* 0002 SPDX-FileCopyrightText: 2008 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "akonadicore_export.h" 0010 #include "collection.h" 0011 0012 class KJob; 0013 class QMimeData; 0014 0015 namespace Akonadi 0016 { 0017 class Session; 0018 0019 /** 0020 @internal 0021 0022 Helper methods for pasting/dropping content into a collection. 0023 0024 @todo Use in item/collection models as well for dnd 0025 */ 0026 namespace PasteHelper 0027 { 0028 /** 0029 Check whether the given mime data can be pasted into the given collection. 0030 @param mimeData The pasted/dropped data. 0031 @param collection The collection to paste/drop into. 0032 @param action Indicate whether this is a copy, a move or link. 0033 */ 0034 AKONADICORE_EXPORT bool canPaste(const QMimeData *mimeData, const Collection &collection, Qt::DropAction action); 0035 0036 /** 0037 Paste/drop the given mime data into the given collection. 0038 @param mimeData The pasted/dropped data. 0039 @param collection The target collection. 0040 @param action Indicate whether this is a copy, a move or link. 0041 @returns The job performing the paste, 0 if there is nothing to paste. 0042 */ 0043 AKONADICORE_EXPORT KJob *paste(const QMimeData *mimeData, const Collection &collection, Qt::DropAction action, Session *session = nullptr); 0044 0045 /** 0046 URI list paste/drop. 0047 @param mimeData The pasted/dropped data. 0048 @param collection The target collection. 0049 @param action The drop action (copy/move/link). 0050 @returns The job performing the paste, 0 if there is nothing to paste. 0051 */ 0052 AKONADICORE_EXPORT KJob *pasteUriList(const QMimeData *mimeData, const Collection &collection, Qt::DropAction action, Session *session = nullptr); 0053 } 0054 0055 }