QGIS API Documentation 3.99.0-Master (a5475b57e34)
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
25#define SIP_NO_FILE
26
27using namespace Qt::StringLiterals;
28
29
30#include <QStringList>
31
33#include "qgshttpheaders.h"
34
38
48{
49
50 public:
51
52#ifndef SIP_RUN
53
55 static inline QgsSettingsTreeNamedListNode *sTreeConnectionTiledScene = QgsSettingsTree::sTreeConnections->createNamedListNode( u"tiled-scene"_s, Qgis::SettingsTreeNodeOption::NamedListSelectedItemSetting );
56
57 static const QgsSettingsEntryString *settingsProvider;
58 static const QgsSettingsEntryString *settingsUrl;
59 static const QgsSettingsEntryString *settingsAuthcfg;
60 static const QgsSettingsEntryString *settingsUsername;
61 static const QgsSettingsEntryString *settingsPassword;
62 static const QgsSettingsEntryVariantMap *settingsHeaders;
63
65#endif
66
70 QgsTiledSceneProviderConnection( const QString &name );
71
75 QgsTiledSceneProviderConnection( const QString &uri, const QString &provider, const QVariantMap &configuration );
76
77 void store( const QString &name ) const override;
78 void remove( const QString &name ) const override;
79
83 QString providerKey() const { return mProvider; }
84
93 struct Data
94 {
96 QString provider;
97
99 QString url;
100
102 QString authCfg;
103
105 QString username;
106
108 QString password;
109
112
113 };
114
121 static QString encodedUri( const Data &data );
122
129 static Data decodedUri( const QString &uri );
130
137 static QString encodedLayerUri( const Data &data );
138
142 static QStringList connectionList();
143
147 static Data connection( const QString &name );
148
152 static void addConnection( const QString &name, const Data &connection );
153
159 static QString selectedConnection();
160
166 static void setSelectedConnection( const QString &name );
167
168 private:
169
170 QString mProvider;
171};
172
173#endif // QGSTILEDSCENECONNECTION_H
@ NamedListSelectedItemSetting
Creates a setting to store which is the current item.
Definition qgis.h:688
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.