QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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
33class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBase
34{
35 Q_OBJECT
36
37 public:
38
43 {
44 ConnectionWfs = 1 << 1,
45 ConnectionWms = 1 << 2,
46 ConnectionWcs = 1 << 3,
47 ConnectionOther = 1 << 4,
48 };
49 Q_DECLARE_FLAGS( ConnectionTypes, ConnectionType )
50
51
54 enum Flag SIP_ENUM_BASETYPE( IntFlag )
55 {
56 FlagShowTestConnection = 1 << 1,
57 FlagHideAuthenticationGroup = 1 << 2,
58 FlagShowHttpSettings = 1 << 3,
59 };
60 Q_DECLARE_FLAGS( Flags, Flag )
61
62
71 QgsNewHttpConnection( QWidget *parent SIP_TRANSFERTHIS = nullptr,
72 QgsNewHttpConnection::ConnectionTypes types = ConnectionWms,
73 const QString &serviceName SIP_PYARGRENAME( settingsKey ) = "WMS", // TODO QGIS 4 remove arg rename
74 const QString &connectionName = QString(),
76 Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
77
81 QString name() const;
82
86 QString url() const;
87
88 public slots:
89
90 void accept() override;
91
92 private slots:
93
94 void nameChanged( const QString & );
95 void urlChanged( const QString & );
96 void updateOkButtonState();
97 void wfsVersionCurrentIndexChanged( int index );
98 void wfsFeaturePagingCurrentIndexChanged( int index );
99
100 protected:
101
104 {
105 WFS_VERSION_MAX = 0,
106 WFS_VERSION_1_0 = 1,
107 WFS_VERSION_1_1 = 2,
108 WFS_VERSION_2_0 = 3,
109 WFS_VERSION_API_FEATURES_1_0 = 4,
110 };
111
112#ifndef SIP_RUN
115 {
116 DEFAULT = 0,
117 ENABLED = 1,
118 DISABLED = 2,
119 };
120#endif
121
126 virtual bool validate();
127
131 QPushButton *testConnectButton();
132
137 QgsAuthSettingsWidget *authSettingsWidget() SIP_SKIP;
138
143 QPushButton *wfsVersionDetectButton() SIP_SKIP;
144
149 QComboBox *wfsVersionComboBox() SIP_SKIP;
150
155 QComboBox *wfsPagingComboBox() SIP_SKIP;
156
161 QCheckBox *wfsUseGml2EncodingForTransactions() SIP_SKIP;
162
167 QLineEdit *wfsPageSizeLineEdit() SIP_SKIP;
168
173 QUrl urlTrimmed() const SIP_SKIP;
174
179 virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
180
185 virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
186
191 void updateServiceSpecificSettings();
192
193 private:
194
195 ConnectionTypes mTypes = ConnectionWms;
196
197 QString mServiceName;
198 QString mOriginalConnName; //store initial name to delete entry in case of rename
199 void showHelp();
200
201};
202
205
206// clazy:excludeall=qstring-allocations
207
208#endif // QGSNEWHTTPCONNECTION_H
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
Dialog to allow the user to configure and save connection information for an HTTP Server for WMS,...
Flag
Flags controlling dialog behavior.
WfsVersionIndex
Index of wfsVersionComboBox.
WfsFeaturePagingIndex
Index of wfsFeaturePaging.
ConnectionType
Available connection types for configuring in the dialog.
QFlags< ConnectionType > ConnectionTypes
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_ENUM_BASETYPE(type)
Definition: qgis_sip.h:278
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_PYARGRENAME(pyname)
Definition: qgis_sip.h:161
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)