Quantum GIS API Documentation
1.8
|
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 }; 00043 00044 // constructor 00045 // mode argument must be 0 for export and 1 for import 00046 // type argument must be 0 for WMS and 1 for PostGIS 00047 QgsManageConnectionsDialog( QWidget *parent = NULL, Mode mode = Export, Type type = WMS, QString fileName = "" ); 00048 00049 public slots: 00050 void doExportImport(); 00051 void selectAll(); 00052 void clearSelection(); 00053 00054 private: 00055 bool populateConnections(); 00056 QDomDocument saveWMSConnections( const QStringList &connections ); 00057 QDomDocument saveWFSConnections( const QStringList &connections ); 00058 QDomDocument savePgConnections( const QStringList & connections ); 00059 QDomDocument saveMssqlConnections( const QStringList & connections ); 00060 void loadWMSConnections( const QDomDocument &doc, const QStringList &items ); 00061 void loadWFSConnections( const QDomDocument &doc, const QStringList &items ); 00062 void loadPgConnections( const QDomDocument &doc, const QStringList &items ); 00063 void loadMssqlConnections( const QDomDocument &doc, const QStringList &items ); 00064 00065 QString mFileName; 00066 Mode mDialogMode; 00067 Type mConnectionType; 00068 }; 00069 00070 #endif // QGSMANAGECONNECTIONSDIALOG_H 00071