17 #ifndef QGSVIRTUALLAYERDEFINITION_H
18 #define QGSVIRTUALLAYERDEFINITION_H
20 #include "qgis_core.h"
44 SourceLayer(
const QString &name,
const QString &ref )
49 SourceLayer(
const QString &name,
const QString &source,
const QString &provider,
const QString &encoding )
52 , mProvider( provider )
53 , mEncoding( encoding )
57 bool isReferenced()
const {
return !mRef.isEmpty(); }
60 QString reference()
const {
return mRef; }
63 QString name()
const {
return mName; }
66 QString provider()
const {
return mProvider; }
69 QString source()
const {
return mSource; }
72 QString encoding()
const {
return mEncoding; }
105 QString toString()
const;
108 void addSource(
const QString &name,
const QString &ref );
111 void addSource(
const QString &name,
const QString &source,
const QString &provider,
const QString &encoding =
"" );
114 typedef QList<QgsVirtualLayerDefinition::SourceLayer>
SourceLayers;
120 QString query()
const {
return mQuery; }
122 void setQuery(
const QString &query ) { mQuery = query; }
125 QString filePath()
const {
return mFilePath; }
127 void setFilePath(
const QString &filePath ) { mFilePath = filePath; }
130 QString uid()
const {
return mUid; }
132 void setUid(
const QString &uid ) { mUid = uid; }
142 void setLazy(
bool lazy ) { mLazy = lazy; }
150 bool isLazy()
const {
return mLazy; }
153 QString geometryField()
const {
return mGeometryField; }
155 void setGeometryField(
const QString &geometryField ) { mGeometryField = geometryField; }
167 long geometrySrid()
const {
return mGeometrySrid; }
169 void setGeometrySrid(
long srid ) { mGeometrySrid = srid; }
172 QgsFields fields()
const {
return mFields; }
174 void setFields(
const QgsFields &fields ) { mFields = fields; }
177 bool hasSourceLayer(
const QString &name )
const;
180 bool hasReferencedLayers()
const;
183 bool hasDefinedGeometry()
const
189 SourceLayers mSourceLayers;
192 QString mGeometryField;
197 long mGeometrySrid = 0;