/** \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,
      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, bool onlySelected = false );

    /** Return true if current project is offline */
    bool isOfflineProject() const;

    /** 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();

    /**
     * Emitted when a warning needs to be displayed.
     * @param title title string for message
     * @param message A descriptive message for the warning
     */
    void warning( const QString& title, const QString& message );
};