Warning, file /include/QtCore/qmimedatabase.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005 #ifndef QMIMEDATABASE_H
0006 #define QMIMEDATABASE_H
0007
0008 #include <QtCore/qmimetype.h>
0009
0010 QT_REQUIRE_CONFIG(mimetype);
0011
0012 #include <QtCore/qstringlist.h>
0013
0014 QT_BEGIN_NAMESPACE
0015
0016 class QByteArray;
0017 class QFileInfo;
0018 class QIODevice;
0019 class QUrl;
0020
0021 class QMimeDatabasePrivate;
0022 class Q_CORE_EXPORT QMimeDatabase
0023 {
0024 Q_DISABLE_COPY(QMimeDatabase)
0025
0026 public:
0027 QMimeDatabase();
0028 ~QMimeDatabase();
0029
0030 QMimeType mimeTypeForName(const QString &nameOrAlias) const;
0031
0032 enum MatchMode {
0033 MatchDefault = 0x0,
0034 MatchExtension = 0x1,
0035 MatchContent = 0x2
0036 };
0037
0038 QMimeType mimeTypeForFile(const QString &fileName, MatchMode mode = MatchDefault) const;
0039 QMimeType mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mode = MatchDefault) const;
0040 QList<QMimeType> mimeTypesForFileName(const QString &fileName) const;
0041
0042 QMimeType mimeTypeForData(const QByteArray &data) const;
0043 QMimeType mimeTypeForData(QIODevice *device) const;
0044
0045 QMimeType mimeTypeForUrl(const QUrl &url) const;
0046 QMimeType mimeTypeForFileNameAndData(const QString &fileName, QIODevice *device) const;
0047 QMimeType mimeTypeForFileNameAndData(const QString &fileName, const QByteArray &data) const;
0048
0049 QString suffixForFileName(const QString &fileName) const;
0050
0051 QList<QMimeType> allMimeTypes() const;
0052
0053 private:
0054 QMimeDatabasePrivate *d;
0055 };
0056
0057 QT_END_NAMESPACE
0058
0059 #endif