19 #ifndef QGS_OFFLINE_EDITING_H
20 #define QGS_OFFLINE_EDITING_H
22 #include "qgis_core.h"
69 bool convertToOfflineProject(
const QString &offlineDataPath,
const QString &offlineDbFile,
const QStringList &layerIds,
bool onlySelected =
false, ContainerType containerType = SpatiaLite,
const QString &layerNameSuffix = QStringLiteral(
" (offline)" ) );
72 bool isOfflineProject()
const;
114 void warning(
const QString &title,
const QString &message );
117 void initializeSpatialMetadata(
sqlite3 *sqlite_handle );
118 bool createOfflineDb(
const QString &offlineDbPath,
ContainerType containerType = SpatiaLite );
119 void createLoggingTables(
sqlite3 *db );
148 void showWarning(
const QString &message );
151 int getOrCreateLayerId(
sqlite3 *db,
const QString &qgisLayerId );
152 int getCommitNo(
sqlite3 *db );
153 void increaseCommitNo(
sqlite3 *db );
159 int sqlExec(
sqlite3 *db,
const QString &sql );
160 int sqlQueryInt(
sqlite3 *db,
const QString &sql,
int defaultValue );
161 QList<int> sqlQueryInts(
sqlite3 *db,
const QString &sql );
163 QList<QgsField> sqlQueryAttributesAdded(
sqlite3 *db,
const QString &sql );
166 struct AttributeValueChange
172 typedef QList<AttributeValueChange> AttributeValueChanges;
173 AttributeValueChanges sqlQueryAttributeValueChanges(
sqlite3 *db,
const QString &sql );
175 struct GeometryChange
180 typedef QList<GeometryChange> GeometryChanges;
181 GeometryChanges sqlQueryGeometryChanges(
sqlite3 *db,
const QString &sql );
185 void committedAttributesAdded(
const QString &qgisLayerId,
const QList<QgsField> &addedAttributes );
186 void committedFeaturesAdded(
const QString &qgisLayerId,
const QgsFeatureList &addedFeatures );
187 void committedFeaturesRemoved(
const QString &qgisLayerId,
const QgsFeatureIds &deletedFeatureIds );
188 void committedAttributeValuesChanges(
const QString &qgisLayerId,
const QgsChangedAttributesMap &changedAttrsMap );
189 void committedGeometriesChanges(
const QString &qgisLayerId,
const QgsGeometryMap &changedGeometries );
190 void startListenFeatureChanges();
191 void stopListenFeatureChanges();
Base class for all map layer types.
void layerProgressUpdated(int layer, int numLayers)
Emitted whenever a new layer is being processed.
void progressModeSet(QgsOfflineEditing::ProgressMode mode, int maximum)
Emitted when the mode for the progress of the current operation is set.
void warning(const QString &title, const QString &message)
Emitted when a warning needs to be displayed.
void progressStopped()
Emitted when the processing of all layers has finished.
void progressUpdated(int progress)
Emitted with the progress of the current mode.
ContainerType
Type of offline database container file.
void progressStarted()
Emitted when the process has started.
Represents a vector layer which manages a vector based data sets.
Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes o...
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
QList< QgsFeature > QgsFeatureList
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features