QGIS API Documentation  2.14.0-Essen
qgsowssourceselect.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsowssourceselect.h - selector for WMS,WFS,WCS layers
3  -------------------
4  begin : 3 April 2005
5  original : (C) 2005 by Brendan Morley email : morb at ozemail dot com dot au
6  wms search : (C) 2009 Mathias Walker <mwa at sourcepole.ch>, Sourcepole AG
7  generalized : (C) 2012 Radim Blazek, based on qgsowsconnection.h
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #ifndef QGSOWSSOURCESELECT_H
21 #define QGSOWSSOURCESELECT_H
22 #include "ui_qgsowssourceselectbase.h"
23 #include "qgsdatasourceuri.h"
24 #include "qgisgui.h"
25 #include "qgscontexthelp.h"
26 
27 #include "qgsdataprovider.h"
28 
29 #include <QStringList>
30 #include <QPushButton>
31 #include <QNetworkRequest>
32 
33 class QgsDataProvider;
34 class QButtonGroup;
36 class QDomDocument;
37 class QDomElement;
38 
39 
49 class GUI_EXPORT QgsOWSSourceSelect : public QDialog, public Ui::QgsOWSSourceSelectBase
50 {
51  Q_OBJECT
52 
53  public:
56  {
59  };
60 
62  QgsOWSSourceSelect( const QString& service, QWidget *parent = nullptr, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags, bool managerMode = false, bool embeddedMode = false );
65 
66  public slots:
67 
69  void on_mNewButton_clicked();
71  void on_mEditButton_clicked();
73  void on_mDeleteButton_clicked();
75  void on_mSaveButton_clicked();
77  void on_mLoadButton_clicked();
78 
82  void on_mConnectButton_clicked();
83 
85  virtual void addClicked();
86 
87  void searchFinished();
88 
90  void on_mChangeCRSButton_clicked();
91 
93  virtual void on_mLayersTreeWidget_itemSelectionChanged();
94 
96  void showStatusMessage( const QString &theMessage );
97 
99  void showError( const QString &theTitle, const QString &theFormat, const QString &theError );
100 
102  void on_mConnectionsComboBox_activated( int );
103 
105  void on_mAddDefaultButton_clicked();
106 
107  void on_mDialogButtonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
108 
109  signals:
110  void addRasterLayer( const QString & rasterLayerPath,
111  const QString & baseName,
112  const QString & providerKey );
113  void connectionsChanged();
114 
115  protected:
120  virtual QList<SupportedFormat> providerFormats();
121 
123  virtual QStringList selectedLayersFormats();
124 
126  virtual QStringList selectedLayersCRSs();
127 
129  virtual QStringList selectedLayersTimes();
130 
131  //virtual QStringList layerCRS( int id );
132 
134  void populateConnectionList();
135 
137  void populateFormats();
138 
140  void clearFormats();
141 
143  void populateCRS();
144 
146  void clearCRS();
147 
149  void populateTimes();
150 
152  void clearTimes();
153 
155  QString connName();
156 
158  QString connectionInfo();
159 
161  void setConnectionListPosition();
162 
164  void addDefaultServers();
165 
168 
171 
174 
175 
181  virtual void populateLayerList();
182 
185  QgsNumericSortTreeWidgetItem *createItem( int id,
186  const QStringList &names,
188  int &layerAndStyleCount,
189  const QMap<int, int> &layerParents,
190  const QMap<int, QStringList> &layerParentNames );
191 
193  QString descriptionForAuthId( const QString& authId );
194 
197 
199 
201 
202  void addWMSListRow( const QDomElement& item, int row );
203  void addWMSListItem( const QDomElement& el, int row, int column );
204 
205  virtual void enableLayersForCrs( QTreeWidgetItem *item );
206 
208  QString selectedFormat();
209 
211  QString selectedCRS();
212 
214  QString selectedTime();
215 
217  QNetworkRequest::CacheLoadControl selectedCacheLoadControl();
218 
221 
224 
227 
230 
231  private:
233  QString mSelectedCRS;
234 
236  QSet<QString> mSelectedLayersCRSs;
237 
239  QList<SupportedFormat> mProviderFormats;
240 
242  QMap<QString, QString> mMimeLabelMap;
243 
244  private slots:
245  void on_mSearchButton_clicked();
246  void on_mSearchTableWidget_itemSelectionChanged();
247  void on_mTilesetsTableWidget_itemClicked( QTableWidgetItem *item );
248  void on_mLayerUpButton_clicked();
249  void on_mLayerDownButton_clicked();
250  virtual void updateButtons();
251 };
252 
253 #endif // QGSOWSSOURCESELECT_H
static const Qt::WindowFlags ModalDialogFlags
Definition: qgisgui.h:49
QMap< QString, QString > mCrsNames
bool mManagerMode
Connections manager mode.
QList< QTreeWidgetItem * > mCurrentSelection
Abstract base class for spatial data provider implementations.
static void run(const QString &context)
bool mEmbeddedMode
Embedded mode, without &#39;Close&#39;.
QPushButton * mAddButton
QgsDataSourceURI mUri
URI for selected connection.
QString mLastLayerName
layer name derived from latest layer selection (updated as long it&#39;s not edited manually) ...
Class for storing the component parts of a PostgreSQL/RDBMS datasource URI.
QString mConnectionInfo
Connection info for selected connection.
QTreeWidgetItem that can sort numerically (as opposed to just lexigraphically)
Dialog to create connections and add layers from WMS, WFS, WCS etc.
void on_mDialogButtonBox_helpRequested()
Formats supported by provider.
typedef WindowFlags
QString mService
Service name.
QTableWidgetItem * mCurrentTileset
QString mConnName
Name for selected connection.