Skip to content

Commit

Permalink
Doxymentation for relation manager
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 15, 2014
1 parent 5d6b979 commit 77bcd61
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion src/core/qgsrelationmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,72 @@ class CORE_EXPORT QgsRelationManager : public QObject
public:
explicit QgsRelationManager( QgsProject *project );

/**
* Will set the specified relations and remove any relation currently set.
*
* @param relations A list of relations to set.
*/
void setRelations( const QList<QgsRelation>& relations );

/**
* Get access to the relations managed by this class.
*
* @return A QMap where the key is the relation id, the value the relation object.
*/
const QMap<QString, QgsRelation>& relations() const;

/**
* Add a relation.
*
* @param The relation to add.
*/
void addRelation( const QgsRelation& relation );
void removeRelation( const QString& name );

/**
* Remove a relation.
*
* @param id The id of the relation to remove.
*/
void removeRelation( const QString& id );

/**
* Remove a relation.
*
* @param relation The relation to remove.
*/
void removeRelation( const QgsRelation& relation );

/**
* Get access to a relation by its id.
*
* @param id The id to search for
*
* @return A relation. Invalid if not found.
*/
QgsRelation relation( const QString& id ) const;

/**
* Remove any relation managed by this class.
*/
void clear();

/**
* Get all relations where the specified layer (and field) is the referencing part (i.e. the child table with the foreign key).
*
* @param layer The layer which should be searched for.
* @param fieldIdx The field which should be part of the foreign key. If not set will return all relations.
*
* @return A list of relations matching the given layer and fieldIdx.
*/
QList<QgsRelation> referencingRelations( QgsVectorLayer *layer = 0, int fieldIdx = -2 ) const;

/**
* Get all relations where this layer is the referenced part (i.e. the parent table with the primary key being referenced from another layer).
*
* @param layer The layer which should be searched for.
*
* @return A list of relations where the specified layer is the referenced part.
*/
QList<QgsRelation> referencedRelations( QgsVectorLayer *layer = 0 ) const;

signals:
Expand Down

0 comments on commit 77bcd61

Please sign in to comment.