KIO

statjob.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2000 Stephan Kulow <[email protected]>
4  SPDX-FileCopyrightText: 2000-2013 David Faure <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KIO_STATJOB_H
10 #define KIO_STATJOB_H
11 
12 #include "global.h"
13 #include "simplejob.h"
14 #include <kio/udsentry.h>
15 
16 namespace KIO
17 {
18 
19 class StatJobPrivate;
26 class KIOCORE_EXPORT StatJob : public SimpleJob
27 {
28 
29  Q_OBJECT
30 
31 public:
32  enum StatSide {
33  SourceSide,
34  DestinationSide
35  };
36 
37  ~StatJob() override;
38 
47  void setSide(StatSide side);
48 
49 #if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0)
50 
58  KIOCORE_DEPRECATED_VERSION(4, 0, "Use StatJob::setSide(StatSide)")
59  void setSide(bool source);
60 #endif
61 
66  void setDetails(KIO::StatDetails details);
67 
68 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 69)
69 
73  void setDetails(KIO::StatDetail detail);
74 
85  KIOCORE_DEPRECATED_VERSION(5, 69, "Use setDetails(KIO::statDetails)")
86  void setDetails(short int details);
87 #endif
88 
95  const UDSEntry &statResult() const;
96 
129  QUrl mostLocalUrl() const;
130 
131 Q_SIGNALS:
139  void redirection(KIO::Job *job, const QUrl &url);
140 
148  void permanentRedirection(KIO::Job *job, const QUrl &fromUrl, const QUrl &toUrl);
149 
150 protected Q_SLOTS:
151  void slotFinished() override;
152  void slotMetaData(const KIO::MetaData &_metaData) override;
153 protected:
154  StatJob(StatJobPrivate &dd);
155 
156 private:
157  Q_PRIVATE_SLOT(d_func(), void slotStatEntry(const KIO::UDSEntry &entry))
158  Q_PRIVATE_SLOT(d_func(), void slotRedirection(const QUrl &url))
159  Q_DECLARE_PRIVATE(StatJob)
160  friend KIOCORE_EXPORT StatJob *mostLocalUrl(const QUrl &url, JobFlags flags);
161 };
162 
170 KIOCORE_EXPORT StatJob *stat(const QUrl &url, JobFlags flags = DefaultFlags);
195 KIOCORE_EXPORT StatJob *statDetails(const QUrl &url, KIO::StatJob::StatSide side,
197 
198 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 69)
199 
227 KIOCORE_DEPRECATED_VERSION(5, 69, "Use KIO::statDetails(const QUrl &, KIO::StatJob::StatSide, KIO::StatDetails, JobFlags)")
228 KIOCORE_EXPORT StatJob *stat(const QUrl &url, KIO::StatJob::StatSide side,
229  short int details, JobFlags flags = DefaultFlags);
230 #endif
231 
232 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 69)
233 
239 KIOCORE_DEPRECATED_VERSION(5, 69, "Use directly KIO::StatDetails")
240 KIOCORE_EXPORT KIO::StatDetails detailsToStatDetails(int details);
241 #endif
242 
243 #if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0)
244 
272 KIOCORE_DEPRECATED_VERSION(4, 0, "Use KIO::stat(const QUrl &, KIO::StatJob::StatSide, short int, JobFlags)")
273 KIOCORE_EXPORT StatJob *stat(const QUrl &url, bool sideIsSource,
274  short int details, JobFlags flags = DefaultFlags);
275 #endif
276 
321 KIOCORE_EXPORT StatJob *mostLocalUrl(const QUrl &url, JobFlags flags = DefaultFlags);
322 
323 }
324 
325 #endif
Universal Directory Service.
Definition: udsentry.h:77
A namespace for KIO globals.
Definition: authinfo.h:21
A KIO job that retrieves information about a file or directory.
Definition: statjob.h:26
MetaData is a simple map of key/value strings.
Definition: metadata.h:23
Show the progress info GUI, no Resume and no Overwrite.
Definition: job_base.h:270
KIOCORE_EXPORT KIO::StatDetails detailsToStatDetails(int details)
Converts the legacy stat details int to a StatDetail Flag.
Definition: statjob.cpp:95
StatDetail
Describes the fields that a stat command will retrieve.
Definition: global.h:310
The base class for all jobs.
Definition: job_base.h:45
Default value includes fields provided by other entries.
Definition: global.h:329
KIOCORE_EXPORT StatJob * mostLocalUrl(const QUrl &url, JobFlags flags=DefaultFlags)
Tries to map a local URL for the given URL, using a KIO job.
Definition: statjob.cpp:235
KIOCORE_EXPORT StatJob * stat(const QUrl &url, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition: statjob.cpp:209
KIOCORE_EXPORT StatJob * statDetails(const QUrl &url, KIO::StatJob::StatSide side, KIO::StatDetails details=KIO::StatDefaultDetails, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition: statjob.cpp:257
A simple job (one url and one command).
Definition: simplejob.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 23:01:47 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.