19 #ifndef QGS_OFFLINE_EDITING_H 20 #define QGS_OFFLINE_EDITING_H 22 #include "qgis_core.h" 68 bool convertToOfflineProject(
const QString &offlineDataPath,
const QString &offlineDbFile,
const QStringList &layerIds,
bool onlySelected =
false,
ContainerType containerType = SpatiaLite );
71 bool isOfflineProject()
const;
81 void progressStarted();
89 void layerProgressUpdated(
int layer,
int numLayers );
103 void progressUpdated(
int progress );
106 void progressStopped();
113 void warning(
const QString &title,
const QString &message );
116 void initializeSpatialMetadata(
sqlite3 *sqlite_handle );
117 bool createOfflineDb(
const QString &offlineDbPath,
ContainerType containerType = SpatiaLite );
118 void createLoggingTables(
sqlite3 *db );
147 void showWarning(
const QString &message );
150 int getOrCreateLayerId(
sqlite3 *db,
const QString &qgisLayerId );
151 int getCommitNo(
sqlite3 *db );
152 void increaseCommitNo(
sqlite3 *db );
158 int sqlExec(
sqlite3 *db,
const QString &sql );
159 int sqlQueryInt(
sqlite3 *db,
const QString &sql,
int defaultValue );
160 QList<int> sqlQueryInts(
sqlite3 *db,
const QString &sql );
162 QList<QgsField> sqlQueryAttributesAdded(
sqlite3 *db,
const QString &sql );
165 struct AttributeValueChange
171 typedef QList<AttributeValueChange> AttributeValueChanges;
172 AttributeValueChanges sqlQueryAttributeValueChanges(
sqlite3 *db,
const QString &sql );
174 struct GeometryChange
179 typedef QList<GeometryChange> GeometryChanges;
180 GeometryChanges sqlQueryGeometryChanges(
sqlite3 *db,
const QString &sql );
184 void committedAttributesAdded(
const QString &qgisLayerId,
const QList<QgsField> &addedAttributes );
185 void committedFeaturesAdded(
const QString &qgisLayerId,
const QgsFeatureList &addedFeatures );
186 void committedFeaturesRemoved(
const QString &qgisLayerId,
const QgsFeatureIds &deletedFeatureIds );
187 void committedAttributeValuesChanges(
const QString &qgisLayerId,
const QgsChangedAttributesMap &changedAttrsMap );
188 void committedGeometriesChanges(
const QString &qgisLayerId,
const QgsGeometryMap &changedGeometries );
189 void startListenFeatureChanges();
190 void stopListenFeatureChanges();
193 #endif // QGS_OFFLINE_EDITING_H QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Base class for all map layer types.
QSet< QgsFeatureId > QgsFeatureIds
QList< QgsFeature > QgsFeatureList
ContainerType
Type of offline database container file.
Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes o...
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Represents a vector layer which manages a vector based data sets.