QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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  FlagShowHttpSettings = 1 << 3,
61  };
62  Q_DECLARE_FLAGS( Flags, Flag )
63 
64 
73  QgsNewHttpConnection( QWidget *parent SIP_TRANSFERTHIS = nullptr,
74  QgsNewHttpConnection::ConnectionTypes types = ConnectionWms,
75  const QString &serviceName SIP_PYARGRENAME( settingsKey ) = "WMS", // TODO QGIS 4 remove arg rename
76  const QString &connectionName = QString(),
77  QgsNewHttpConnection::Flags flags = QgsNewHttpConnection::Flags(),
78  Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
79 
84  QString name() const;
85 
90  QString url() const;
91 
92  public slots:
93 
94  void accept() override;
95 
96  private slots:
97 
98  void nameChanged( const QString & );
99  void urlChanged( const QString & );
100  void updateOkButtonState();
101  void wfsVersionCurrentIndexChanged( int index );
102  void wfsFeaturePagingStateChanged( int state );
103 
104  protected:
105 
108  {
109  WFS_VERSION_MAX = 0,
110  WFS_VERSION_1_0 = 1,
111  WFS_VERSION_1_1 = 2,
112  WFS_VERSION_2_0 = 3,
113  WFS_VERSION_API_FEATURES_1_0 = 4,
114  };
115 
121  virtual bool validate();
122 
127  QPushButton *testConnectButton();
128 
133  QgsAuthSettingsWidget *authSettingsWidget() SIP_SKIP;
134 
139  QPushButton *wfsVersionDetectButton() SIP_SKIP;
140 
145  QComboBox *wfsVersionComboBox() SIP_SKIP;
146 
151  QCheckBox *wfsPagingEnabledCheckBox() SIP_SKIP;
152 
157  QCheckBox *wfsUseGml2EncodingForTransactions() SIP_SKIP;
158 
163  QLineEdit *wfsPageSizeLineEdit() SIP_SKIP;
164 
169  QUrl urlTrimmed() const SIP_SKIP;
170 
176  virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
177 
183  virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
184 
190  void updateServiceSpecificSettings();
191 
192  private:
193 
194  ConnectionTypes mTypes = ConnectionWms;
195 
196  QString mServiceName;
197  QString mOriginalConnName; //store initial name to delete entry in case of rename
198  void showHelp();
199 
200 };
201 
204 
205 // clazy:excludeall=qstring-allocations
206 
207 #endif // QGSNEWHTTPCONNECTION_H
QgsNewHttpConnection
Dialog to allow the user to configure and save connection information for an HTTP Server for WMS,...
Definition: qgsnewhttpconnection.h:33
QgsAuthSettingsWidget
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
Definition: qgsauthsettingswidget.h:36
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgis_sip.h
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
SIP_PYARGRENAME
#define SIP_PYARGRENAME(pyname)
Definition: qgis_sip.h:156
QgsNewHttpConnection::WfsVersionIndex
WfsVersionIndex
Index of wfsVersionComboBox.
Definition: qgsnewhttpconnection.h:107
QgsNewHttpConnection::ConnectionType
ConnectionType
Available connection types for configuring in the dialog.
Definition: qgsnewhttpconnection.h:43
qgsguiutils.h
QgsNewHttpConnection::Flag
Flag
Flags controlling dialog behavior.
Definition: qgsnewhttpconnection.h:56
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53