|
QGIS API Documentation
master-59fd5e0
|
00001 /*************************************************************************** 00002 qgsmanageconnectionsdialog.h 00003 --------------------- 00004 begin : Dec 2009 00005 copyright : (C) 2009 by Alexander Bruy 00006 email : alexander dot bruy at gmail dot com 00007 00008 *************************************************************************** 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 ***************************************************************************/ 00016 00017 00018 #ifndef QGSMANAGECONNECTIONSDIALOG_H 00019 #define QGSMANAGECONNECTIONSDIALOG_H 00020 00021 #include <QDialog> 00022 #include <QDomDocument> 00023 #include "ui_qgsmanageconnectionsdialogbase.h" 00024 00025 class GUI_EXPORT QgsManageConnectionsDialog : public QDialog, private Ui::QgsManageConnectionsDialogBase 00026 { 00027 Q_OBJECT 00028 00029 public: 00030 enum Mode 00031 { 00032 Export, 00033 Import 00034 }; 00035 00036 enum Type 00037 { 00038 WMS, 00039 PostGIS, 00040 WFS, 00041 MSSQL, 00042 WCS, 00043 Oracle, 00044 }; 00045 00046 // constructor 00047 // mode argument must be 0 for export and 1 for import 00048 // type argument must be 0 for WMS and 1 for PostGIS 00049 QgsManageConnectionsDialog( QWidget *parent = NULL, Mode mode = Export, Type type = WMS, QString fileName = "" ); 00050 00051 public slots: 00052 void doExportImport(); 00053 void selectAll(); 00054 void clearSelection(); 00055 00056 private: 00057 bool populateConnections(); 00058 00059 QDomDocument saveOWSConnections( const QStringList &connections, const QString &service ); 00060 QDomDocument saveWFSConnections( const QStringList &connections ); 00061 QDomDocument savePgConnections( const QStringList & connections ); 00062 QDomDocument saveMssqlConnections( const QStringList & connections ); 00063 QDomDocument saveOracleConnections( const QStringList & connections ); 00064 00065 void loadOWSConnections( const QDomDocument &doc, const QStringList &items, const QString &service ); 00066 void loadWFSConnections( const QDomDocument &doc, const QStringList &items ); 00067 void loadPgConnections( const QDomDocument &doc, const QStringList &items ); 00068 void loadMssqlConnections( const QDomDocument &doc, const QStringList &items ); 00069 void loadOracleConnections( const QDomDocument &doc, const QStringList &items ); 00070 00071 QString mFileName; 00072 Mode mDialogMode; 00073 Type mConnectionType; 00074 }; 00075 00076 #endif // QGSMANAGECONNECTIONSDIALOG_H 00077