-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move QgsOfflineEditing to core and add SIP bindings; refactor Offline…
… Editing Plugin
- Loading branch information
Showing
8 changed files
with
213 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** \class QgsOfflineEditing | ||
* \brief Class for accessing functionality of Offline Editing Plugin. | ||
* This class can be used to access offline editing functionality from plugins. | ||
*/ | ||
class QgsOfflineEditing : QObject | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsofflineediting.h> | ||
%End | ||
|
||
public: | ||
enum ProgressMode { | ||
CopyFeatures = 0, | ||
ProcessFeatures, | ||
AddFields, | ||
AddFeatures, | ||
RemoveFeatures, | ||
UpdateFeatures, | ||
UpdateGeometries | ||
}; | ||
|
||
QgsOfflineEditing(); | ||
~QgsOfflineEditing(); | ||
|
||
/** convert current project for offline editing | ||
* @param offlineDataPath path to offline db file | ||
* @param offlineDbFile offline db file name | ||
* @param layerIds list of layer names to convert | ||
*/ | ||
bool convertToOfflineProject( const QString& offlineDataPath, const QString& offlineDbFile, const QStringList& layerIds ); | ||
|
||
/** return true if current project is offline */ | ||
bool isOfflineProject(); | ||
|
||
/** synchronize to remote layers */ | ||
void synchronize(); | ||
|
||
signals: | ||
/** emit a signal that processing has started */ | ||
void progressStarted(); | ||
|
||
/** emit a signal that the next layer of numLayers has started processing | ||
* @param layer current layer index | ||
* @param numLayers total number of layers | ||
*/ | ||
void layerProgressUpdated( int layer, int numLayers ); | ||
|
||
/** emit a signal that sets the mode for the progress of the current operation | ||
* @param mode progress mode | ||
* @param maximum total number of entities to process in the current operation | ||
*/ | ||
void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum ); | ||
|
||
/** emit a signal with the progress of the current mode | ||
* @param progress current index of processed entities | ||
*/ | ||
void progressUpdated( int progress ); | ||
|
||
/** emit a signal that processing of all layers has finished */ | ||
void progressStopped(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.