File: qgsvectorlayerjoinbuffer.sip.in

package info (click to toggle)
qgis 3.40.13%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,185,160 kB
  • sloc: cpp: 1,615,781; python: 372,865; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,829; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 155
file content (239 lines) | stat: -rw-r--r-- 7,928 bytes parent folder | download | duplicates (16)
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/vector/qgsvectorlayerjoinbuffer.h                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






typedef QList< QgsVectorLayerJoinInfo > QgsVectorJoinList;


class QgsVectorLayerJoinBuffer : QObject, QgsFeatureSink
{
%Docstring(signature="appended")
Manages joined fields for a vector layer.
%End

%TypeHeaderCode
#include "qgsvectorlayerjoinbuffer.h"
%End
  public:
    QgsVectorLayerJoinBuffer( QgsVectorLayer *layer = 0 );

    bool addJoin( const QgsVectorLayerJoinInfo &joinInfo );
%Docstring
Joins another vector layer to this layer

:param joinInfo: join object containing join layer id, target and source
                 field

:return: (since 2.6) whether the join was successfully added
%End

    bool removeJoin( const QString &joinLayerId );
%Docstring
Removes a vector layer join

:return: ``True`` if join was found and successfully removed
%End

    void updateFields( QgsFields &fields );
%Docstring
Updates field map with joined attributes

:param fields: map to append joined attributes
%End

    void createJoinCaches();
%Docstring
Calls :py:func:`~QgsVectorLayerJoinBuffer.cacheJoinLayer` for all vector
joins
%End

    void writeXml( QDomNode &layer_node, QDomDocument &document ) const;
%Docstring
Saves mVectorJoins to xml under the layer node
%End

    void readXml( const QDomNode &layer_node );
%Docstring
Reads joins from project file. Does not resolve layer IDs to layers -
call :py:func:`~QgsVectorLayerJoinBuffer.resolveReferences` afterwards
%End

    void resolveReferences( QgsProject *project );
%Docstring
Resolves layer IDs of joined layers using given project's available
layers
%End

    bool containsJoins() const;
%Docstring
Quick way to test if there is any join at all
%End

    const QgsVectorJoinList &vectorJoins() const;

    const QgsVectorLayerJoinInfo *joinForFieldIndex( int index, const QgsFields &fields, int &sourceFieldIndex /Out/ ) const;
%Docstring
Finds the vector join for a layer field index.

:param index: this layers attribute index
:param fields: fields of the vector layer (including joined fields)

:return: - the vector layer join info
         - sourceFieldIndex: Output: field's index in source layer
%End

    int joinedFieldsOffset( const QgsVectorLayerJoinInfo *info, const QgsFields &fields );
%Docstring
Find out what is the first index of the join within fields. Returns -1
if join is not present
%End

    static QVector<int> joinSubsetIndices( QgsVectorLayer *joinLayer, const QStringList &joinFieldsSubset );
%Docstring
Returns a vector of indices for use in join based on field names from
the layer
%End

    static QVector<int> joinSubsetIndices( const QgsFields &joinLayerFields, const QStringList &joinFieldsSubset );
%Docstring
Returns a vector of indices for use in join based on field names from
the join layer's fields.

.. versionadded:: 3.20
%End

    QList<const QgsVectorLayerJoinInfo *> joinsWhereFieldIsId( const QgsField &field ) const;
%Docstring
Returns joins where the field of a target layer is considered as an id.

:param field: the field of a target layer

:return: a list of vector joins
%End

    QgsFeature joinedFeatureOf( const QgsVectorLayerJoinInfo *info, const QgsFeature &feature ) const;
%Docstring
Returns the joined feature corresponding to the feature.

:param info: the vector join information
:param feature: the feature of the target layer
%End

    QgsFeature targetedFeatureOf( const QgsVectorLayerJoinInfo *info, const QgsFeature &feature ) const;
%Docstring
Returns the targeted feature corresponding to the joined feature.

:param info: the vector join information
:param feature: the feature of the joined layer
%End

    bool isAuxiliaryJoin( const QgsVectorLayerJoinInfo &info ) const;
%Docstring
Returns ``True`` if the join information is about auxiliary layer,
``False`` otherwise

:param info: The join information

:return: ``True`` if the join information is about auxiliary layer,
         ``False`` otherwise
%End

    QgsVectorLayerJoinBuffer *clone() const /Factory/;
%Docstring
Create a copy of the join buffer
%End

    virtual bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() );

%Docstring
Adds a list of features in joined layers. Features given in parameter
are those added in target layer. If a corresponding joined feature yet
exists in a joined layer, then this feature is just updated. Note that
if a corresponding joined feature has only empty fields, then it's not
created nor added.

:param features: The list of features added in the target layer
:param flags: Unused parameter

:return: ``False`` if an error happened, ``True`` otherwise
%End

    bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
%Docstring
Changes attribute value in joined layers. The feature id given in
parameter is the one added in target layer. If the corresponding joined
feature does not exist in a joined layer, then it's automatically
created if its fields are not empty.

:param fid: The feature id
:param field: The field to update
:param newValue: The new value of the attribute
:param oldValue: The old value of the attribute

:return: ``False`` if an error happened, ``True`` otherwise
%End

    bool changeAttributeValues( QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues = QgsAttributeMap() );
%Docstring
Changes attributes' values in joined layers. The feature id given in
parameter is the one added in target layer. If the corresponding joined
feature does not exist in a joined layer, then it's automatically
created if its fields are not empty.

:param fid: The feature id
:param newValues: The new values for attributes
:param oldValues: The old values for attributes

:return: ``False`` if an error happened, ``True`` otherwise
%End

    bool deleteFeature( QgsFeatureId fid, QgsVectorLayer::DeleteContext *context = 0 ) const;
%Docstring
Deletes a feature from joined layers. The feature id given in parameter
is the one coming from the target layer.

:param fid: The feature id from the target layer to delete
:param context: The chain of features which will be deleted for feedback
                and to avoid infinite recursions. Can be ``None``.

:return: ``False`` if an error happened, ``True`` otherwise
%End

    bool deleteFeatures( const QgsFeatureIds &fids, QgsVectorLayer::DeleteContext *context = 0 ) const;
%Docstring
Deletes a list of features from joined layers. Feature ids given in a
parameter are those coming from the target layer.

:param fids: Feature ids from the target layer to delete
:param context: The chain of features who will be deleted for feedback
                and to avoid infinite recursions. Can be ``None``.

:return: ``False`` if an error happened, ``True`` otherwise
%End

  signals:

    void joinedFieldsChanged();
%Docstring
Emitted whenever the list of joined fields changes (e.g. added join or
joined layer's fields change)
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/vector/qgsvectorlayerjoinbuffer.h                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/