QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 "qgis_sip.h"
22#include "ui_qgsnewhttpconnectionbase.h"
23#include "qgsguiutils.h"
24#include "qgis_gui.h"
25#include "qgssettingstree.h"
26
29
35class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBase
36{
37 Q_OBJECT
38
39 public:
40#ifndef SIP_RUN
41 static inline QgsSettingsTreeNode *sTreeHttpConnectionDialog = QgsSettingsTree::sTreeConnections->createChildNode( QStringLiteral( "http-connection-dialog" ) );
42
44#endif
45
50 {
51 ConnectionWfs = 1 << 1,
52 ConnectionWms = 1 << 2,
53 ConnectionWcs = 1 << 3,
54 ConnectionOther = 1 << 4,
55 };
56 Q_DECLARE_FLAGS( ConnectionTypes, ConnectionType )
57
58
61 enum Flag SIP_ENUM_BASETYPE( IntFlag )
62 {
63 FlagShowTestConnection = 1 << 1,
64 FlagHideAuthenticationGroup = 1 << 2,
65 FlagShowHttpSettings = 1 << 3,
66 };
67 Q_DECLARE_FLAGS( Flags, Flag )
68
69
78 QgsNewHttpConnection( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsNewHttpConnection::ConnectionTypes types = ConnectionWms,
79 const QString &serviceName SIP_PYARGRENAME( settingsKey ) = "WMS", // TODO QGIS 4 remove arg rename
80 const QString &connectionName = QString(), QgsNewHttpConnection::Flags flags = QgsNewHttpConnection::Flags(), Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
81
85 QString name() const;
86
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 wfsFeaturePagingCurrentIndexChanged( int index );
103
104 protected:
107 {
108 WFS_VERSION_MAX = 0,
109 WFS_VERSION_1_0 = 1,
110 WFS_VERSION_1_1 = 2,
111 WFS_VERSION_2_0 = 3,
112 WFS_VERSION_API_FEATURES_1_0 = 4,
113 };
114
115#ifndef SIP_RUN
118 {
119 DEFAULT = 0,
120 ENABLED = 1,
121 DISABLED = 2,
122 };
123#endif
124
129 virtual bool validate();
130
134 QPushButton *testConnectButton();
135
140 QgsAuthSettingsWidget *authSettingsWidget() SIP_SKIP;
141
146 QPushButton *wfsVersionDetectButton() SIP_SKIP;
147
152 QComboBox *wfsVersionComboBox() SIP_SKIP;
153
158 QComboBox *wfsPagingComboBox() SIP_SKIP;
159
164 QCheckBox *wfsUseGml2EncodingForTransactions() SIP_SKIP;
165
170 QLineEdit *wfsPageSizeLineEdit() SIP_SKIP;
171
176 QUrl urlTrimmed() const SIP_SKIP;
177
182 virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
183
188 virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
189
194 void updateServiceSpecificSettings();
195
196 private:
197 ConnectionTypes mTypes = ConnectionWms;
198
199 QString mServiceName;
200 QString mOriginalConnName; //store initial name to delete entry in case of rename
201 void showHelp();
202};
203
206
207// clazy:excludeall=qstring-allocations
208
209#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.
static const QgsSettingsEntryBool * settingsIgnoreReportedLayerExtentsDefault
WfsFeaturePagingIndex
Index of wfsFeaturePaging.
ConnectionType
Available connection types for configuring in the dialog.
QFlags< ConnectionType > ConnectionTypes
A boolean settings entry.
QgsSettingsTreeNode is a tree node for the settings tree to help organizing and introspecting the tre...
QgsSettingsTreeNode * createChildNode(const QString &key)
Creates a normal tree node It will return the existing child node if it exists at the given key.
static QgsSettingsTreeNode * sTreeConnections
#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)