QGIS/python/core/qgsfieldconstraints.sip.in

156 lines
4.3 KiB
Plaintext
Raw Normal View History

2017-05-01 12:58:31 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfieldconstraints.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFieldConstraints
{
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Stores information about constraints which may be present on a field.
2017-05-01 12:58:31 +02:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
2017-05-01 12:58:31 +02:00
#include "qgsfieldconstraints.h"
%End
public:
enum Constraint
{
2017-05-01 12:58:31 +02:00
ConstraintNotNull,
ConstraintUnique,
ConstraintExpression,
};
typedef QFlags<QgsFieldConstraints::Constraint> Constraints;
2017-05-01 12:58:31 +02:00
enum ConstraintOrigin
{
2017-05-01 12:58:31 +02:00
ConstraintOriginNotSet,
ConstraintOriginProvider,
ConstraintOriginLayer,
};
enum ConstraintStrength
{
2017-05-01 12:58:31 +02:00
ConstraintStrengthNotSet,
ConstraintStrengthHard,
ConstraintStrengthSoft,
};
QgsFieldConstraints();
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsFieldConstraints.
2017-05-01 12:58:31 +02:00
%End
Constraints constraints() const;
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns any constraints which are present for the field.
.. seealso:: :py:func:`setConstraints`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`constraintOrigin`
2017-05-01 12:58:31 +02:00
%End
ConstraintOrigin constraintOrigin( Constraint constraint ) const;
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the origin of a field constraint, or ConstraintOriginNotSet if the constraint
is not present on this field.
.. seealso:: :py:func:`constraints`
2017-05-01 12:58:31 +02:00
%End
ConstraintStrength constraintStrength( Constraint constraint ) const;
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the strength of a field constraint, or ConstraintStrengthNotSet if the constraint
is not present on this field.
.. seealso:: :py:func:`constraints`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setConstraintStrength`
2017-05-01 12:58:31 +02:00
%End
void setConstraintStrength( Constraint constraint, ConstraintStrength strength );
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the strength of a constraint. Note that the strength of constraints which originate
from a provider cannot be changed. Constraints default to ConstraintStrengthHard unless
explicitly changed.
.. seealso:: :py:func:`constraintStrength`
2017-05-01 12:58:31 +02:00
%End
void setConstraint( Constraint constraint, ConstraintOrigin origin = ConstraintOriginLayer );
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets a constraint on the field.
.. seealso:: :py:func:`constraints`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`removeConstraint`
2017-05-01 12:58:31 +02:00
%End
void removeConstraint( Constraint constraint );
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Removes a constraint from the field.
.. seealso:: :py:func:`setConstraint`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`constraints`
2017-05-01 12:58:31 +02:00
%End
QString constraintExpression() const;
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the constraint expression for the field, if set.
.. seealso:: :py:func:`constraints`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`constraintDescription`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setConstraintExpression`
2017-05-01 12:58:31 +02:00
%End
QString constraintDescription() const;
2017-05-01 12:58:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the descriptive name for the constraint expression.
.. seealso:: :py:func:`constraints`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`constraintExpression`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setConstraintExpression`
2017-05-01 12:58:31 +02:00
%End
2017-05-01 12:58:31 +02:00
void setConstraintExpression( const QString &expression, const QString &description = QString() );
%Docstring
2017-12-15 10:36:55 -04:00
Set the constraint expression for the field. An optional descriptive name for the constraint
can also be set. Setting an empty expression will clear any existing expression constraint.
.. seealso:: :py:func:`constraintExpression`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`constraintDescription`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`constraints`
2017-05-01 12:58:31 +02:00
%End
2017-05-01 12:58:31 +02:00
bool operator==( const QgsFieldConstraints &other ) const;
};
QFlags<QgsFieldConstraints::Constraint> operator|(QgsFieldConstraints::Constraint f1, QFlags<QgsFieldConstraints::Constraint> f2);
2017-05-01 12:58:31 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfieldconstraints.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/