QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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
31
37class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBase
38{
39 Q_OBJECT
40
41 public:
42#ifndef SIP_RUN
43 static inline QgsSettingsTreeNode *sTreeHttpConnectionDialog = QgsSettingsTree::sTreeConnections->createChildNode( QStringLiteral( "http-connection-dialog" ) );
44
46#endif
47
52 {
53 ConnectionWfs = 1 << 1,
54 ConnectionWms = 1 << 2,
55 ConnectionWcs = 1 << 3,
56 ConnectionOther = 1 << 4,
57 };
58 Q_DECLARE_FLAGS( ConnectionTypes, ConnectionType )
59
60
69 Q_DECLARE_FLAGS( Flags, Flag )
70
71
81 const QString &serviceName SIP_PYARGRENAME( settingsKey ) = "WMS", // TODO QGIS 4 remove arg rename
82 const QString &connectionName = QString(), QgsNewHttpConnection::Flags flags = QgsNewHttpConnection::Flags(), Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
83
87 QString name() const;
88
92 QString url() const;
93
98 QString originalConnectionName() const;
99
100 public slots:
101
102 void accept() override;
103
104 private slots:
105
106 void nameChanged( const QString & );
107 void urlChanged( const QString & );
108 void updateOkButtonState();
109 void wfsVersionCurrentIndexChanged( int index );
110 void wfsFeaturePagingCurrentIndexChanged( int index );
111
112 protected:
122
123#ifndef SIP_RUN
126 {
127 DEFAULT = 0,
128 ENABLED = 1,
129 DISABLED = 2,
130 };
131#endif
132
137 virtual bool validate();
138
142 QPushButton *testConnectButton();
143
148 QPushButton *wmsFormatDetectButton() SIP_SKIP;
149
155 QgsAuthSettingsWidget *authSettingsWidget() SIP_SKIP;
156
162 QgsAuthorizationSettings authorizationSettings() const SIP_SKIP;
163
168 bool ignoreAxisOrientation() const;
169
175 QComboBox *wmsPreferredFormatCombo() const SIP_SKIP;
176
181 bool invertAxisOrientation() const;
182
187 QPushButton *wfsVersionDetectButton() SIP_SKIP;
188
193 QComboBox *wfsVersionComboBox() SIP_SKIP;
194
199 QPushButton *featureFormatDetectButton() SIP_SKIP;
200
205 QComboBox *featureFormatComboBox() SIP_SKIP;
206
211 QComboBox *wfsPagingComboBox() SIP_SKIP;
212
217 QCheckBox *wfsUseGml2EncodingForTransactions() SIP_SKIP;
218
223 QLineEdit *wfsPageSizeLineEdit() SIP_SKIP;
224
230 Qgis::HttpMethod preferredHttpMethod() const;
231
236 QUrl urlTrimmed() const SIP_SKIP;
237
242 virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
243
248 virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
249
254 void updateServiceSpecificSettings();
255
259 void showEvent( QShowEvent *event ) override;
260
261 private:
262 ConnectionTypes mTypes = ConnectionWms;
263 QString mServiceName;
264 QString mOriginalConnName; //store initial name to delete entry in case of rename
265 void showHelp();
266};
267
270
271// clazy:excludeall=qstring-allocations
272
273#endif // QGSNEWHTTPCONNECTION_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
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)