QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
qgsabstractproviderconnection.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsabstractproviderconnection.h - QgsAbstractProviderConnection
3
4 ---------------------
5 begin : 2.8.2019
6 copyright : (C) 2019 by Alessandro Pasotti
7 email : elpaso at itopen dot it
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSABSTRACTPROVIDERCONNECTION_H
17#define QGSABSTRACTPROVIDERCONNECTION_H
18
19#include <QString>
20#include <QVariantMap>
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
24
43{
44
45#ifdef SIP_RUN
47 if ( dynamic_cast<QgsAbstractDatabaseProviderConnection *>( sipCpp ) != NULL )
48 {
49 sipType = sipType_QgsAbstractDatabaseProviderConnection;
50 }
51 else if ( dynamic_cast<QgsAbstractProviderConnection *>( sipCpp ) != NULL )
52 {
53 sipType = sipType_QgsAbstractProviderConnection;
54 }
55 else
56 {
57 sipType = 0;
58 }
60#endif
61
62 public:
63
68 QgsAbstractProviderConnection( const QString &name );
69
75 QgsAbstractProviderConnection( const QString &uri, const QVariantMap &configuration );
76
77 virtual ~QgsAbstractProviderConnection() = default;
78
83 virtual void store( const QString &name ) const = 0;
84
88 virtual void remove( const QString &name ) const = 0;
89
93 virtual QIcon icon() const;
94
98 QString uri() const;
99
103 void setUri( const QString &uri );
104
108 QVariantMap configuration() const;
109
113 void setConfiguration( const QVariantMap &configuration );
114
115 private:
116
117 QString mUri;
118 QVariantMap mConfiguration;
119
120};
121
122#endif // QGSABSTRACTPROVIDERCONNECTION_H
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
The QgsAbstractProviderConnection provides an interface for data provider connections.
virtual ~QgsAbstractProviderConnection()=default
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.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:191
#define SIP_END
Definition qgis_sip.h:208