QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
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#include "qgssettingstree.h"
21#include "qgssettingstreenode.h"
22
24#define SIP_NO_FILE
25
26#include <QStringList>
27
29#include "qgshttpheaders.h"
30
34
35class CORE_EXPORT QgsVectorTileProviderConnection : public QgsAbstractProviderConnection
36{
37
38 public:
39
40#ifndef SIP_RUN
41
43
44 static const QgsSettingsEntryString *settingsUrl;
45 static const QgsSettingsEntryInteger *settingsZmin;
46 static const QgsSettingsEntryInteger *settingsZmax;
47 static const QgsSettingsEntryString *settingsAuthcfg;
48 static const QgsSettingsEntryString *settingsUsername;
49 static const QgsSettingsEntryString *settingsPassword;
50 static const QgsSettingsEntryString *settingsStyleUrl;
51 static const QgsSettingsEntryString *settingsServiceType;
52 static const QgsSettingsEntryVariantMap *settingsHeaders;
53#endif
54
55 QgsVectorTileProviderConnection( const QString &name );
56 QgsVectorTileProviderConnection( const QString &uri, const QVariantMap &configuration );
57
58 virtual void store( const QString &name ) const override;
59 virtual void remove( const QString &name ) const override;
60
66 enum ServiceType
67 {
68 Generic,
69 ArcgisVectorTileService,
70 };
71
73 struct Data
74 {
75 QString url;
76 int zMin = -1;
77 int zMax = -1;
78
79 ServiceType serviceType = Generic;
80
82 QString authCfg;
84 QString username;
86 QString password;
88 QgsHttpHeaders httpHeaders;
89
91 QString styleUrl;
92
93 };
94
96 static QString encodedUri( const Data &conn );
98 static Data decodedUri( const QString &uri );
99
101 static QString encodedLayerUri( const Data &conn );
102
104 static QStringList connectionList();
106 static Data connection( const QString &name );
108 static void deleteConnection( const QString &name );
110 static void addConnection( const QString &name, Data conn );
112 static QString selectedConnection();
114 static void setSelectedConnection( const QString &connName );
115};
116
118
119#endif // QGSVECTORTILECONNECTION_H
@ NamedListSelectedItemSetting
Creates a setting to store which is the current item.
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 node for the settings tree to help organizing and i...
QgsSettingsTreeNamedListNode * createNamedListNode(const QString &key, const Qgis::SettingsTreeNodeOptions &options=Qgis::SettingsTreeNodeOptions())
Creates a named list tree node.
static QgsSettingsTreeNode * sTreeConnections