QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
25 class GUI_EXPORT QgsManageConnectionsDialog : public QDialog, private Ui::QgsManageConnectionsDialogBase
26 {
27  Q_OBJECT
28 
29  public:
30  enum Mode
31  {
33  Import
34  };
35 
36  enum Type
37  {
38  WMS,
40  WFS,
42  WCS,
44  };
45 
46  // constructor
47  // mode argument must be 0 for export and 1 for import
48  // type argument must be 0 for WMS and 1 for PostGIS
49  QgsManageConnectionsDialog( QWidget *parent = NULL, Mode mode = Export, Type type = WMS, QString fileName = "" );
50 
51  public slots:
52  void doExportImport();
53  void selectAll();
54  void clearSelection();
55  void selectionChanged();
56 
57  private:
58  bool populateConnections();
59 
60  QDomDocument saveOWSConnections( const QStringList &connections, const QString &service );
61  QDomDocument saveWFSConnections( const QStringList &connections );
62  QDomDocument savePgConnections( const QStringList & connections );
63  QDomDocument saveMssqlConnections( const QStringList & connections );
64  QDomDocument saveOracleConnections( const QStringList & connections );
65 
66  void loadOWSConnections( const QDomDocument &doc, const QStringList &items, const QString &service );
67  void loadWFSConnections( const QDomDocument &doc, const QStringList &items );
68  void loadPgConnections( const QDomDocument &doc, const QStringList &items );
69  void loadMssqlConnections( const QDomDocument &doc, const QStringList &items );
70  void loadOracleConnections( const QDomDocument &doc, const QStringList &items );
71 
72  QString mFileName;
73  Mode mDialogMode;
74  Type mConnectionType;
75 };
76 
77 #endif // QGSMANAGECONNECTIONSDIALOG_H
78