KIO

job_base.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2000 Stephan Kulow <[email protected]>
4  SPDX-FileCopyrightText: 2000-2009 David Faure <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KIO_JOB_BASE_H
10 #define KIO_JOB_BASE_H
11 
12 #include <KCompositeJob>
13 #include <kio/metadata.h>
14 
15 namespace KIO
16 {
17 
18 class JobUiDelegateExtension;
19 
20 class JobPrivate;
45 class KIOCORE_EXPORT Job : public KCompositeJob
46 {
47  Q_OBJECT
48 
49 protected:
50  Job();
51  Job(JobPrivate &dd);
52 
53 public:
54  virtual ~Job();
55  void start() override {} // Since KIO autostarts its jobs
56 
57 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
58 
65  KIOCORE_DEPRECATED_VERSION(5, 0, "Use KJob::uiDelegate()")
66  KJobUiDelegate *ui() const;
67 #endif
68 
73  JobUiDelegateExtension *uiDelegateExtension() const;
74 
79  void setUiDelegateExtension(JobUiDelegateExtension *extension);
80 
81 protected:
87  bool doKill() override;
88 
93  bool doSuspend() override;
94 
99  bool doResume() override;
100 
101 public:
119  QString errorString() const override;
120 
131  QStringList detailedErrorStrings(const QUrl *reqUrl = nullptr,
132  int method = -1) const;
133 
143  void setParentJob(Job *parentJob);
144 
150  Job *parentJob() const;
151 
159  void setMetaData(const KIO::MetaData &metaData);
160 
168  void addMetaData(const QString &key, const QString &value);
169 
177  void addMetaData(const QMap<QString, QString> &values);
178 
186  void mergeMetaData(const QMap<QString, QString> &values);
187 
191  MetaData outgoingMetaData() const;
192 
198  MetaData metaData() const;
199 
207  QString queryMetaData(const QString &key);
208 
209 protected:
210 
211 Q_SIGNALS:
212 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
213 
220  KIOCORE_DEPRECATED_VERSION(5, 0, "Do not use")
221  void canceled(KJob *job);
222 #endif
223 
230  void connected(KIO::Job *job);
231 
232 protected:
240  bool addSubjob(KJob *job) override;
241 
251  bool removeSubjob(KJob *job) override;
252 
253 protected:
254  JobPrivate *const d_ptr;
255 
256 private:
257  Q_DECLARE_PRIVATE(Job)
258 };
259 
266 enum JobFlag {
271 
276 
284  Resume = 2,
285 
292 
301 };
305 Q_DECLARE_FLAGS(JobFlags, JobFlag)
306 Q_DECLARE_OPERATORS_FOR_FLAGS(JobFlags)
307 
308 enum LoadType { Reload, NoReload };
309 
310 }
311 
312 #endif
When set, automatically overwrite the destination if it exists already.
Definition: job_base.h:291
A namespace for KIO globals.
Definition: authinfo.h:21
Hide progress information dialog, i.e.
Definition: job_base.h:275
JobFlag
Flags for the job properties.
Definition: job_base.h:266
MetaData is a simple map of key/value strings.
Definition: metadata.h:23
QVector< V > values(const QMultiHash< K, V > &c)
Show the progress info GUI, no Resume and no Overwrite.
Definition: job_base.h:270
When set, notifies the slave that application/job does not want privilege execution.
Definition: job_base.h:300
When set, automatically append to the destination file if it exists already.
Definition: job_base.h:284
An abstract class defining interaction with users from KIO jobs:
The base class for all jobs.
Definition: job_base.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 23:01:39 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.