ukui-notification/libukui-notification/notification-settings/settings-properties-info.h

71 lines
1.7 KiB
C++

//
//
//
#ifndef SETTINGS_PROPERTIES_INFO_H
#define SETTINGS_PROPERTIES_INFO_H
#include <QString>
#include <QVariant>
#include <QObject>
#include "settings-properties.h"
#include <memory>
namespace UkuiNotification {
class SettingsPropertiesInfoPrivate;
/**
* \class SettingsPropertiesInfo SettingsPropertiesInfo.h
*/
class Q_DECL_IMPORT SettingsPropertiesInfo : public QObject
{
Q_OBJECT
public:
SettingsPropertiesInfo();
SettingsPropertiesInfo(SettingsProperty::Property property);
SettingsPropertiesInfo(const SettingsPropertiesInfo& pi);
~SettingsPropertiesInfo();
SettingsPropertiesInfo& operator=(const SettingsPropertiesInfo& rhs);
bool operator==(const SettingsPropertiesInfo& rhs) const;
/**
* The enumeration which represents this property
*/
SettingsProperty::Property property() const;
/**
* The internal unique name used to refer to the property
*/
QString name() const;
/**
* A user visible name of the property
*/
QString displayName() const;
/**
* The type the value of this property should be.
* Eg - Property::Height should be an integer
*/
QMetaType::Type valueType() const;
QString defaultValue() const;
QString valueToString(const QVariant &value) const;
/**
* Construct a SettingsPropertiesInfo from the internal property name.
* The internal property name is case insensitive
*/
static SettingsPropertiesInfo fromName(const QString& name);
private:
const std::unique_ptr<SettingsPropertiesInfoPrivate> d;
};
} // namespace
Q_DECLARE_METATYPE(UkuiNotification::SettingsPropertiesInfo)
#endif // SETTINGS_PROPERTIES_INFO_H