KIO

mimetypejob.h
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
A MimetypeJob is a TransferJob that allows you to get the MIME type of a URL.
Definition mimetypejob.h:27
The transfer job pumps data into and/or out of a KIO worker.
Definition transferjob.h:26
A namespace for KIO globals.
KIOCORE_EXPORT MimetypeJob * mimetype(const QUrl &url, JobFlags flags=DefaultFlags)
Find MIME type for one file or directory.
@ DefaultFlags
Show the progress info GUI, no Resume and no Overwrite.
Definition job_base.h:246
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.