KIO

paste.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2000-2005 David Faure <faure@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-only
6*/
7
8#ifndef KIO_PASTE_H
9#define KIO_PASTE_H
10
11#include "kiowidgets_export.h"
12#include <QString>
13class QWidget;
14class QUrl;
15class QMimeData;
16class KFileItem;
17
18namespace KIO
19{
20class Job;
21class CopyJob;
22
23/**
24 * Returns true if pasteMimeData will find any interesting format in @p data.
25 * You can use this method to enable/disable the paste action appropriately.
26 * @since 5.0 (was called canPasteMimeSource before)
27 */
28KIOWIDGETS_EXPORT bool canPasteMimeData(const QMimeData *data);
29
30/**
31 * Returns the text to use for the Paste action, when the application supports
32 * pasting files, urls, and clipboard data, using pasteClipboard().
33 * @param mimeData the mime data, usually QApplication::clipboard()->mimeData().
34 * @param enable output parameter, to be passed to QAction::setEnabled.
35 * The pointer must be non-null, and in return the function will always set its value.
36 * @param destItem item representing the directory into which the clipboard data
37 * or items would be pasted. Used to find out about permissions in that directory.
38 * @return a string suitable for QAction::setText
39 * @since 5.4
40 */
41KIOWIDGETS_EXPORT QString pasteActionText(const QMimeData *mimeData, bool *enable, const KFileItem &destItem);
42
43/**
44 * Add the information whether the files were cut, into the mimedata.
45 * @param mimeData pointer to the mimeData object to be populated. Must not be null.
46 * @param cut if true, the user selected "cut" (saved as application/x-kde-cutselection in the mimedata).
47 * @since 5.2
48 */
49KIOWIDGETS_EXPORT void setClipboardDataCut(QMimeData *mimeData, bool cut);
50
51/**
52 * Returns true if the URLs in @p mimeData were cut by the user.
53 * This should be called when pasting, to choose between moving and copying.
54 * @since 5.2
55 */
56KIOWIDGETS_EXPORT bool isClipboardDataCut(const QMimeData *mimeData);
57
58}
59
60#endif
A KFileItem is a generic class to handle a file, local or remote.
Definition kfileitem.h:36
A namespace for KIO globals.
KIOWIDGETS_EXPORT void setClipboardDataCut(QMimeData *mimeData, bool cut)
Add the information whether the files were cut, into the mimedata.
Definition paste.cpp:275
KIOWIDGETS_EXPORT bool canPasteMimeData(const QMimeData *data)
Returns true if pasteMimeData will find any interesting format in data.
Definition paste.cpp:189
KIOWIDGETS_EXPORT QString pasteActionText(const QMimeData *mimeData, bool *enable, const KFileItem &destItem)
Returns the text to use for the Paste action, when the application supports pasting files,...
Definition paste.cpp:234
KIOWIDGETS_EXPORT bool isClipboardDataCut(const QMimeData *mimeData)
Returns true if the URLs in mimeData were cut by the user.
Definition paste.cpp:281
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:56:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.