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
15namespace KIO
16{
17class MimetypeJobPrivate;
18/**
19 * @class KIO::MimetypeJob mimetypejob.h <KIO/MimetypeJob>
20 *
21 * A MimetypeJob is a TransferJob that allows you to get
22 * the MIME type of a URL. Don't create directly,
23 * but use KIO::mimetype() instead.
24 * @see KIO::mimetype()
25 */
26class KIOCORE_EXPORT MimetypeJob : public TransferJob
27{
28 Q_OBJECT
29
30public:
31 ~MimetypeJob() override;
32
33protected Q_SLOTS:
34 void slotFinished() override;
35
36protected:
37 KIOCORE_NO_EXPORT explicit MimetypeJob(MimetypeJobPrivate &dd);
38
39private:
40 Q_DECLARE_PRIVATE(MimetypeJob)
41};
42
43/**
44 * Find MIME type for one file or directory.
45 *
46 * If you are going to download the file right after determining its MIME type,
47 * then don't use this, prefer using a KIO::get() job instead. See the note
48 * about putting the job on hold once the MIME type is determined.
49 *
50 * @param url the URL of the file
51 * @param flags Can be HideProgressInfo here
52 * @return the job handling the operation.
53 */
54KIOCORE_EXPORT MimetypeJob *mimetype(const QUrl &url, JobFlags flags = DefaultFlags);
55
56}
57
58#endif
59

source code of kio/src/core/mimetypejob.h