16#ifndef QGSFIELDDOMAIN_H
17#define QGSFIELDDOMAIN_H
25using namespace Qt::StringLiterals;
43 sipType = sipType_QgsCodedFieldDomain;
47 sipType = sipType_QgsRangeFieldDomain;
51 sipType = sipType_QgsGlobFieldDomain;
138 Q_DECL_DEPRECATED
void setFieldType( QVariant::Type type )
SIP_DEPRECATED;
201 QVariant
code()
const {
return mCode; }
207 QString
value()
const {
return mValue; }
211 SIP_PYOBJECT __repr__();
213 QString str = u
"<QgsCodedValue: %1 (%2)>"_s.arg( sipCpp->code().toString(), sipCpp->value() );
214 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
285 SIP_PYOBJECT __repr__();
287 QString str = u
"<QgsCodedFieldDomain: %1>"_s.arg( sipCpp->name() );
288 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
296 QList< QgsCodedValue>
417 SIP_PYOBJECT __repr__();
419 QString str = u
"<QgsRangeFieldDomain: %1 %2%3, %4%5>"_s.arg( sipCpp->name(),
420 sipCpp->minimumIsInclusive() ? u
"["_s : u
"("_s,
421 sipCpp->minimum().toString(),
422 sipCpp->maximum().toString(),
423 sipCpp->maximumIsInclusive() ? u
"]"_s : u
")"_s );
424 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
434 bool mMinIsInclusive =
false;
435 bool mMaxIsInclusive =
false;
488 QString
glob()
const {
return mGlob; }
501 SIP_PYOBJECT __repr__();
503 QString str = u
"<QgsGlobFieldDomain: %1 '%2'>"_s.arg( sipCpp->name(), sipCpp->glob() );
504 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
FieldDomainMergePolicy
Merge policy for field domains.
@ DefaultValue
Use default field value.
FieldDomainSplitPolicy
Split policy for field domains.
@ DefaultValue
Use default field value.
FieldDomainType
Types of field domain.
@ Coded
Coded field domain.
@ Range
Numeric range field domain (min/max).
@ Glob
Glob string pattern field domain.
Definition of a coded / enumerated field domain.
QgsCodedFieldDomain * clone() const override
Clones the field domain.
void setValues(const QList< QgsCodedValue > &values)
Sets the enumeration as QgsCodedValue values.
QList< QgsCodedValue > values() const
Returns the enumeration as QgsCodedValue values.
QgsCodedFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType, const QList< QgsCodedValue > &values)
Constructor for QgsCodedFieldDomain, with the associated name, description and fieldType.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
QgsCodedFieldDomain(const QgsCodedFieldDomain &)=delete
QgsCodedFieldDomain cannot be copied - use clone() instead.
QgsCodedFieldDomain & operator=(const QgsCodedFieldDomain &)=delete
QgsCodedFieldDomain cannot be copied - use clone() instead.
QString typeName() const override
Returns a translated name of the field domain type.
Associates a code and a value.
QVariant code() const
Returns the associated code, which is the underlying value stored in fields.
QgsCodedValue(const QVariant &code, const QString &value)
Constructor for QgsCodedValue, with the associated code and value.
QString value() const
Returns the associated value, which is the user-friendly string representation.
Qgis::FieldDomainMergePolicy mergePolicy() const
Returns the merge policy.
Qgis::FieldDomainSplitPolicy mSplitPolicy
Qgis::FieldDomainSplitPolicy splitPolicy() const
Returns the split policy.
void setFieldType(QMetaType::Type type)
Sets the associated field type.
virtual ~QgsFieldDomain()
void setName(const QString &name)
Sets the name of the field domain.
QMetaType::Type fieldType() const
Returns the associated field type.
Qgis::FieldDomainMergePolicy mMergePolicy
virtual Qgis::FieldDomainType type() const =0
Returns the type of field domain.
QMetaType::Type mFieldType
QString name() const
Returns the name of the field domain.
void setDescription(const QString &description)
Sets the description of the field domain.
void setSplitPolicy(Qgis::FieldDomainSplitPolicy policy)
Sets the split policy.
QgsFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType)
Constructor for QgsFieldDomain, with the specified name, description and fieldType.
QString description() const
Returns the description of the field domain.
void setMergePolicy(Qgis::FieldDomainMergePolicy policy)
Sets the merge policy.
virtual QgsFieldDomain * clone() const =0
Clones the field domain.
virtual QString typeName() const =0
Returns a translated name of the field domain type.
Definition of a field domain for field content validated by a glob.
QgsGlobFieldDomain(const QgsGlobFieldDomain &)=delete
QgsGlobFieldDomain cannot be copied - use clone() instead.
QgsGlobFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType, const QString &glob)
Constructor for QgsGlobFieldDomain, with the specified name, description and fieldType.
QString typeName() const override
Returns a translated name of the field domain type.
QgsGlobFieldDomain & operator=(const QgsGlobFieldDomain &)=delete
QgsGlobFieldDomain cannot be copied - use clone() instead.
QString glob() const
Returns the glob expression.
QgsGlobFieldDomain * clone() const override
Clones the field domain.
void setGlob(const QString &glob)
Sets the glob expression.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
Definition of a numeric field domain with a range of validity for values.
void setMaximumIsInclusive(bool inclusive)
Sets whether the maximum value is inclusive.
Qgis::FieldDomainType type() const override
Returns the type of field domain.
QVariant minimum() const
Returns the minimum value.
QgsRangeFieldDomain(const QgsRangeFieldDomain &)=delete
QgsRangeFieldDomain cannot be copied - use clone() instead.
void setMaximum(const QVariant &maximum)
Sets the maximum allowed value.
bool maximumIsInclusive() const
Returns true if the maximum value is inclusive.
QgsRangeFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType, const QVariant &minimum, bool minimumIsInclusive, const QVariant &maximum, bool maximumIsInclusive)
Constructor for QgsRangeFieldDomain, with the specified name, description and fieldType.
void setMinimum(const QVariant &minimum)
Sets the minimum allowed value.
QgsRangeFieldDomain * clone() const override
Clones the field domain.
bool minimumIsInclusive() const
Returns true if the minimum value is inclusive.
void setMinimumIsInclusive(bool inclusive)
Sets whether the minimum value is inclusive.
QgsRangeFieldDomain & operator=(const QgsRangeFieldDomain &)=delete
QgsRangeFieldDomain cannot be copied - use clone() instead.
QVariant maximum() const
Returns the maximum value.
QString typeName() const override
Returns a translated name of the field domain type.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)