2017-05-23 09:45:57 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsvirtuallayerdefinition.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-15 19:12:35 +02:00
|
|
|
class QgsVirtualLayerDefinition
|
|
|
|
{
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Class to manipulate the definition of a virtual layer
|
|
|
|
|
|
|
|
It is used to extract parameters from an initial virtual layer definition as well as
|
|
|
|
to store the complete, expanded definition once types have been detected.
|
|
|
|
%End
|
|
|
|
|
2015-12-15 19:12:35 +02:00
|
|
|
%TypeHeaderCode
|
2017-05-23 09:45:57 +02:00
|
|
|
#include "qgsvirtuallayerdefinition.h"
|
2015-12-15 19:12:35 +02:00
|
|
|
%End
|
|
|
|
public:
|
2017-05-23 09:45:57 +02:00
|
|
|
|
2015-12-15 19:12:35 +02:00
|
|
|
class SourceLayer
|
2017-05-23 09:45:57 +02:00
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
A SourceLayer is either a reference to a live layer in the registry
|
|
|
|
or all the parameters needed to load it (provider key, source, etc.)
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsvirtuallayerdefinition.h"
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
public:
|
2017-05-01 16:42:33 +02:00
|
|
|
SourceLayer( const QString &name, const QString &ref );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor variant to build a live layer reference
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
SourceLayer( const QString &name, const QString &source, const QString &provider, const QString &encoding );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor variant to build a layer with a provider and a source
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
bool isReferenced() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Is it a live layer or not ?
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString reference() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
The reference (id) of the live layer
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString name() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Name of the layer
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString provider() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Provider key
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString source() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
The source url used by the provider to build the layer
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString encoding() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Optional encoding for the provider
|
|
|
|
:rtype: str
|
|
|
|
%End
|
|
|
|
|
2015-12-15 19:12:35 +02:00
|
|
|
};
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsVirtualLayerDefinition( const QString &filePath = "" );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor with an optional file path
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static QgsVirtualLayerDefinition fromUrl( const QUrl &url );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
field=column_name:[int|real|text] represents a field with its name and its type
|
|
|
|
:rtype: QgsVirtualLayerDefinition
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QUrl toUrl() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Convert the definition into a QUrl
|
|
|
|
:rtype: QUrl
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString toString() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Convert into a QString that can be read by the virtual layer provider
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void addSource( const QString &name, const QString &ref );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Add a live layer source layer
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void addSource( const QString &name, const QString &source, const QString &provider, const QString &encoding = "" );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Add a layer with a source, a provider and an encoding
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
typedef QList<QgsVirtualLayerDefinition::SourceLayer> SourceLayers;
|
|
|
|
|
2017-05-23 09:45:57 +02:00
|
|
|
const QgsVirtualLayerDefinition::SourceLayers &sourceLayers() const;
|
|
|
|
%Docstring
|
|
|
|
Get access to the source layers
|
|
|
|
:rtype: QgsVirtualLayerDefinition.SourceLayers
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString query() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Get the SQL query
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
void setQuery( const QString &query );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Set the SQL query
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString filePath() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Get the file path. May be empty
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
void setFilePath( const QString &filePath );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Set the file path
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString uid() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Get the name of the field with unique identifiers
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
void setUid( const QString &uid );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Set the name of the field with unique identifiers
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
QString geometryField() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Get the name of the geometry field. Empty if no geometry field
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
void setGeometryField( const QString &geometryField );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Set the name of the geometry field
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2016-08-04 09:10:08 +02:00
|
|
|
QgsWkbTypes::Type geometryWkbType() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
QgsWkbTypes.Unknown for unknown types
|
|
|
|
:rtype: QgsWkbTypes.Type
|
|
|
|
%End
|
2016-08-04 09:10:08 +02:00
|
|
|
void setGeometryWkbType( QgsWkbTypes::Type t );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Set the type of the geometry
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
|
|
|
long geometrySrid() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Get the SRID of the geometry
|
|
|
|
:rtype: long
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
void setGeometrySrid( long srid );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Set the SRID of the geometry
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2017-05-23 09:45:57 +02:00
|
|
|
QgsFields fields() const;
|
|
|
|
%Docstring
|
|
|
|
Get field definitions
|
|
|
|
:rtype: QgsFields
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
void setFields( const QgsFields &fields );
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Set field definitions
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
bool hasSourceLayer( const QString &name ) const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Convenience method to test if a given source layer is part of the definition
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
bool hasReferencedLayers() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Convenience method to test whether the definition has referenced (live) layers
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2015-12-15 19:12:35 +02:00
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
bool hasDefinedGeometry() const;
|
2017-05-23 09:45:57 +02:00
|
|
|
%Docstring
|
|
|
|
Convenient method to test if the geometry is defined (not NoGeometry and not Unknown)
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
|
|
|
|
2015-12-15 19:12:35 +02:00
|
|
|
};
|
|
|
|
|
2017-05-23 09:45:57 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsvirtuallayerdefinition.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|