| 1 | /* |
| 2 | This file is part of the KDE libraries |
| 3 | SPDX-FileCopyrightText: 2000 Stephan Kulow <coolo@kde.org> |
| 4 | SPDX-FileCopyrightText: 2000-2009 David Faure <faure@kde.org> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 7 | */ |
| 8 | |
| 9 | #ifndef KIO_MIMETYPEJOB_H |
| 10 | #define KIO_MIMETYPEJOB_H |
| 11 | |
| 12 | #include "transferjob.h" |
| 13 | #include <kio/global.h> // filesize_t |
| 14 | |
| 15 | namespace KIO |
| 16 | { |
| 17 | class MimetypeJobPrivate; |
| 18 | /*! |
| 19 | * \class KIO::MimetypeJob |
| 20 | * \inheaderfile KIO/MimetypeJob |
| 21 | * \inmodule KIOCore |
| 22 | * |
| 23 | * A MimetypeJob is a TransferJob that allows you to get |
| 24 | * the MIME type of a URL. Don't create directly, |
| 25 | * but use KIO::mimetype() instead. |
| 26 | * |
| 27 | * \sa KIO::mimetype() |
| 28 | */ |
| 29 | class KIOCORE_EXPORT MimetypeJob : public TransferJob |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | |
| 33 | public: |
| 34 | ~MimetypeJob() override; |
| 35 | |
| 36 | protected Q_SLOTS: |
| 37 | void slotFinished() override; |
| 38 | |
| 39 | protected: |
| 40 | KIOCORE_NO_EXPORT explicit MimetypeJob(MimetypeJobPrivate &dd); |
| 41 | |
| 42 | private: |
| 43 | Q_DECLARE_PRIVATE(MimetypeJob) |
| 44 | }; |
| 45 | |
| 46 | /*! |
| 47 | * \relates KIO::MimetypeJob |
| 48 | * |
| 49 | * Find MIME type for one file or directory. |
| 50 | * |
| 51 | * If you are going to download the file right after determining its MIME type, |
| 52 | * then don't use this, prefer using a KIO::get() job instead. See the note |
| 53 | * about putting the job on hold once the MIME type is determined. |
| 54 | * |
| 55 | * \a url the URL of the file |
| 56 | * |
| 57 | * \a flags Can be HideProgressInfo here |
| 58 | * |
| 59 | * Returns the job handling the operation. |
| 60 | */ |
| 61 | KIOCORE_EXPORT MimetypeJob *mimetype(const QUrl &url, JobFlags flags = DefaultFlags); |
| 62 | |
| 63 | } |
| 64 | |
| 65 | #endif |
| 66 | |