QGIS API Documentation 3.99.0-Master (e9821da5c6b)
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#include <QString>
24
25using namespace Qt::StringLiterals;
26
27#define SIP_NO_FILE
28
29#include <QStringList>
30
32#include "qgshttpheaders.h"
33
37
47{
48
49 public:
50
51#ifndef SIP_RUN
52
54 static inline QgsSettingsTreeNamedListNode *sTreeConnectionTiledScene = QgsSettingsTree::sTreeConnections->createNamedListNode( u"tiled-scene"_s, Qgis::SettingsTreeNodeOption::NamedListSelectedItemSetting );
55
56 static const QgsSettingsEntryString *settingsProvider;
57 static const QgsSettingsEntryString *settingsUrl;
58 static const QgsSettingsEntryString *settingsAuthcfg;
59 static const QgsSettingsEntryString *settingsUsername;
60 static const QgsSettingsEntryString *settingsPassword;
61 static const QgsSettingsEntryVariantMap *settingsHeaders;
62
64#endif
65
69 QgsTiledSceneProviderConnection( const QString &name );
70
74 QgsTiledSceneProviderConnection( const QString &uri, const QString &provider, const QVariantMap &configuration );
75
76 void store( const QString &name ) const override;
77 void remove( const QString &name ) const override;
78
82 QString providerKey() const { return mProvider; }
83
92 struct Data
93 {
95 QString provider;
96
98 QString url;
99
101 QString authCfg;
102
104 QString username;
105
107 QString password;
108
111
112 };
113
120 static QString encodedUri( const Data &data );
121
128 static Data decodedUri( const QString &uri );
129
136 static QString encodedLayerUri( const Data &data );
137
141 static QStringList connectionList();
142
146 static Data connection( const QString &name );
147
151 static void addConnection( const QString &name, const Data &connection );
152
158 static QString selectedConnection();
159
165 static void setSelectedConnection( const QString &name );
166
167 private:
168
169 QString mProvider;
170};
171
172#endif // QGSTILEDSCENECONNECTION_H
@ NamedListSelectedItemSetting
Creates a setting to store which is the current item.
Definition qgis.h:686
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.