QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
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 "ui_qgsnewhttpconnectionbase.h"
22
23#include "qgis_gui.h"
24#include "qgis_sip.h"
26#include "qgsguiutils.h"
27#include "qgssettingstree.h"
28
29#include <QString>
30
31using namespace Qt::StringLiterals;
32
35
41class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBase
42{
43 Q_OBJECT
44
45 public:
46#ifndef SIP_RUN
47 static inline QgsSettingsTreeNode *sTreeHttpConnectionDialog = QgsSettingsTree::sTreeConnections->createChildNode( u"http-connection-dialog"_s );
48
50#endif
51
56 {
57 ConnectionWfs = 1 << 1,
58 ConnectionWms = 1 << 2,
59 ConnectionWcs = 1 << 3,
60 ConnectionOther = 1 << 4,
61 };
62 Q_DECLARE_FLAGS( ConnectionTypes, ConnectionType )
63
64
73 Q_DECLARE_FLAGS( Flags, Flag )
74
75
85 const QString &serviceName SIP_PYARGRENAME( settingsKey ) = "WMS", // TODO QGIS 5 remove arg rename
86 const QString &connectionName = QString(), QgsNewHttpConnection::Flags flags = QgsNewHttpConnection::Flags(), Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
87
91 QString name() const;
92
96 QString url() const;
97
102 QString originalConnectionName() const;
103
104 public slots:
105
106 void accept() override;
107
108 private slots:
109
110 void nameChanged( const QString & );
111 void urlChanged( const QString & );
112 void updateOkButtonState();
113 void wfsVersionCurrentIndexChanged( int index );
114 void wfsFeaturePagingCurrentIndexChanged( int index );
115 void featureFormatCurrentIndexChanged( int index );
116
117 protected:
127
128#ifndef SIP_RUN
131 {
132 DEFAULT = 0,
133 ENABLED = 1,
134 DISABLED = 2,
135 };
136#endif
137
142 virtual bool validate();
143
147 QPushButton *testConnectButton();
148
153 QPushButton *wmsFormatDetectButton() SIP_SKIP;
154
160 QgsAuthSettingsWidget *authSettingsWidget() SIP_SKIP;
161
167 QgsAuthorizationSettings authorizationSettings() const SIP_SKIP;
168
173 bool ignoreAxisOrientation() const;
174
180 QComboBox *wmsPreferredFormatCombo() const SIP_SKIP;
181
186 bool invertAxisOrientation() const;
187
192 QPushButton *wfsVersionDetectButton() SIP_SKIP;
193
198 QComboBox *wfsVersionComboBox() SIP_SKIP;
199
204 QPushButton *featureFormatDetectButton() SIP_SKIP;
205
210 QComboBox *featureFormatComboBox() SIP_SKIP;
211
216 QComboBox *wfsPagingComboBox() SIP_SKIP;
217
222 QCheckBox *wfsUseGml2EncodingForTransactions() SIP_SKIP;
223
228 QLineEdit *wfsPageSizeLineEdit() SIP_SKIP;
229
235 Qgis::HttpMethod preferredHttpMethod() const;
236
241 QUrl urlTrimmed() const SIP_SKIP;
242
247 virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
248
253 virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
254
259 void updateServiceSpecificSettings();
260
264 void showEvent( QShowEvent *event ) override;
265
266 private:
267 ConnectionTypes mTypes = ConnectionWms;
268 QString mServiceName;
269 QString mOriginalConnName; //store initial name to delete entry in case of rename
270 void showHelp();
271};
272
275
276// clazy:excludeall=qstring-allocations
277
278#endif // QGSNEWHTTPCONNECTION_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:59
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
Utility class that contains authorization information.
Dialog to allow the user to configure and save connection information for an HTTP Server for WMS,...
static QgsSettingsTreeNode * sTreeHttpConnectionDialog
QgsNewHttpConnection(QWidget *parent=nullptr, QgsNewHttpConnection::ConnectionTypes types=ConnectionWms, const QString &serviceName="WMS", const QString &connectionName=QString(), QgsNewHttpConnection::Flags flags=QgsNewHttpConnection::Flags(), Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsNewHttpConnection.
QString name() const
Returns the current connection name.
Flag
Flags controlling dialog behavior.
@ FlagShowHttpSettings
Display the 'http' group.
@ FlagHideAuthenticationGroup
Hide the Authentication group.
@ FlagShowTestConnection
Display the 'test connection' button.
QString url() const
Returns the current connection url.
QString originalConnectionName() const
Returns the original connection name (might be empty).
WfsVersionIndex
Index of wfsVersionComboBox.
static const QgsSettingsEntryBool * settingsIgnoreReportedLayerExtentsDefault
WfsFeaturePagingIndex
Index of wfsFeaturePaging.
ConnectionType
Available connection types for configuring in the dialog.
@ ConnectionWms
WMS connection.
@ ConnectionWfs
WFS connection.
@ ConnectionWcs
WCS connection.
@ ConnectionOther
Other connection type.
QFlags< ConnectionType > ConnectionTypes
A boolean settings entry.
A tree node for the settings tree to help organizing and introspecting the tree.
static QgsSettingsTreeNode * sTreeConnections
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:275
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_PYARGRENAME(pyname)
Definition qgis_sip.h:169
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsProjectionSelectionWidget::CrsOptions)