Warning, file /include/QtCore/qmimetype.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 QMIMETYPE_H
0006 #define QMIMETYPE_H
0007
0008 #include <QtCore/qglobal.h>
0009
0010 QT_REQUIRE_CONFIG(mimetype);
0011
0012 #include <QtCore/qobjectdefs.h>
0013 #include <QtCore/qshareddata.h>
0014 #include <QtCore/qstring.h>
0015 #include <QtCore/qstringlist.h>
0016
0017 QT_BEGIN_NAMESPACE
0018
0019 class QMimeTypePrivate;
0020 class QMimeType;
0021
0022 Q_CORE_EXPORT size_t qHash(const QMimeType &key, size_t seed = 0) noexcept;
0023
0024 class Q_CORE_EXPORT QMimeType
0025 {
0026 Q_GADGET
0027 Q_PROPERTY(bool valid READ isValid CONSTANT)
0028 Q_PROPERTY(bool isDefault READ isDefault CONSTANT)
0029 Q_PROPERTY(QString name READ name CONSTANT)
0030 Q_PROPERTY(QString comment READ comment CONSTANT)
0031 Q_PROPERTY(QString genericIconName READ genericIconName CONSTANT)
0032 Q_PROPERTY(QString iconName READ iconName CONSTANT)
0033 Q_PROPERTY(QStringList globPatterns READ globPatterns CONSTANT)
0034 Q_PROPERTY(QStringList parentMimeTypes READ parentMimeTypes CONSTANT)
0035 Q_PROPERTY(QStringList allAncestors READ allAncestors CONSTANT)
0036 Q_PROPERTY(QStringList aliases READ aliases CONSTANT)
0037 Q_PROPERTY(QStringList suffixes READ suffixes CONSTANT)
0038 Q_PROPERTY(QString preferredSuffix READ preferredSuffix CONSTANT)
0039 Q_PROPERTY(QString filterString READ filterString CONSTANT)
0040
0041 public:
0042 QMimeType();
0043 QMimeType(const QMimeType &other);
0044 QMimeType &operator=(const QMimeType &other);
0045 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QMimeType)
0046 void swap(QMimeType &other) noexcept
0047 {
0048 d.swap(other.d);
0049 }
0050 explicit QMimeType(const QMimeTypePrivate &dd);
0051 ~QMimeType();
0052
0053 bool operator==(const QMimeType &other) const;
0054
0055 inline bool operator!=(const QMimeType &other) const
0056 {
0057 return !operator==(other);
0058 }
0059
0060 bool isValid() const;
0061
0062 bool isDefault() const;
0063
0064 QString name() const;
0065 QString comment() const;
0066 QString genericIconName() const;
0067 QString iconName() const;
0068 QStringList globPatterns() const;
0069 QStringList parentMimeTypes() const;
0070 QStringList allAncestors() const;
0071 QStringList aliases() const;
0072 QStringList suffixes() const;
0073 QString preferredSuffix() const;
0074
0075 Q_INVOKABLE bool inherits(const QString &mimeTypeName) const;
0076
0077 QString filterString() const;
0078
0079 protected:
0080 friend class QMimeTypeParserBase;
0081 friend class MimeTypeMapEntry;
0082 friend class QMimeDatabasePrivate;
0083 friend class QMimeXMLProvider;
0084 friend class QMimeBinaryProvider;
0085 friend class QMimeTypePrivate;
0086 friend Q_CORE_EXPORT size_t qHash(const QMimeType &key, size_t seed) noexcept;
0087
0088 QExplicitlySharedDataPointer<QMimeTypePrivate> d;
0089 };
0090
0091 Q_DECLARE_SHARED(QMimeType)
0092
0093 #ifndef QT_NO_DEBUG_STREAM
0094 class QDebug;
0095 Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QMimeType &mime);
0096 #endif
0097
0098 QT_END_NAMESPACE
0099
0100 #endif