QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 #include "qgsdatasourceuri.h"
25 #include "qgsexception.h"
26 
45 {
46 
47 #ifdef SIP_RUN
49  if ( dynamic_cast<QgsAbstractDatabaseProviderConnection *>( sipCpp ) != NULL )
50  {
51  sipType = sipType_QgsAbstractDatabaseProviderConnection;
52  }
53  else if ( dynamic_cast<QgsAbstractProviderConnection *>( sipCpp ) != NULL )
54  {
55  sipType = sipType_QgsAbstractProviderConnection;
56  }
57  else
58  {
59  sipType = 0;
60  }
61  SIP_END
62 #endif
63 
64  public:
65 
70  QgsAbstractProviderConnection( const QString &name );
71 
77  QgsAbstractProviderConnection( const QString &uri, const QVariantMap &configuration );
78 
79  virtual ~QgsAbstractProviderConnection() = default;
80 
85  virtual void store( const QString &name ) const = 0;
86 
90  virtual void remove( const QString &name ) const = 0;
91 
95  QString uri() const;
96 
100  void setUri( const QString &uri );
101 
105  QVariantMap configuration() const;
106 
110  void setConfiguration( const QVariantMap &configuration );
111 
112  private:
113 
114  QString mUri;
115  QVariantMap mConfiguration;
116 
117 };
118 
119 #endif // QGSABSTRACTPROVIDERCONNECTION_H
The QgsAbstractProviderConnection provides an interface for data provider connections.
#define SIP_END
Definition: qgis_sip.h:189
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172