Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/paste.h
Show All 25 Lines | |||||
26 | class QMimeData; | 26 | class QMimeData; | ||
27 | class KFileItem; | 27 | class KFileItem; | ||
28 | 28 | | |||
29 | namespace KIO | 29 | namespace KIO | ||
30 | { | 30 | { | ||
31 | class Job; | 31 | class Job; | ||
32 | class CopyJob; | 32 | class CopyJob; | ||
33 | 33 | | |||
34 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 4) | ||||
34 | /** | 35 | /** | ||
35 | * Pastes the content of the clipboard to the given destination URL. | 36 | * Pastes the content of the clipboard to the given destination URL. | ||
36 | * URLs are treated separately (performing a file copy) | 37 | * URLs are treated separately (performing a file copy) | ||
37 | * from other data (which is saved into a file after asking the user | 38 | * from other data (which is saved into a file after asking the user | ||
38 | * to choose a filename and the preferred data format) | 39 | * to choose a filename and the preferred data format) | ||
39 | * | 40 | * | ||
40 | * @param destURL the URL to receive the data | 41 | * @param destURL the URL to receive the data | ||
41 | * @param widget parent widget to use for dialogs | 42 | * @param widget parent widget to use for dialogs | ||
42 | * @param move true to move the data, false to copy -- now ignored and handled automatically | 43 | * @param move true to move the data, false to copy -- now ignored and handled automatically | ||
43 | * @return the job that handles the operation | 44 | * @return the job that handles the operation | ||
44 | * @deprecated since 5.4, use KIO::paste() from <KIO/PasteJob> (which takes care of undo/redo too) | 45 | * @deprecated since 5.4, use KIO::paste() from <KIO/PasteJob> (which takes care of undo/redo too) | ||
45 | */ | 46 | */ | ||
46 | KIOWIDGETS_DEPRECATED_EXPORT Job *pasteClipboard(const QUrl &destURL, QWidget *widget, bool move = false); | 47 | KIOWIDGETS_DEPRECATED_VERSION(5, 4, "Use KIO::paste(...) from <KIO/PasteJob>") | ||
48 | KIOWIDGETS_EXPORT Job *pasteClipboard(const QUrl &destURL, QWidget *widget, bool move = false); | ||||
49 | #endif | ||||
47 | 50 | | |||
51 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 4) | ||||
48 | /** | 52 | /** | ||
49 | * Save the given mime @p data to the given destination URL | 53 | * Save the given mime @p data to the given destination URL | ||
50 | * after offering the user to choose a data format. | 54 | * after offering the user to choose a data format. | ||
51 | * This is the method used when handling drops (of anything else than URLs) | 55 | * This is the method used when handling drops (of anything else than URLs) | ||
52 | * onto dolphin and konqueror. | 56 | * onto dolphin and konqueror. | ||
53 | * | 57 | * | ||
54 | * @param data the QMimeData, usually from a QDropEvent | 58 | * @param data the QMimeData, usually from a QDropEvent | ||
55 | * @param destUrl the URL of the directory where the data will be pasted. | 59 | * @param destUrl the URL of the directory where the data will be pasted. | ||
56 | * The filename to use in that directory is prompted by this method. | 60 | * The filename to use in that directory is prompted by this method. | ||
57 | * @param dialogText the text to show in the dialog | 61 | * @param dialogText the text to show in the dialog | ||
58 | * @param widget parent widget to use for dialogs | 62 | * @param widget parent widget to use for dialogs | ||
59 | * | 63 | * | ||
60 | * @see pasteClipboard() | 64 | * @see pasteClipboard() | ||
61 | * @deprecated since 5.4, use KIO::paste() from <KIO/PasteJob> (which takes care of undo/redo too) | 65 | * @deprecated since 5.4, use KIO::paste() from <KIO/PasteJob> (which takes care of undo/redo too) | ||
62 | */ | 66 | */ | ||
63 | KIOWIDGETS_DEPRECATED_EXPORT Job *pasteMimeData(const QMimeData *data, const QUrl &destUrl, | 67 | KIOWIDGETS_DEPRECATED_VERSION(5, 4, "Use KIO::paste(...) from <KIO/PasteJob>") | ||
68 | KIOWIDGETS_EXPORT Job *pasteMimeData(const QMimeData *data, const QUrl &destUrl, | ||||
64 | const QString &dialogText, QWidget *widget); | 69 | const QString &dialogText, QWidget *widget); | ||
70 | #endif | ||||
65 | 71 | | |||
66 | /** | 72 | /** | ||
67 | * Returns true if pasteMimeData will find any interesting format in @p data. | 73 | * Returns true if pasteMimeData will find any interesting format in @p data. | ||
68 | * You can use this method to enable/disable the paste action appropriately. | 74 | * You can use this method to enable/disable the paste action appropriately. | ||
69 | * @since 5.0 (was called canPasteMimeSource before) | 75 | * @since 5.0 (was called canPasteMimeSource before) | ||
70 | */ | 76 | */ | ||
71 | KIOWIDGETS_EXPORT bool canPasteMimeData(const QMimeData *data); | 77 | KIOWIDGETS_EXPORT bool canPasteMimeData(const QMimeData *data); | ||
72 | 78 | | |||
79 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 4) | ||||
73 | /** | 80 | /** | ||
74 | * Returns the text to use for the Paste action, when the application supports | 81 | * Returns the text to use for the Paste action, when the application supports | ||
75 | * pasting files, urls, and clipboard data, using pasteClipboard(). | 82 | * pasting files, urls, and clipboard data, using pasteClipboard(). | ||
76 | * @return a string suitable for QAction::setText, or an empty string if pasting | 83 | * @return a string suitable for QAction::setText, or an empty string if pasting | ||
77 | * isn't possible right now. | 84 | * isn't possible right now. | ||
78 | * @deprecated since 5.4, use pasteActionText(const QMimeData *, bool*, const KFileItem &) | 85 | * @deprecated since 5.4, use pasteActionText(const QMimeData *, bool*, const KFileItem &) | ||
79 | */ | 86 | */ | ||
80 | KIOWIDGETS_DEPRECATED_EXPORT QString pasteActionText(); | 87 | KIOWIDGETS_DEPRECATED_VERSION(5, 4, "Use KIO::pasteActionText(const QMimeData *, bool*, const KFileItem &)") | ||
88 | KIOWIDGETS_EXPORT QString pasteActionText(); | ||||
89 | #endif | ||||
81 | 90 | | |||
82 | /** | 91 | /** | ||
83 | * Returns the text to use for the Paste action, when the application supports | 92 | * Returns the text to use for the Paste action, when the application supports | ||
84 | * pasting files, urls, and clipboard data, using pasteClipboard(). | 93 | * pasting files, urls, and clipboard data, using pasteClipboard(). | ||
85 | * @param mimeData the mime data, usually QApplication::clipboard()->mimeData(). | 94 | * @param mimeData the mime data, usually QApplication::clipboard()->mimeData(). | ||
86 | * @param enable output parameter, to be passed to QAction::setEnabled. | 95 | * @param enable output parameter, to be passed to QAction::setEnabled. | ||
87 | * The pointer must be non-null, and in return the function will always set its value. | 96 | * The pointer must be non-null, and in return the function will always set its value. | ||
88 | * @param destItem item representing the directory into which the clipboard data | 97 | * @param destItem item representing the directory into which the clipboard data | ||
Show All 24 Lines |