summaryrefslogtreecommitdiffstats
path: root/src/mimetypes/mimetype.h
blob: eaa183f42296f4586ab2aab648851fb213b83d08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef MIME_TYPE_H_INCLUDED
#define MIME_TYPE_H_INCLUDED

#include <QtCore/QScopedPointer>

class QMimeTypePrivate;

class QString;

template<typename T>
class QList;

// ------------------------------------------------------------------------------------------------

// A temporary solution in case the type changes until the final release:
typedef QString QMimeTypeName;

// ------------------------------------------------------------------------------------------------

class QMimeType
{
public:
    QMimeType();
    QMimeType(const QMimeTypeName &theName,
              const QString &theDisplayName,
              const QString &theIconUrl,
              const QList<QString> &theFileExtentions);
    QMimeType(const QMimeType &other);
    QMimeType &operator=(const QMimeType &other);
    ~QMimeType();

    bool operator==(const QMimeType &other) const;

    inline bool operator!=(const QMimeType &other) const
    {
        return !operator==(other);
    }

    bool isValid() const;

    const QMimeTypeName &name() const;
    const QString &displayName() const;
    const QString &iconUrl() const;
    const QList<QString> &fileExtentions() const;

private:
    QScopedPointer<QMimeTypePrivate> d_ptr;
};

#endif