mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
212 lines
6.3 KiB
Plaintext
212 lines
6.3 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsvectorlayerjoinbuffer.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef QList< QgsVectorLayerJoinInfo > QgsVectorJoinList;
|
|
|
|
|
|
class QgsVectorLayerJoinBuffer : QObject, QgsFeatureSink
|
|
{
|
|
%Docstring
|
|
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 *
|
|
:rtype: bool
|
|
%End
|
|
|
|
bool removeJoin( const QString &joinLayerId );
|
|
%Docstring
|
|
Removes a vector layer join
|
|
:return: true if join was found and successfully removed *
|
|
:rtype: bool
|
|
%End
|
|
|
|
void updateFields( QgsFields &fields );
|
|
%Docstring
|
|
Updates field map with joined attributes
|
|
\param fields map to append joined attributes
|
|
%End
|
|
|
|
void createJoinCaches();
|
|
%Docstring
|
|
Calls 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
|
|
Does not resolve layer IDs to layers - call resolveReferences() afterwards
|
|
%End
|
|
|
|
void resolveReferences( QgsProject *project );
|
|
%Docstring
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
bool containsJoins() const;
|
|
%Docstring
|
|
Quick way to test if there is any join at all
|
|
:rtype: bool
|
|
%End
|
|
|
|
const QgsVectorJoinList &vectorJoins() const;
|
|
%Docstring
|
|
:rtype: QgsVectorJoinList
|
|
%End
|
|
|
|
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)
|
|
\param sourceFieldIndex Output: field's index in source layer *
|
|
:rtype: QgsVectorLayerJoinInfo
|
|
%End
|
|
|
|
int joinedFieldsOffset( const QgsVectorLayerJoinInfo *info, const QgsFields &fields );
|
|
%Docstring
|
|
.. versionadded:: 2.6
|
|
:rtype: int
|
|
%End
|
|
|
|
static QVector<int> joinSubsetIndices( QgsVectorLayer *joinLayer, const QStringList &joinFieldsSubset );
|
|
%Docstring
|
|
.. versionadded:: 2.6
|
|
:rtype: list of int
|
|
%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
|
|
.. versionadded:: 3.0
|
|
:rtype: list of const QgsVectorLayerJoinInfo
|
|
%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
|
|
.. versionadded:: 3.0
|
|
:rtype: QgsFeature
|
|
%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
|
|
.. versionadded:: 3.0
|
|
:rtype: QgsFeature
|
|
%End
|
|
|
|
QgsVectorLayerJoinBuffer *clone() const /Factory/;
|
|
%Docstring
|
|
.. versionadded:: 2.6
|
|
:rtype: QgsVectorLayerJoinBuffer
|
|
%End
|
|
|
|
virtual bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 );
|
|
|
|
%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
|
|
|
|
.. versionadded:: 3.0
|
|
:rtype: bool
|
|
%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
|
|
|
|
.. versionadded:: 3.0
|
|
:rtype: bool
|
|
%End
|
|
|
|
bool deleteFeature( QgsFeatureId fid ) 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
|
|
|
|
:return: false if an error happened, true otherwise
|
|
|
|
.. versionadded:: 3.0
|
|
:rtype: bool
|
|
%End
|
|
|
|
bool deleteFeatures( const QgsFeatureIds &fids ) const;
|
|
%Docstring
|
|
Deletes a list of features from joined layers. Feature ids given
|
|
in aprameter are those coming from the target layer.
|
|
|
|
\param fids Feature ids from the target layer to delete
|
|
|
|
:return: false if an error happened, true otherwise
|
|
|
|
.. versionadded:: 3.0
|
|
:rtype: bool
|
|
%End
|
|
|
|
signals:
|
|
void joinedFieldsChanged();
|
|
%Docstring
|
|
.. versionadded:: 2.6
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsvectorlayerjoinbuffer.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|