KIO

jobuidelegateextension.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Stephan Kulow <[email protected]>
3  Copyright (C) 2000-2013 David Faure <[email protected]>
4  Copyright (C) 2006 Kevin Ottens <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KIO_JOBUIDELEGATEEXTENSION_H
23 #define KIO_JOBUIDELEGATEEXTENSION_H
24 
25 #include "kiocore_export.h"
26 #include <kio/global.h>
27 #include <QDateTime>
28 
29 class KJob;
30 namespace KIO
31 {
32 class Job;
33 class ClipboardUpdater;
34 
47 };
52 
53 // For compat
54 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
55 
58 enum {
59  M_OVERWRITE = RenameDialog_Overwrite,
60  M_OVERWRITE_ITSELF = RenameDialog_OverwriteItself,
61  M_SKIP = RenameDialog_Skip,
63  M_RESUME = RenameDialog_Resume,
64  M_NORENAME = RenameDialog_NoRename,
65  M_ISDIR = RenameDialog_IsDirectory
66 };
70 KIOCORE_DEPRECATED_VERSION(5, 0, "Use KIO::RenameDialog_Options")
72 #endif
73 
81  SkipDialog_MultipleItems = 8
82 };
87 
88 
92  Result_Cancel = 0,
93  Result_Rename = 1,
94  Result_Skip = 2,
95  Result_AutoSkip = 3,
96  Result_Overwrite = 4,
97  Result_OverwriteAll = 5,
98  Result_Resume = 6,
99  Result_ResumeAll = 7,
100  Result_AutoRename = 8,
101  Result_Retry = 9,
102 
103  // @deprecated since 5.0, use the undeprecated enum values
104 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
105  R_CANCEL = Result_Cancel,
106  R_RENAME = Result_Rename,
107  R_SKIP = Result_Skip,
108  R_AUTO_SKIP = Result_AutoSkip,
109  R_OVERWRITE = Result_Overwrite,
110  R_OVERWRITE_ALL = Result_OverwriteAll,
111  R_RESUME = Result_Resume,
112  R_RESUME_ALL = Result_ResumeAll,
113  R_AUTO_RENAME = Result_AutoRename,
114  R_RETRY = Result_Retry,
115 
116  S_CANCEL = Result_Cancel,
117  S_SKIP = Result_Skip,
118  S_AUTO_SKIP = Result_AutoSkip,
119  S_RETRY = Result_Retry
120 #endif
121 };
123 
134 class KIOCORE_EXPORT JobUiDelegateExtension
135 {
136 protected:
141 
145  virtual ~JobUiDelegateExtension();
146 
147 public:
148 
168  virtual KIO::RenameDialog_Result askFileRename(KJob *job,
169  const QString &caption,
170  const QUrl &src,
171  const QUrl &dest,
173  QString &newDest,
174  KIO::filesize_t sizeSrc = KIO::filesize_t(-1),
175  KIO::filesize_t sizeDest = KIO::filesize_t(-1),
176  const QDateTime &ctimeSrc = QDateTime(),
177  const QDateTime &ctimeDest = QDateTime(),
178  const QDateTime &mtimeSrc = QDateTime(),
179  const QDateTime &mtimeDest = QDateTime()) = 0;
180 
185  virtual KIO::SkipDialog_Result askSkip(KJob *job,
186  KIO::SkipDialog_Options options,
187  const QString &error_text) = 0;
188 
194  enum DeletionType { Delete, Trash, EmptyTrash };
201  enum ConfirmationType { DefaultConfirmation, ForceConfirmation };
214  virtual bool askDeleteConfirmation(const QList<QUrl> &urls, DeletionType deletionType,
215  ConfirmationType confirmationType) = 0;
216 
225  QuestionYesNo = 1,
226  WarningYesNo = 2,
227  WarningContinueCancel = 3,
228  WarningYesNoCancel = 4,
229  Information = 5,
230  SSLMessageBox = 6,
231  //In KMessageBox::DialogType; Sorry = 7, Error = 8, QuestionYesNoCancel = 9
232  WarningContinueCancelDetailed = 10,
233  };
234 
248  virtual int requestMessageBox(MessageBoxType type, const QString &text,
249  const QString &caption,
250  const QString &buttonYes,
251  const QString &buttonNo,
252  const QString &iconYes = QString(),
253  const QString &iconNo = QString(),
254  const QString &dontAskAgainName = QString(),
255  const KIO::MetaData &sslMetaData = KIO::MetaData()) = 0;
256 
257  enum ClipboardUpdaterMode {
258  UpdateContent,
259  OverwriteContent,
260  RemoveContent
261  };
262 
266  virtual ClipboardUpdater *createClipboardUpdater(Job *job, ClipboardUpdaterMode mode);
270  virtual void updateUrlInClipboard(const QUrl &src, const QUrl &dest);
271 
272  // TODO KF6: add virtual_hook
273 
274 private:
275  class Private;
276  Private *const d;
277 };
278 
285 
291 KIOCORE_EXPORT void setDefaultJobUiDelegateExtension(JobUiDelegateExtension *extension);
292 
293 } // namespace KIO
294 
295 Q_DECLARE_OPERATORS_FOR_FLAGS(KIO::RenameDialog_Options)
296 Q_DECLARE_OPERATORS_FOR_FLAGS(KIO::SkipDialog_Options)
297 
298 #endif
The destination is a directory, the dialog updates labels and tooltips accordingly.
qulonglong filesize_t
64-bit file size
Definition: global.h:51
DeletionType
The type of deletion: real deletion, moving the files to the trash or emptying the trash Used by askD...
A namespace for KIO globals.
Definition: authinfo.h:34
Offer a "Resume" button (plus "Resume All" if RenameDialog_MultipleItems).
Warn that the current operation would overwrite a file with itself, which is not allowed.
KIOCORE_EXPORT void setDefaultJobUiDelegateExtension(JobUiDelegateExtension *extension)
Internal.
MetaData is a simple map of key/value strings.
Definition: metadata.h:34
Don&#39;t offer a "Rename" button.
ConfirmationType
ForceConfirmation: always ask the user for confirmation DefaultConfirmation: don&#39;t ask the user if he...
An abstract class defining interaction with users from KIO jobs:
Offer a "Skip" button, to skip other files too. Requires RenameDialog_MultipleItems.
KIOCORE_EXPORT JobUiDelegateExtension * defaultJobUiDelegateExtension()
Returns the default job UI delegate extension to be used by all KIO jobs (in which HideProgressInfo i...
SkipDialog_Option
SkipDialog_MultipleItems: Set if the current operation concerns multiple files, so it makes sense to ...
RenameDialog_Result
The result of a rename or skip dialog.
The base class for all jobs.
Definition: job_base.h:57
Set if the current operation concerns multiple files, so it makes sense to offer buttons that apply t...
We have an existing destination, show details about it and offer to overwrite it. ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 11 2020 23:00:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.