1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrelationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsRelationManager : QObject
{
%Docstring(signature="appended")
This class manages a set of relations between layers.
%End
%TypeHeaderCode
#include "qgsrelationmanager.h"
%End
public:
explicit QgsRelationManager( QgsProject *project = 0 );
%Docstring
Constructor for QgsRelationManager.
:param project: associated project (used to notify project of changes)
%End
QgsRelationContext context() const;
%Docstring
Gets the relation context
%End
void setRelations( const QList<QgsRelation> &relations );
%Docstring
Will set the specified relations and remove any relation currently set.
:param relations: A list of relations to set.
%End
QMap<QString, QgsRelation> relations() const;
%Docstring
Gets access to the relations managed by this class.
:return: A QMap where the key is the relation id, the value the relation
object.
%End
void addRelation( const QgsRelation &relation );
%Docstring
Add a relation. Invalid relations are added only if both referencing
layer and referenced layer exist.
:param relation: The relation to add.
%End
void removeRelation( const QString &id );
%Docstring
Remove a relation.
:param id: The id of the relation to remove.
%End
void removeRelation( const QgsRelation &relation );
%Docstring
Remove a relation.
:param relation: The relation to remove.
%End
QgsRelation relation( const QString &id ) const;
%Docstring
Gets access to a relation by its id.
:param id: The id to search for
:return: A relation. Invalid if not found.
.. seealso:: :py:func:`relationsByName`
%End
QList<QgsRelation> relationsByName( const QString &name ) const;
%Docstring
Returns a list of relations with matching names.
:param name: relation name to search for. Searching is case insensitive.
:return: a list of matching relations
.. seealso:: :py:func:`relation`
%End
void clear();
%Docstring
Remove any relation managed by this class.
%End
QList<QgsRelation> referencingRelations( const QgsVectorLayer *layer = 0, int fieldIdx = -2 ) const;
%Docstring
Gets 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.
%End
QList<QgsRelation> referencedRelations( const QgsVectorLayer *layer = 0 ) const;
%Docstring
Gets 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.
%End
static QList<QgsRelation> discoverRelations( const QList<QgsRelation> &existingRelations, const QList<QgsVectorLayer *> &layers );
%Docstring
Discover all the relations available from the current layers.
:param existingRelations: the existing relations to filter them out
:param layers: the current layers
:return: the list of discovered relations
%End
QMap<QString, QgsPolymorphicRelation> polymorphicRelations() const;
%Docstring
Returns all the polymorphic relations
%End
QgsPolymorphicRelation polymorphicRelation( const QString &polymorphicRelationId ) const;
%Docstring
Returns the list of relations associated with a polymorphic relation
%End
void addPolymorphicRelation( const QgsPolymorphicRelation &polymorphicRelation );
%Docstring
Adds a new polymorphic relation. The generated relations are not
available, they will be created automatically.
%End
void removePolymorphicRelation( const QString &polymorphicRelationId );
%Docstring
Removes an existing polymorphic relation and it's generated relations.
%End
void setPolymorphicRelations( const QList<QgsPolymorphicRelation> &relations );
%Docstring
Sets the specified polymorphic ``relations`` and removes any polymorphic
relations currently set. Will remove any generated relations and
recreate them.
%End
signals:
void relationsLoaded();
%Docstring
Emitted when the relations were loaded after reading a project
%End
void changed();
%Docstring
Emitted when relations are added or removed to the manager.
%End
public slots:
void updateRelationsStatus();
%Docstring
Updates relations status
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrelationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|