23 #include "qgis_core.h"
35 class QgsRelationPrivate;
46 Q_PROPERTY( QString
id READ
id WRITE setId )
49 Q_PROPERTY( QString name READ name WRITE setName )
50 Q_PROPERTY(
bool isValid READ isValid )
51 Q_PROPERTY( QString polymorphicRelationId READ polymorphicRelationId WRITE setPolymorphicRelationId )
64 Q_ENUM( RelationType )
75 Q_ENUM( RelationStrength )
95 FieldPair(
const QString &referencingField,
const QString &referencedField )
96 : QPair< QString, QString >( referencingField, referencedField ) {}
103 bool operator==(
const FieldPair &other )
const {
return first == other.first && second == other.second; }
149 void writeXml( QDomNode &node, QDomDocument &doc )
const;
154 void setId(
const QString &
id );
159 void setName(
const QString &name );
165 void setStrength( RelationStrength strength );
170 void setReferencingLayer(
const QString &
id );
175 void setReferencedLayer(
const QString &
id );
185 void addFieldPair(
const QString &referencingField,
const QString &referencedField );
195 void addFieldPair(
const FieldPair &fieldPair )
SIP_SKIP;
230 QString getRelatedFeaturesFilter(
const QgsFeature &feature )
const;
269 QString name()
const;
277 RelationStrength strength()
const;
298 QString referencingLayerId()
const;
313 QString referencedLayerId()
const;
330 QList< QgsRelation::FieldPair > fieldPairs()
const;
332 QMap< QString, QString > fieldPairs()
const;
334 const QList< QgsRelation::FieldPair > &pairs = sipCpp->fieldPairs();
335 sipRes =
new QMap< QString, QString >();
338 sipRes->insert( pair.first, pair.second );
365 bool isValid()
const;
374 bool hasEqualDefinition(
const QgsRelation &other )
const;
381 Q_INVOKABLE QString resolveReferencedField(
const QString &referencingField )
const;
388 Q_INVOKABLE QString resolveReferencingField(
const QString &referencedField )
const;
396 void updateRelationStatus();
402 void setPolymorphicRelationId(
const QString &polymorphicRelationId );
408 QString polymorphicRelationId()
const;
420 RelationType type()
const;
424 mutable QExplicitlySharedDataPointer<QgsRelationPrivate> d;
433 #endif // QGSRELATION_H