KIO

specialjob.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2000 Stephan Kulow <coolo@kde.org>
4 SPDX-FileCopyrightText: 2000-2013 David Faure <faure@kde.org>
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
14namespace KIO
15{
16class 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 */
31class KIOCORE_EXPORT SpecialJob : public TransferJob
32{
33 Q_OBJECT
34public:
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
55public:
56 ~SpecialJob() override;
57
58private:
59 Q_DECLARE_PRIVATE(SpecialJob)
60};
61
62}
63
64#endif
A class that sends a special command to a KIO worker.
The transfer job pumps data into and/or out of a KIO worker.
A namespace for KIO globals.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:57:19 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.