File: qgsvirtuallayerdefinition.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (259 lines) | stat: -rw-r--r-- 6,791 bytes parent folder | download | duplicates (12)
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsvirtuallayerdefinition.h                                 *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsVirtualLayerDefinition
{
%Docstring(signature="appended")
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

%TypeHeaderCode
#include "qgsvirtuallayerdefinition.h"
%End
  public:

    class SourceLayer
{
%Docstring(signature="appended")
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
      public:
        SourceLayer( const QString &name, const QString &ref );
%Docstring
Constructor variant to build a live layer reference
%End
        SourceLayer( const QString &name, const QString &source, const QString &provider, const QString &encoding );
%Docstring
Constructor variant to build a layer with a provider and a source
%End

        bool isReferenced() const;
%Docstring
Is it a live layer or not ?
%End

        QString reference() const;
%Docstring
The reference (id) of the live layer
%End

        QString name() const;
%Docstring
Name of the layer
%End

        QString provider() const;
%Docstring
Provider key
%End

        QString source() const;
%Docstring
The source url used by the provider to build the layer
%End

        QString encoding() const;
%Docstring
Optional encoding for the provider
%End

    };

    QgsVirtualLayerDefinition( const QString &filePath = "" );
%Docstring
Constructor with an optional file path
%End

    static QgsVirtualLayerDefinition fromUrl( const QUrl &url );
%Docstring
Constructor to build a definition from a QUrl The path part of the URL
is extracted as well as the following optional keys:
layer_ref=layer_id[:name] represents a live layer referenced by its ID.
An optional name can be given layer=provider:source[:name[:encoding]]
represents a layer given by its provider key, its source url
(URL-encoded). An optional name and encoding can be given
geometry=column_name[:type:srid] gives the definition of the geometry
column. Type can be either a WKB type code or a string (point,
linestring, etc.) srid is an integer uid=column_name is the name of a
column with unique integer values. nogeometry is a flag to force the
layer to be a non-geometry layer query=sql represents the SQL query.
Must be URL-encoded field=column_name:[int|real|text] represents a field
with its name and its type subsetstring=subset_string represents the
subsetstring
%End

    QUrl toUrl() const;
%Docstring
Convert the definition into a QUrl
%End

    QString toString() const;
%Docstring
Convert into a QString that can be read by the virtual layer provider
%End

    void addSource( const QString &name, const QString &ref );
%Docstring
Add a live layer source layer
%End

    void addSource( const QString &name, const QString &source, const QString &provider, const QString &encoding = "" );
%Docstring
Add a layer with a source, a provider and an encoding
%End

    typedef QList<QgsVirtualLayerDefinition::SourceLayer> SourceLayers;

    const QgsVirtualLayerDefinition::SourceLayers &sourceLayers() const;
%Docstring
Gets access to the source layers
%End

    QString query() const;
%Docstring
Gets the SQL query
%End
    void setQuery( const QString &query );
%Docstring
Sets the SQL query
%End

    QString filePath() const;
%Docstring
Gets the file path. May be empty
%End
    void setFilePath( const QString &filePath );
%Docstring
Sets the file path
%End

    QString uid() const;
%Docstring
Gets the name of the field with unique identifiers
%End
    void setUid( const QString &uid );
%Docstring
Sets the name of the field with unique identifiers
%End

    void setLazy( bool lazy );
%Docstring
Sets the lazy mode. If ``lazy`` is ``True``, then the loading is delayed
until an explicit reloading of the layer.

:param lazy: ``True`` to delay the loading, ``False`` otherwise

.. seealso:: :py:func:`QgsDataProvider.reloadData`

.. seealso:: :py:func:`isLazy`

.. versionadded:: 3.2
%End

    bool isLazy() const;
%Docstring
Returns the lazy mode.

:return: ``True`` if the loading is delayed, ``False`` otherwise.

.. seealso:: :py:func:`setLazy`

.. versionadded:: 3.2
%End

    QString geometryField() const;
%Docstring
Gets the name of the geometry field. Empty if no geometry field
%End
    void setGeometryField( const QString &geometryField );
%Docstring
Sets the name of the geometry field
%End

    Qgis::WkbType geometryWkbType() const;
%Docstring
Gets the type of the geometry :py:class:`QgsWkbTypes`.NoGeometry to hide
any geometry :py:class:`QgsWkbTypes`.Unknown for unknown types
%End
    void setGeometryWkbType( Qgis::WkbType t );
%Docstring
Sets the type of the geometry
%End

    long geometrySrid() const;
%Docstring
Gets the SRID of the geometry
%End
    void setGeometrySrid( long srid );
%Docstring
Sets the SRID of the geometry
%End

    QgsFields fields() const;
%Docstring
Gets field definitions
%End
    void setFields( const QgsFields &fields );
%Docstring
Sets field definitions
%End

    bool hasSourceLayer( const QString &name ) const;
%Docstring
Convenience method to test if a given source layer is part of the
definition
%End

    bool hasReferencedLayers() const;
%Docstring
Convenience method to test whether the definition has referenced (live)
layers
%End

    bool hasDefinedGeometry() const;
%Docstring
Convenient method to test if the geometry is defined (not NoGeometry and
not Unknown)
%End

    QString subsetString() const;
%Docstring
Returns the subset string.

.. versionadded:: 3.16
%End

    void setSubsetString( const QString &subsetString );
%Docstring
Sets the ``subsetString``

.. versionadded:: 3.16
%End

};


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