16 #ifndef QGSFIELDCONSTRAINTS_H
17 #define QGSFIELDCONSTRAINTS_H
23 #include "qgis_core.h"
36 Q_PROPERTY( Constraints constraints READ constraints )
45 ConstraintNotNull = 1,
46 ConstraintUnique = 1 << 1,
47 ConstraintExpression = 1 << 2,
49 Q_DECLARE_FLAGS( Constraints, Constraint )
56 ConstraintOriginNotSet = 0,
66 ConstraintStrengthNotSet = 0,
88 ConstraintOrigin constraintOrigin( Constraint constraint )
const;
96 ConstraintStrength constraintStrength( Constraint constraint )
const;
103 void setConstraintStrength( Constraint constraint, ConstraintStrength strength );
110 void setConstraint( Constraint constraint, ConstraintOrigin origin = ConstraintOriginLayer );
125 QString constraintExpression()
const;
142 void setConstraintExpression(
const QString &expression,
const QString &description = QString() );
166 Constraints mConstraints;
169 QHash< Constraint, ConstraintOrigin > mConstraintOrigins;
172 QHash< Constraint, ConstraintStrength > mConstraintStrengths;
175 QString mExpressionConstraint;
178 QString mExpressionConstraintDescription;
186 #endif //QGSFIELDCONSTRAINTS_H