QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
qgsauthsettingswidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthsettingswidget.h - QgsAuthSettingsWidget
3 
4  ---------------------
5  begin : 28.9.2017
6  copyright : (C) 2017 by Alessandro Pasotti
7  email : apasotti at boundlessgeo dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 #ifndef QGSAUTHSETTINGSWIDGET_H
17 #define QGSAUTHSETTINGSWIDGET_H
18 
19 #include "qgis_gui.h"
20 #include "qgis_sip.h"
21 
22 #include "ui_qgsauthsettingswidget.h"
23 
24 #include <QWidget>
25 
36 class GUI_EXPORT QgsAuthSettingsWidget : public QWidget, private Ui::QgsAuthSettingsWidget
37 {
38 
39  Q_OBJECT
40 
41  public:
42 
51  {
53  UserSettings
54  };
55  Q_ENUM( WarningType )
56 
57 
66  explicit QgsAuthSettingsWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr,
67  const QString &configId = QString(),
68  const QString &username = QString(),
69  const QString &password = QString(),
70  const QString &dataprovider = QString() );
71 
77  void setWarningText( const QString &warningText );
78 
83  void setBasicText( const QString &basicText );
84 
89  const QString username( ) const;
90 
95  void setUsername( const QString &username );
96 
101  const QString password( ) const;
102 
107  void setPassword( const QString &password );
108 
113  const QString configId( ) const;
114 
119  void setConfigId( const QString &configId );
120 
125  void setDataprovider( const QString &dataprovider );
126 
131  const QString dataprovider( ) const;
132 
138  static const QString formattedWarning( WarningType warning );
139 
144  bool btnConvertToEncryptedIsEnabled( ) const;
145 
153  void showStoreCheckboxes( bool enabled );
154 
160  void setStoreUsernameChecked( bool checked );
161 
167  void setStorePasswordChecked( bool checked );
168 
173  bool storePasswordIsChecked( ) const;
174 
179  bool storeUsernameIsChecked( ) const;
180 
185  bool configurationTabIsSelected( );
186 
187  public slots:
188 
195  bool convertToEncrypted( );
196 
201  void userNameTextChanged( const QString &text ) SIP_SKIP;
202 
207  void passwordTextChanged( const QString &text ) SIP_SKIP;
208 
209 
210  private:
211 
212  // Mainly for tests
213  QString mDataprovider;
214 
215  void updateConvertBtnState( );
216 
217  void updateSelectedTab( );
218 
219 };
220 
221 #endif // QGSAUTHSETTINGSWIDGET_H
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
WarningType
The WarningType enum is used to determine the text of the message shown to the user about the destina...
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_SKIP
Definition: qgis_sip.h:126