| 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 | |
| 14 | namespace KIO |
| 15 | { |
| 16 | class SpecialJobPrivate; |
| 17 | |
| 18 | /*! |
| 19 | * \class KIO::SpecialJob |
| 20 | * \inheaderfile KIO/SpecialJob |
| 21 | * \inmodule KIOCore |
| 22 | * |
| 23 | * \brief A class that sends a special command to a KIO worker. |
| 24 | * |
| 25 | * This allows you to send a binary blob to a worker and handle |
| 26 | * its responses. The worker will receive the binary data as an |
| 27 | * argument to the "special" function (inherited from WorkerBase::special()). |
| 28 | * |
| 29 | * Use this only on KIO workers that belong to your application. Sending |
| 30 | * special commands to other workers may cause unexpected behaviour. |
| 31 | * |
| 32 | * \sa KIO::special |
| 33 | */ |
| 34 | class KIOCORE_EXPORT SpecialJob : public TransferJob |
| 35 | { |
| 36 | Q_OBJECT |
| 37 | public: |
| 38 | /*! |
| 39 | * Creates a KIO::SpecialJob. |
| 40 | * |
| 41 | * \a url the URL to be passed to the worker |
| 42 | * |
| 43 | * \a data the data to be sent to the WorkerBase::special() function. |
| 44 | */ |
| 45 | explicit SpecialJob(const QUrl &url, const QByteArray &data = QByteArray()); |
| 46 | |
| 47 | /*! |
| 48 | * Sets the QByteArray that is passed to WorkerBase::special() on |
| 49 | * the worker. |
| 50 | */ |
| 51 | void setArguments(const QByteArray &data); |
| 52 | |
| 53 | /*! |
| 54 | * Returns the QByteArray data that will be sent (or has been sent) to the |
| 55 | * worker. |
| 56 | */ |
| 57 | QByteArray arguments() const; |
| 58 | |
| 59 | public: |
| 60 | ~SpecialJob() override; |
| 61 | |
| 62 | private: |
| 63 | Q_DECLARE_PRIVATE(SpecialJob) |
| 64 | }; |
| 65 | |
| 66 | } |
| 67 | |
| 68 | #endif |
| 69 | |