20 #ifndef LIBREPCB_CORE_ATTRIBUTETYPE_H 21 #define LIBREPCB_CORE_ATTRIBUTETYPE_H 63 const QString& typeNameTr) noexcept;
77 virtual bool isValueValid(
const QString& value)
const noexcept = 0;
78 virtual QString
valueFromTr(
const QString& value)
const noexcept = 0;
84 static QList<const AttributeType*>
getAllTypes() noexcept;
static const AttributeType & fromString(const QString &type)
Definition: attributetype.cpp:119
const QString & getNameTr() const noexcept
Definition: attributetype.h:69
const QString & getName() const noexcept
Definition: attributetype.h:68
const QList< const AttributeUnit * > & getAvailableUnits() const noexcept
Definition: attributetype.h:70
Definition: occmodel.cpp:76
const AttributeUnit * getDefaultUnit() const noexcept
Definition: attributetype.h:74
AttributeType & operator=(const AttributeType &rhs)=delete
static QList< const AttributeType * > getAllTypes() noexcept
Definition: attributetype.cpp:106
QList< const AttributeUnit * > mAvailableUnits
Definition: attributetype.h:95
const AttributeUnit * mDefaultUnit
Definition: attributetype.h:96
The AttributeUnit class.
Definition: attributeunit.h:40
Type_t getType() const noexcept
Definition: attributetype.h:67
QString mTypeName
Definition: attributetype.h:93
Type_t mType
Definition: attributetype.h:92
virtual bool isValueValid(const QString &value) const noexcept=0
virtual ~AttributeType() noexcept
Definition: attributetype.cpp:56
QString mTypeNameTr
Definition: attributetype.h:94
virtual QString printableValueTr(const QString &value, const AttributeUnit *unit=nullptr) const noexcept=0
virtual QString valueFromTr(const QString &value) const noexcept=0
Type_t
Available Attribute Types.
Definition: attributetype.h:47
const AttributeUnit * getUnitFromString(const QString &unit) const
Definition: attributetype.cpp:66
const AttributeUnit * tryExtractUnitFromValue(QString &value) const noexcept
Definition: attributetype.cpp:88
The AttributeType class.
Definition: attributetype.h:42
bool isUnitAvailable(const AttributeUnit *unit) const noexcept
Definition: attributetype.cpp:80