QGIS API Documentation  2.99.0-Master (009e47e)
qgscredentialdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscredentialdialog.h - description
3  -------------------
4  begin : February 2010
5  copyright : (C) 2010 by Juergen E. Fischer
6  email : jef at norbit dot de
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 #ifndef QGSCREDENTIALDIALOG_H
18 #define QGSCREDENTIALDIALOG_H
19 
20 #include <ui_qgscredentialdialog.h>
21 #include "qgsguiutils.h"
22 #include "qgscredentials.h"
23 
24 #include <QString>
25 #include "qgis.h"
26 #include "qgis_gui.h"
27 
28 class QPushButton;
29 
33 class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, private Ui_QgsCredentialDialog
34 {
35  Q_OBJECT
36  public:
38  QgsCredentialDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
39 
40 #ifndef SIP_RUN
41  signals:
42 
44  void credentialsRequested( const QString &, QString *, QString *, const QString &, bool * );
45 
47  void credentialsRequestedMasterPassword( QString *, bool, bool * );
48 #endif
49 
50  private slots:
51  void requestCredentials( const QString &, QString *, QString *, const QString &, bool * );
52 
53  void requestCredentialsMasterPassword( QString *password, bool stored, bool *ok );
54 
55  void on_leMasterPass_textChanged( const QString &pass );
56  void on_leMasterPassVerify_textChanged( const QString &pass );
57  void on_chkbxEraseAuthDb_toggled( bool checked );
58 
59  protected:
60  virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) override;
61 
62  virtual bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;
63 
64  private:
65  QPushButton *mOkButton = nullptr;
66 };
67 
68 #endif
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:34
Interface for requesting credentials in QGIS in GUI independent way.
virtual bool requestMasterPassword(QString &password, bool stored=false)=0
request a master password
#define SIP_INOUT
Definition: qgis_sip.h:52
virtual bool request(const QString &realm, QString &username, QString &password, const QString &message=QString())=0
request a password
A generic dialog for requesting credentials.