QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgstiledsceneconnection.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstiledsceneconnection.h
3 ---------------------
4 begin : June 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson 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 QGSTILEDSCENECONNECTION_H
17#define QGSTILEDSCENECONNECTION_H
18
19#include "qgis_core.h"
20#include "qgssettingstree.h"
21#include "qgssettingstreenode.h"
22
23#define SIP_NO_FILE
24
25#include <QStringList>
26
28#include "qgshttpheaders.h"
29
33
43{
44
45 public:
46
47#ifndef SIP_RUN
48
50 static inline QgsSettingsTreeNamedListNode *sTreeConnectionTiledScene = QgsSettingsTree::sTreeConnections->createNamedListNode( QStringLiteral( "tiled-scene" ), Qgis::SettingsTreeNodeOption::NamedListSelectedItemSetting );
51
52 static const QgsSettingsEntryString *settingsProvider;
53 static const QgsSettingsEntryString *settingsUrl;
54 static const QgsSettingsEntryString *settingsAuthcfg;
55 static const QgsSettingsEntryString *settingsUsername;
56 static const QgsSettingsEntryString *settingsPassword;
57 static const QgsSettingsEntryVariantMap *settingsHeaders;
58
60#endif
61
65 QgsTiledSceneProviderConnection( const QString &name );
66
70 QgsTiledSceneProviderConnection( const QString &uri, const QString &provider, const QVariantMap &configuration );
71
72 void store( const QString &name ) const override;
73 void remove( const QString &name ) const override;
74
78 QString providerKey() const { return mProvider; }
79
88 struct Data
89 {
91 QString provider;
92
94 QString url;
95
97 QString authCfg;
98
100 QString username;
101
103 QString password;
104
107
108 };
109
116 static QString encodedUri( const Data &data );
117
124 static Data decodedUri( const QString &uri );
125
132 static QString encodedLayerUri( const Data &data );
133
137 static QStringList connectionList();
138
142 static Data connection( const QString &name );
143
147 static void addConnection( const QString &name, const Data &connection );
148
154 static QString selectedConnection();
155
161 static void setSelectedConnection( const QString &name );
162
163 private:
164
165 QString mProvider;
166};
167
168#endif // QGSTILEDSCENECONNECTION_H
@ NamedListSelectedItemSetting
Creates a setting to store which is the current item.
Definition qgis.h:667
QVariantMap configuration() const
Returns the connection configuration parameters.
QgsAbstractProviderConnection(const QString &name)
Creates a new connection with name by reading its configuration from the settings.
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.
QString uri() const
Returns the connection data source URI string representation.
Implements simple HTTP header management.
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
static QString selectedConnection()
Returns the name of the last used connection.
static Data decodedUri(const QString &uri)
Returns a connection uri decoded to a data structure.
static Data connection(const QString &name)
Returns connection details for the stored connection with the specified name.
PRIVATE QgsTiledSceneProviderConnection(const QString &name)
Constructor for QgsTiledSceneProviderConnection, using the stored settings with the specified connect...
static void addConnection(const QString &name, const Data &connection)
Stores a new connection, under the specified connection name.
static void setSelectedConnection(const QString &name)
Stores the name of the last used connection.
static QStringList connectionList()
Returns a list of the stored connection names.
QString providerKey() const
Returns the data provider associated with the connection.
static QString encodedUri(const Data &data)
Returns connection data encoded as a string.
static QString encodedLayerUri(const Data &data)
Returns connection data encoded as a string containing a URI for a QgsTiledSceneLayer.
Represents decoded data of a tiled scene connection.
QString authCfg
Authentication configuration ID.