QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
project
qgsprojectstorage.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsprojectstorage.h
3
--------------------------------------
4
Date : March 2018
5
Copyright : (C) 2018 by Martin Dobias
6
Email : wonder dot sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSPROJECTSTORAGE_H
17
#define QGSPROJECTSTORAGE_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
22
#include <QDateTime>
23
#include <QString>
24
25
class
QIODevice;
26
27
class
QgsReadWriteContext
;
28
36
class
CORE_EXPORT
QgsProjectStorage
37
{
38
public
:
44
class
Metadata
45
{
46
public
:
48
QString
name
;
50
QDateTime
lastModified
;
51
};
52
53
virtual
~QgsProjectStorage
() =
default
;
54
59
virtual
QString
type
() = 0;
60
70
virtual
bool
isSupportedUri
(
const
QString &uri )
const
;
71
73
virtual
QStringList
listProjects
(
const
QString &uri ) = 0;
74
81
virtual
bool
readProject
(
const
QString &uri, QIODevice *device,
QgsReadWriteContext
&context ) = 0;
82
89
virtual
bool
writeProject
(
const
QString &uri, QIODevice *device,
QgsReadWriteContext
&context ) = 0;
90
95
virtual
bool
removeProject
(
const
QString &uri ) = 0;
96
101
virtual
bool
renameProject
(
const
QString &uri,
const
QString &uriNew )
102
{
103
Q_UNUSED( uri )
104
Q_UNUSED( uriNew );
105
return
false
;
106
}
107
112
virtual
bool
readProjectStorageMetadata
(
const
QString &uri,
QgsProjectStorage::Metadata
&metadata
SIP_OUT
)
113
{
114
Q_UNUSED( uri )
115
Q_UNUSED( metadata );
116
return
false
;
117
}
118
125
virtual
QString filePath(
const
QString &uri );
126
133
Q_DECL_DEPRECATED
virtual
QString
visibleName
()
SIP_DEPRECATED
{
return
QString(); }
134
140
Q_DECL_DEPRECATED
virtual
QString
showLoadGui
()
SIP_DEPRECATED
{
return
QString(); }
141
147
Q_DECL_DEPRECATED
virtual
QString
showSaveGui
()
SIP_DEPRECATED
{
return
QString(); }
148
};
149
150
#endif
// QGSPROJECTSTORAGE_H
QgsProjectStorage::Metadata
Metadata associated with a project.
Definition
qgsprojectstorage.h:45
QgsProjectStorage::Metadata::name
QString name
Name of the project - equivalent to a file's base name (i.e. without path and extension).
Definition
qgsprojectstorage.h:48
QgsProjectStorage::Metadata::lastModified
QDateTime lastModified
Date and local time when the file was last modified.
Definition
qgsprojectstorage.h:50
QgsProjectStorage
Abstract interface for project storage - to be implemented by various backends and registered in QgsP...
Definition
qgsprojectstorage.h:37
QgsProjectStorage::showSaveGui
virtual Q_DECL_DEPRECATED QString showSaveGui()
Opens GUI to allow user to select where a project should be saved (GUI specific to this storage type)...
Definition
qgsprojectstorage.h:147
QgsProjectStorage::renameProject
virtual bool renameProject(const QString &uri, const QString &uriNew)
Rename an existing project at the given URI to a different URI.
Definition
qgsprojectstorage.h:101
QgsProjectStorage::isSupportedUri
virtual bool isSupportedUri(const QString &uri) const
Returns true if the specified uri is supported by the storage provider.
Definition
qgsprojectstorage.cpp:18
QgsProjectStorage::writeProject
virtual bool writeProject(const QString &uri, QIODevice *device, QgsReadWriteContext &context)=0
Writes project file content stored in given device (could be e.g.
QgsProjectStorage::showLoadGui
virtual Q_DECL_DEPRECATED QString showLoadGui()
Opens GUI to allow user to select a project to be loaded (GUI specific to this storage type).
Definition
qgsprojectstorage.h:140
QgsProjectStorage::listProjects
virtual QStringList listProjects(const QString &uri)=0
Returns list of all projects for given URI (specific to each storage backend).
QgsProjectStorage::~QgsProjectStorage
virtual ~QgsProjectStorage()=default
QgsProjectStorage::type
virtual QString type()=0
Unique identifier of the project storage type.
QgsProjectStorage::readProject
virtual bool readProject(const QString &uri, QIODevice *device, QgsReadWriteContext &context)=0
Reads project file content stored in the backend at the specified URI to the given device (could be e...
QgsProjectStorage::removeProject
virtual bool removeProject(const QString &uri)=0
Removes an existing project at the given URI.
QgsProjectStorage::readProjectStorageMetadata
virtual bool readProjectStorageMetadata(const QString &uri, QgsProjectStorage::Metadata &metadata)
Reads project metadata (e.g.
Definition
qgsprojectstorage.h:112
QgsProjectStorage::visibleName
virtual Q_DECL_DEPRECATED QString visibleName()
Returns human-readable name of the storage.
Definition
qgsprojectstorage.h:133
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
qgis_sip.h
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition
qgis_sip.h:113
SIP_OUT
#define SIP_OUT
Definition
qgis_sip.h:57
Generated on
for QGIS API Documentation by
1.17.0