QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsnewhttpconnection.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnewhttpconnection.cpp - selector for a new HTTP server for WMS, etc.
3  -------------------
4  begin : 3 April 2005
5  copyright : (C) 2005 by Brendan Morley
6  email : morb at ozemail dot com dot au
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSNEWHTTPCONNECTION_H
19 #define QGSNEWHTTPCONNECTION_H
20 
21 #include "qgis_sip.h"
22 #include "ui_qgsnewhttpconnectionbase.h"
23 #include "qgsguiutils.h"
24 #include "qgis_gui.h"
25 
27 
33 class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBase
34 {
35  Q_OBJECT
36 
37  public:
38 
44  {
45  ConnectionWfs = 1 << 1,
46  ConnectionWms = 1 << 2,
47  ConnectionWcs = 1 << 3,
48  ConnectionOther = 1 << 4,
49  };
50  Q_DECLARE_FLAGS( ConnectionTypes, ConnectionType )
51 
52 
56  enum Flag
57  {
58  FlagShowTestConnection = 1 << 1,
59  FlagHideAuthenticationGroup = 1 << 2,
60  };
61  Q_DECLARE_FLAGS( Flags, Flag )
62 
63 
72  QgsNewHttpConnection( QWidget *parent SIP_TRANSFERTHIS = nullptr,
73  QgsNewHttpConnection::ConnectionTypes types = ConnectionWms,
74  const QString &baseKey = "qgis/connections-wms/",
75  const QString &connectionName = QString(),
76  QgsNewHttpConnection::Flags flags = nullptr,
77  Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
78 
83  QString name() const;
84 
89  QString url() const;
90 
91  public slots:
92 
93  void accept() override;
94 
95  private slots:
96 
97  void nameChanged( const QString & );
98  void urlChanged( const QString & );
99  void updateOkButtonState();
100  void wfsVersionCurrentIndexChanged( int index );
101  void wfsFeaturePagingStateChanged( int state );
102 
103  protected:
104 
110  virtual bool validate();
111 
116  QPushButton *testConnectButton();
117 
122  QgsAuthSettingsWidget *authSettingsWidget() SIP_SKIP;
123 
128  QPushButton *wfsVersionDetectButton() SIP_SKIP;
129 
134  QComboBox *wfsVersionComboBox() SIP_SKIP;
135 
140  QCheckBox *wfsPagingEnabledCheckBox() SIP_SKIP;
141 
146  QLineEdit *wfsPageSizeLineEdit() SIP_SKIP;
147 
152  QUrl urlTrimmed() const SIP_SKIP;
153 
159  virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
160 
166  virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
167 
173  void updateServiceSpecificSettings();
174 
175  private:
176 
177  ConnectionTypes mTypes = ConnectionWms;
178 
179  QString mBaseKey;
180  QString mCredentialsBaseKey;
181  QString mOriginalConnName; //store initial name to delete entry in case of rename
182  void showHelp();
183 
184 };
185 
186 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsNewHttpConnection::ConnectionTypes )
187 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsNewHttpConnection::Flags )
188 
189 // clazy:excludeall=qstring-allocations
190 
191 #endif // QGSNEWHTTPCONNECTION_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
#define SIP_SKIP
Definition: qgis_sip.h:119
The QgsGuiUtils namespace contains constants and helper functions used throughout the QGIS GUI...
Definition: qgsguiutils.cpp:27
Flag
Flags controlling dialog behavior.
ConnectionType
Available connection types for configuring in the dialog.
Dialog to allow the user to configure and save connection information for an HTTP Server for WMS...