@@ -10,19 +10,31 @@ class QgsAttributeEditorContext
1010#include "qgsattributeeditorcontext.h"
1111%End
1212 public:
13+ /**
14+ * Determines in which direction a relation was resolved.
15+ */
16+ enum RelationMode
17+ {
18+ Undefined, //!< This context is not defined by a relation
19+ EmbedMultiple, //!< When embedding a list of features (e.g. houses as an embedded form in a district form)
20+ EmbedSingle, //!< When embedding a single feature (e.g. district information when looking at the form of a house)
21+ StandaloneSingle //!< When showing a new dialog for a single feature (e.g. district information when looking at the form of a house)
22+ };
23+
1324 QgsAttributeEditorContext();
1425
26+ QgsAttributeEditorContext( const QgsAttributeEditorContext& parentContext, const QgsRelation& relation, RelationMode mode );
27+
1528 void setDistanceArea( const QgsDistanceArea& distanceArea );
29+
1630 const QgsDistanceArea& distanceArea();
1731
1832 void setVectorLayerTools( QgsVectorLayerTools* vlTools );
19- QgsVectorLayerTools* vectorLayerTools();
33+ const QgsVectorLayerTools* vectorLayerTools() const ;
2034
21- /**
22- * When copying the context for another layer, call this.
23- * Will adjast the distance area for this layer
24- *
25- * @param layer The layer to adjust for.
26- */
27- // void adjustForLayer( QgsVectorLayer* layer );
35+ void setRelation( const QgsRelation& relation, RelationMode mode );
36+ const QgsRelation& relation() const;
37+ RelationMode relationMode() const;
38+
39+ const QgsAttributeEditorContext* parentContext() const;
2840};
0 commit comments