2018-03-21 11:22:04 +01:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsprojectstorage.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-21 14:36:51 +01:00
|
|
|
|
2018-03-21 11:22:04 +01:00
|
|
|
class QgsProjectStorage
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Abstract interface for project storage - to be implemented by various backends
|
|
|
|
and registered in QgsProjectStorageRegistry.
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsprojectstorage.h"
|
|
|
|
%End
|
|
|
|
public:
|
2018-04-01 22:46:40 +02:00
|
|
|
|
|
|
|
class Metadata
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Metadata associated with a project
|
2018-04-06 11:42:08 +02:00
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
2018-04-01 22:46:40 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsprojectstorage.h"
|
|
|
|
%End
|
|
|
|
public:
|
2018-04-05 11:45:19 +02:00
|
|
|
QString name;
|
2018-04-01 22:46:40 +02:00
|
|
|
QDateTime lastModified;
|
|
|
|
};
|
|
|
|
|
2018-03-21 11:22:04 +01:00
|
|
|
virtual ~QgsProjectStorage();
|
|
|
|
|
|
|
|
virtual QString type() = 0;
|
|
|
|
%Docstring
|
2020-06-15 09:04:13 +10:00
|
|
|
Unique identifier of the project storage type. If :py:func:`~QgsProjectStorage.type` returns "memory", all project file names
|
2018-03-21 11:22:04 +01:00
|
|
|
starting with "memory:" will have read/write redirected through that storage implementation.
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QStringList listProjects( const QString &uri ) = 0;
|
|
|
|
%Docstring
|
|
|
|
Returns list of all projects for given URI (specific to each storage backend)
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool readProject( const QString &uri, QIODevice *device, QgsReadWriteContext &context ) = 0;
|
|
|
|
%Docstring
|
|
|
|
Reads project file content stored in the backend at the specified URI to the given device
|
|
|
|
(could be e.g. a temporary file or a memory buffer). The device is expected to be empty
|
2020-06-15 09:04:13 +10:00
|
|
|
when passed to :py:func:`~QgsProjectStorage.readProject` so that the method can write all data to it and then rewind
|
2018-03-21 11:22:04 +01:00
|
|
|
it using seek(0) to make it ready for reading in :py:class:`QgsProject`.
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool writeProject( const QString &uri, QIODevice *device, QgsReadWriteContext &context ) = 0;
|
|
|
|
%Docstring
|
|
|
|
Writes project file content stored in given device (could be e.g. a temporary file or a memory buffer)
|
|
|
|
using the backend to the specified URI. The device is expected to contain all project file data
|
2020-06-15 09:04:13 +10:00
|
|
|
and having position at the start of the content when passed to :py:func:`~QgsProjectStorage.writeProject` so that the method
|
2018-03-21 11:22:04 +01:00
|
|
|
can read all data from it until it reaches its end.
|
|
|
|
%End
|
|
|
|
|
2018-03-21 14:36:51 +01:00
|
|
|
virtual bool removeProject( const QString &uri ) = 0;
|
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Removes an existing project at the given URI. Returns ``True`` if the removal
|
2018-03-21 14:36:51 +01:00
|
|
|
was successful.
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool renameProject( const QString &uri, const QString &uriNew );
|
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Rename an existing project at the given URI to a different URI. Returns ``True`` if renaming
|
2018-03-21 14:36:51 +01:00
|
|
|
was successful.
|
2018-04-01 22:46:40 +02:00
|
|
|
%End
|
|
|
|
|
2018-04-06 11:42:08 +02:00
|
|
|
virtual bool readProjectStorageMetadata( const QString &uri, QgsProjectStorage::Metadata &metadata /Out/ );
|
2018-04-01 22:46:40 +02:00
|
|
|
%Docstring
|
|
|
|
Reads project metadata (e.g. last modified time) if this is supported by the storage implementation.
|
2019-02-26 19:54:09 +10:00
|
|
|
Returns ``True`` if the metadata were read with success.
|
2019-07-04 11:23:56 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QString filePath( const QString &uri );
|
|
|
|
%Docstring
|
|
|
|
Extracts and returns the file path from a storage backend ``uri``, filesystem-based storage
|
|
|
|
backends should implement this method in order to support relative paths storage.
|
|
|
|
The default implementation returns an empty string.
|
|
|
|
|
|
|
|
.. versionadded:: 3.8.1
|
2018-03-21 14:36:51 +01:00
|
|
|
%End
|
|
|
|
|
2019-06-21 16:28:21 +02:00
|
|
|
virtual QString visibleName() /Deprecated/;
|
2018-03-21 14:36:51 +01:00
|
|
|
%Docstring
|
|
|
|
Returns human-readable name of the storage. Used as the menu item text in QGIS. Empty name
|
2020-06-15 09:04:13 +10:00
|
|
|
indicates that the storage does not implement GUI support (:py:func:`~QgsProjectStorage.showLoadGui` and :py:func:`~QgsProjectStorage.showSaveGui`).
|
2018-03-21 14:36:51 +01:00
|
|
|
The name may be translatable and ideally unique as well.
|
2019-06-21 16:28:21 +02:00
|
|
|
|
2019-10-15 13:17:38 +02:00
|
|
|
.. deprecated:: QGIS 3.10
|
|
|
|
- use QgsProjectStorageGuiProvider for GUI-related project storage functionality
|
2018-03-21 14:36:51 +01:00
|
|
|
%End
|
2018-03-21 11:22:04 +01:00
|
|
|
|
2019-06-21 16:28:21 +02:00
|
|
|
virtual QString showLoadGui() /Deprecated/;
|
2018-03-21 14:36:51 +01:00
|
|
|
%Docstring
|
|
|
|
Opens GUI to allow user to select a project to be loaded (GUI specific to this storage type).
|
|
|
|
Returns project URI if user has picked a project or empty string if the GUI was canceled.
|
2019-06-21 16:28:21 +02:00
|
|
|
|
2019-10-15 13:17:38 +02:00
|
|
|
.. deprecated:: QGIS 3.10
|
|
|
|
- use QgsProjectStorageGuiProvider for GUI-related project storage functionality
|
2018-03-21 14:36:51 +01:00
|
|
|
%End
|
|
|
|
|
2019-06-21 16:28:21 +02:00
|
|
|
virtual QString showSaveGui() /Deprecated/;
|
2018-03-21 14:36:51 +01:00
|
|
|
%Docstring
|
|
|
|
Opens GUI to allow user to select where a project should be saved (GUI specific to this storage type).
|
|
|
|
Returns project URI if user has picked a destination or empty string if the GUI was canceled.
|
2019-06-21 16:28:21 +02:00
|
|
|
|
2019-10-15 13:17:38 +02:00
|
|
|
.. deprecated:: QGIS 3.10
|
|
|
|
- use QgsProjectStorageGuiProvider for GUI-related project storage functionality
|
2018-03-21 14:36:51 +01:00
|
|
|
%End
|
2019-07-04 11:23:56 +02:00
|
|
|
|
2018-03-21 11:22:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsprojectstorage.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|