QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgssensorthingsconnection.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssensorthingsconnection.h
3 ---------------------
4 Date : December 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 QGSSENSORTHINGSCONNECTION_H
17#define QGSSENSORTHINGSCONNECTION_H
18
19#define SIP_NO_FILE
20
21#include <QStringList>
22
23#include "qgshttpheaders.h"
24#include "qgis_core.h"
25#include "qgssettingstree.h"
27
33template<class T> class QgsSettingsEntryEnumFlag;
34
44{
45
46 public:
47
49 static inline QgsSettingsTreeNamedListNode *sTreeSensorThingsConnections = QgsSettingsTree::sTreeConnections->createNamedListNode(
50 QStringLiteral( "sensorthings" ), Qgis::SettingsTreeNodeOption::NamedListSelectedItemSetting );
51
52 static const QgsSettingsEntryString *settingsUrl;
53 static const QgsSettingsEntryVariantMap *settingsHeaders;
54 static const QgsSettingsEntryString *settingsUsername;
55 static const QgsSettingsEntryString *settingsPassword;
56 static const QgsSettingsEntryString *settingsAuthcfg;
58
62 QgsSensorThingsProviderConnection( const QString &name );
63
67 QgsSensorThingsProviderConnection( const QString &uri, const QVariantMap &configuration );
68
69 void store( const QString &name ) const final;
70 void remove( const QString &name ) const final;
71
80 struct Data
81 {
83 QString url;
85 QString authCfg;
87 QString username;
89 QString password;
92 };
93
100 static QString encodedUri( const Data &data );
101
108 static Data decodedUri( const QString &uri );
109
116 static QString encodedLayerUri( const Data &data );
117
121 static QStringList connectionList();
122
126 static Data connection( const QString &name );
127
131 static void addConnection( const QString &name, const Data &connection );
132
138 static QString selectedConnection();
139
145 static void setSelectedConnection( const QString &name );
146};
147
148
149#endif // QGSSENSORTHINGSCONNECTION_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.
Represents connections to SensorThings data sources.
A boolean settings entry.
A double settings entry.
A template class for enum and flag settings entry.
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
Represents decoded data of a SensorThings connection.
QString authCfg
Authentication configuration id.