QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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 QWidget *parent SIP_TRANSFERTHIS = nullptr,
87 const QString &serviceName SIP_PYARGRENAME( settingsKey ) = "WMS", // TODO QGIS 5 remove arg rename
88 const QString &connectionName = QString(),
90 Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags
91 );
92
96 QString name() const;
97
101 QString url() const;
102
107 QString originalConnectionName() const;
108
109 public slots:
110
111 void accept() override;
112
113 private slots:
114
115 void nameChanged( const QString & );
116 void urlChanged( const QString & );
117 void updateOkButtonState();
118 void wfsVersionCurrentIndexChanged( int index );
119 void wfsFeaturePagingCurrentIndexChanged( int index );
120 void featureFormatCurrentIndexChanged( int index );
121
122 protected:
132
133#ifndef SIP_RUN
136 {
137 DEFAULT = 0,
138 ENABLED = 1,
139 DISABLED = 2,
140 };
141#endif
142
147 virtual bool validate();
148
152 QPushButton *testConnectButton();
153
158 QPushButton *wmsFormatDetectButton() SIP_SKIP;
159
165 QgsAuthSettingsWidget *authSettingsWidget() SIP_SKIP;
166
172 QgsAuthorizationSettings authorizationSettings() const SIP_SKIP;
173
178 bool ignoreAxisOrientation() const;
179
185 QComboBox *wmsPreferredFormatCombo() const SIP_SKIP;
186
191 bool invertAxisOrientation() const;
192
197 QPushButton *wfsVersionDetectButton() SIP_SKIP;
198
203 QComboBox *wfsVersionComboBox() SIP_SKIP;
204
209 QPushButton *featureFormatDetectButton() SIP_SKIP;
210
215 QComboBox *featureFormatComboBox() SIP_SKIP;
216
221 QComboBox *wfsPagingComboBox() SIP_SKIP;
222
227 QCheckBox *wfsUseGml2EncodingForTransactions() SIP_SKIP;
228
233 QLineEdit *wfsPageSizeLineEdit() SIP_SKIP;
234
240 Qgis::HttpMethod preferredHttpMethod() const;
241
246 QUrl urlTrimmed() const SIP_SKIP;
247
252 virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
253
258 virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
259
264 void updateServiceSpecificSettings();
265
269 void showEvent( QShowEvent *event ) override;
270
271 private:
272 ConnectionTypes mTypes = ConnectionWms;
273 QString mServiceName;
274 QString mOriginalConnName; //store initial name to delete entry in case of rename
275 void showHelp();
276};
277
280
281// clazy:excludeall=qstring-allocations
282
283#endif // QGSNEWHTTPCONNECTION_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:62
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:52
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:274
#define SIP_SKIP
Definition qgis_sip.h:133
#define SIP_PYARGRENAME(pyname)
Definition qgis_sip.h:168
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsProjectionSelectionWidget::CrsOptions)