QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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
23#include <QString>
24
25#define SIP_NO_FILE
26
27using namespace Qt::StringLiterals;
28
30
31#include <QStringList>
32
34#include "qgshttpheaders.h"
35
39
40class CORE_EXPORT QgsVectorTileProviderConnection : public QgsAbstractProviderConnection
41{
42 public:
43#ifndef SIP_RUN
44
45 static inline QgsSettingsTreeNamedListNode *sTreeConnectionVectorTile
47
48 static const QgsSettingsEntryString *settingsUrl;
49 static const QgsSettingsEntryInteger *settingsZmin;
50 static const QgsSettingsEntryInteger *settingsZmax;
51 static const QgsSettingsEntryString *settingsAuthcfg;
52 static const QgsSettingsEntryString *settingsUsername;
53 static const QgsSettingsEntryString *settingsPassword;
54 static const QgsSettingsEntryString *settingsStyleUrl;
55 static const QgsSettingsEntryString *settingsServiceType;
56 static const QgsSettingsEntryVariantMap *settingsHeaders;
57#endif
58
59 QgsVectorTileProviderConnection( const QString &name );
60 QgsVectorTileProviderConnection( const QString &uri, const QVariantMap &configuration );
61
62 void store( const QString &name ) const override;
63 void remove( const QString &name ) const override;
64
70 enum ServiceType
71 {
72 Generic,
73 ArcgisVectorTileService,
74 };
75
77 struct Data
78 {
79 QString url;
80 int zMin = -1;
81 int zMax = -1;
82
83 ServiceType serviceType = Generic;
84
86 QString authCfg;
88 QString username;
90 QString password;
92 QgsHttpHeaders httpHeaders;
93
95 QString styleUrl;
96 };
97
99 static QString encodedUri( const Data &conn );
101 static Data decodedUri( const QString &uri );
102
104 static QString encodedLayerUri( const Data &conn );
105
107 static QStringList connectionList();
109 static Data connection( const QString &name );
111 static void deleteConnection( const QString &name );
113 static void addConnection( const QString &name, Data conn );
115 static QString selectedConnection();
117 static void setSelectedConnection( const QString &connName );
118};
119
121
122#endif // QGSVECTORTILECONNECTION_H
@ NamedListSelectedItemSetting
Creates a setting to store which is the current item.
Definition qgis.h:693
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.
An integer settings entry.
A string settings entry.
A string list settings entry.
A named list tree node for the settings tree to help organizing and introspecting the tree.
static QgsSettingsTreeNode * sTreeConnections