KFileMetaData 5.109.0
propertyinfo.h
1/*
2 This file is part of the KFileMetaData project
3 SPDX-FileCopyrightText: 2014 Vishesh Handa <me@vhanda.in>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef _KFILEMETADATA_PROPERTYINFO_H
9#define _KFILEMETADATA_PROPERTYINFO_H
10
11#include <QString>
12#include <QVariant>
13#include "properties.h"
14#include "kfilemetadata_export.h"
15
16namespace KFileMetaData {
17
18class PropertyInfoData;
27class KFILEMETADATA_EXPORT PropertyInfo
28{
29public:
32 PropertyInfo(const PropertyInfo& pi);
34
35 PropertyInfo& operator=(const PropertyInfo& rhs);
36 bool operator==(const PropertyInfo& rhs) const;
37
42
46 QString name() const;
47
55 QString displayName() const;
56
61 QVariant::Type valueType() const;
62
71 bool shouldBeIndexed() const;
72
77 static PropertyInfo fromName(const QString& name);
78
83 static QStringList allNames();
84
90 QString formatAsDisplayString(const QVariant& value) const;
91
92private:
93 const PropertyInfoData* d;
94};
95
96} // namespace
97Q_DECLARE_METATYPE(KFileMetaData::PropertyInfo)
98
99
100#endif // _KFILEMETADATA_PROPERTYINFO_H
The PropertyInfo class can be used to obtain extra information about any property.
Definition propertyinfo.h:28
QString formatAsDisplayString(const QVariant &value) const
Returns the value of the property as a QString with added formatting, added units if needed,...
bool shouldBeIndexed() const
Indicates if this property requires indexing or should just be stored.
QVariant::Type valueType() const
The type the value of this property should be.
QString displayName() const
A user visible name of the property.
static PropertyInfo fromName(const QString &name)
Construct a PropertyInfo from the internal property name.
Property::Property property() const
The enumeration which represents this property.
static QStringList allNames()
Get all supported property names.
QString name() const
The internal unique name used to refer to the property.
<KFileMetaData/Properties>
Property
The Property enum contains all files property types that KFileMetaData manipulates.
Definition properties.h:25