QGIS API Documentation 3.27.0-Master (1c05421486)
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"
20
22#define SIP_NO_FILE
23
24#include <QStringList>
25
27
28class CORE_EXPORT QgsVectorTileProviderConnection : public QgsAbstractProviderConnection
29{
30
31 public:
32 QgsVectorTileProviderConnection( const QString &name );
33 QgsVectorTileProviderConnection( const QString &uri, const QVariantMap &configuration );
34
35 virtual void store( const QString &name ) const override;
36 virtual void remove( const QString &name ) const override;
37
43 enum ServiceType
44 {
45 Generic,
46 ArcgisVectorTileService,
47 };
48
50 struct Data
51 {
52 QString url;
53 int zMin = -1;
54 int zMax = -1;
55
56 ServiceType serviceType = Generic;
57
59 QString authCfg;
61 QString username;
63 QString password;
65 QgsHttpHeaders httpHeaders;
66
68 QString styleUrl;
69
70 };
71
73 static QString encodedUri( const Data &conn );
75 static Data decodedUri( const QString &uri );
76
78 static QString encodedLayerUri( const Data &conn );
79
81 static QStringList connectionList();
83 static Data connection( const QString &name );
85 static void deleteConnection( const QString &name );
87 static void addConnection( const QString &name, Data conn );
89 static QString selectedConnection();
91 static void setSelectedConnection( const QString &connName );
92};
93
95
96#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.