QGIS API Documentation 3.29.0-Master (19d7edcfed)
qgsvectortileconnection.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectortileconnection.h
3 ---------------------
4 begin : March 2020
5 copyright : (C) 2020 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 QGSVECTORTILECONNECTION_H
17#define QGSVECTORTILECONNECTION_H
18
19#include "qgis_core.h"
21
23#define SIP_NO_FILE
24
25#include <QStringList>
26
28#include "qgshttpheaders.h"
29
30class CORE_EXPORT QgsVectorTileProviderConnection : public QgsAbstractProviderConnection
31{
32
33 public:
34
35#ifndef SIP_RUN
36
38
39 static const QgsSettingsEntryString *settingsUrl;
40 static const QgsSettingsEntryInteger *settingsZmin;
41 static const QgsSettingsEntryInteger *settingsZmax;
42 static const QgsSettingsEntryString *settingsAuthcfg;
43 static const QgsSettingsEntryString *settingsUsername;
44 static const QgsSettingsEntryString *settingsPassword;
45 static const QgsSettingsEntryString *settingsStyleUrl;
46 static const QgsSettingsEntryString *settingsServiceType;
47 static const QgsSettingsEntryVariantMap *settingsHeaders;
48#endif
49
50 QgsVectorTileProviderConnection( const QString &name );
51 QgsVectorTileProviderConnection( const QString &uri, const QVariantMap &configuration );
52
53 virtual void store( const QString &name ) const override;
54 virtual void remove( const QString &name ) const override;
55
61 enum ServiceType
62 {
63 Generic,
64 ArcgisVectorTileService,
65 };
66
68 struct Data
69 {
70 QString url;
71 int zMin = -1;
72 int zMax = -1;
73
74 ServiceType serviceType = Generic;
75
77 QString authCfg;
79 QString username;
81 QString password;
83 QgsHttpHeaders httpHeaders;
84
86 QString styleUrl;
87
88 };
89
91 static QString encodedUri( const Data &conn );
93 static Data decodedUri( const QString &uri );
94
96 static QString encodedLayerUri( const Data &conn );
97
99 static QStringList connectionList();
101 static Data connection( const QString &name );
103 static void deleteConnection( const QString &name );
105 static void addConnection( const QString &name, Data conn );
107 static QString selectedConnection();
109 static void setSelectedConnection( const QString &connName );
110};
111
113
114#endif // QGSVECTORTILECONNECTION_H
The QgsAbstractProviderConnection provides an interface for data provider connections.
virtual void remove(const QString &name) const =0
Deletes the connection from the settings.
virtual void store(const QString &name) const =0
Stores the connection in the settings.
This class implements simple http header management.
An integer settings entry.
A string settings entry.
A string list settings entry.
QgsSettingsTreeNamedListNode is a named list tree element for the settings registry to help organizin...
@ NamedListSelectedItemSetting
Creates a setting to store which is the current item.
QgsSettingsTreeNamedListNode * createNamedListElement(const QString &key, const QgsSettingsTreeNode::Options &options=QgsSettingsTreeNode::Options()) SIP_THROW(QgsSettingsException)
Creates a named list tree element.
static QgsSettingsTreeNode * sTreeConnections
Definition: qgssettings.h:93