KFileMetaData

typeinfo.h
1/*
2 SPDX-FileCopyrightText: 2014 Vishesh Handa <me@vhanda.in>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KFILEMETADATA_TYPEINFO_H
8#define KFILEMETADATA_TYPEINFO_H
9
10#include "types.h"
11#include "kfilemetadata_export.h"
12#include <QString>
13#include <QVariant>
14
15namespace KFileMetaData {
16
17class TypeInfoPrivate;
18/**
19 * \class TypeInfo typeinfo.h <KFileMetaData/TypeInfo>
20
21 * The TypeInfo class can be used to obtain a rough type
22 * classification for a file.
23 *
24 * It is somewhat related to the MIME "<type>/<subtype>"
25 * classification, but provides additional types, e.g.
26 * MIME does not provide a generic "Archive" type.
27 *
28 * \sa <KFileMetaData/Types>
29 */
30class KFILEMETADATA_EXPORT TypeInfo
31{
32public:
33 TypeInfo();
34 TypeInfo(Type::Type type);
35 TypeInfo(const TypeInfo& ti);
36 ~TypeInfo();
37
38 TypeInfo& operator=(const TypeInfo& rhs);
39
40 /*
41 * @since 5.91
42 */
43 bool operator==(const TypeInfo& rhs) const;
44
45 /**
46 * The type identifier
47 */
48 Type::Type type() const;
49
50 /**
51 * An internal unique name for the type
52 */
53 QString name() const;
54
55 /**
56 * A user visible translated name for this type
57 */
58 QString displayName() const;
59
60 /**
61 * Construct a TypeInfo from the internal type name.
62 * The internal type name is case insensitive
63 */
64 static TypeInfo fromName(const QString& name);
65
66 /**
67 * Get all supported property names
68 */
69 static QStringList allNames();
70
71private:
72 const TypeInfoPrivate* d;
73};
74
75} // namespace
76Q_DECLARE_METATYPE(KFileMetaData::TypeInfo)
77
78#endif // KFILEMETADATA_TYPEINFO_H
The TypeInfo class can be used to obtain a rough type classification for a file.
Definition typeinfo.h:31
Type
A Type represents a way to represent a way to group files based on a higher level view,...
Definition types.h:29
The KFileMetaData namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.