QGIS API Documentation  2.99.0-Master (69af2f5)
qgsmanageconnectionsdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmanageconnectionsdialog.h
3  ---------------------
4  begin : Dec 2009
5  copyright : (C) 2009 by Alexander Bruy
6  email : alexander dot bruy at gmail dot com
7 
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 
17 
18 #ifndef QGSMANAGECONNECTIONSDIALOG_H
19 #define QGSMANAGECONNECTIONSDIALOG_H
20 
21 #include <QDialog>
22 #include <QDomDocument>
23 #include "ui_qgsmanageconnectionsdialogbase.h"
24 #include "qgis_gui.h"
25 #include "qgis_sip.h"
26 
30 class GUI_EXPORT QgsManageConnectionsDialog : public QDialog, private Ui::QgsManageConnectionsDialogBase
31 {
32  Q_OBJECT
33 
34  public:
35  enum Mode
36  {
38  Import
39  };
40 
41  enum Type
42  {
43  WMS,
45  WFS,
47  DB2,
48  WCS,
50  };
51 
52  // constructor
53  // mode argument must be 0 for export and 1 for import
54  // type argument must be 0 for WMS and 1 for PostGIS
55  QgsManageConnectionsDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Mode mode = Export, Type type = WMS, const QString &fileName = "" );
56 
57  public slots:
58  void doExportImport();
59  void selectAll();
60  void clearSelection();
61  void selectionChanged();
62 
63  private:
64  bool populateConnections();
65 
66  QDomDocument saveOWSConnections( const QStringList &connections, const QString &service );
67  QDomDocument saveWfsConnections( const QStringList &connections );
68  QDomDocument savePgConnections( const QStringList &connections );
69  QDomDocument saveMssqlConnections( const QStringList &connections );
70  QDomDocument saveOracleConnections( const QStringList &connections );
71  QDomDocument saveDb2Connections( const QStringList &connections );
72 
73  void loadOWSConnections( const QDomDocument &doc, const QStringList &items, const QString &service );
74  void loadWfsConnections( const QDomDocument &doc, const QStringList &items );
75  void loadPgConnections( const QDomDocument &doc, const QStringList &items );
76  void loadMssqlConnections( const QDomDocument &doc, const QStringList &items );
77  void loadOracleConnections( const QDomDocument &doc, const QStringList &items );
78  void loadDb2Connections( const QDomDocument &doc, const QStringList &items );
79 
80  QString mFileName;
81  Mode mDialogMode;
82  Type mConnectionType;
83 };
84 
85 #endif // QGSMANAGECONNECTIONSDIALOG_H
86 
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:34