KIO

specialjob.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_SPECIALJOB_H
10 #define KIO_SPECIALJOB_H
11 
12 #include "transferjob.h"
13 
14 namespace KIO
15 {
16 class SpecialJobPrivate;
17 
18 /**
19  * @class KIO::SpecialJob specialjob.h <KIO/SpecialJob>
20  *
21  * A class that sends a special command to a KIO worker.
22  * This allows you to send a binary blob to a worker and handle
23  * its responses. The worker will receive the binary data as an
24  * argument to the "special" function (inherited from WorkerBase::special()).
25  *
26  * Use this only on KIO workers that belong to your application. Sending
27  * special commands to other workers may cause unexpected behaviour.
28  *
29  * @see KIO::special
30  */
31 class KIOCORE_EXPORT SpecialJob : public TransferJob
32 {
33  Q_OBJECT
34 public:
35  /**
36  * Creates a KIO::SpecialJob.
37  *
38  * @param url the URL to be passed to the worker
39  * @param data the data to be sent to the WorkerBase::special() function.
40  */
41  explicit SpecialJob(const QUrl &url, const QByteArray &data = QByteArray());
42 
43  /**
44  * Sets the QByteArray that is passed to WorkerBase::special() on
45  * the worker.
46  */
47  void setArguments(const QByteArray &data);
48 
49  /**
50  * Returns the QByteArray data that will be sent (or has been sent) to the
51  * worker.
52  */
53  QByteArray arguments() const;
54 
55 public:
56  ~SpecialJob() override;
57 
58 private:
59  Q_DECLARE_PRIVATE(SpecialJob)
60 };
61 
62 }
63 
64 #endif
A namespace for KIO globals.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:00:02 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.