QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgsauthimportcertdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthimportcertdialog.h
3  ---------------------
4  begin : April 30, 2015
5  copyright : (C) 2015 by Boundless Spatial, Inc. USA
6  author : Larry Shaffer
7  email : lshaffer 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 
17 #ifndef QGSAUTHIMPORTCERTDIALOG_H
18 #define QGSAUTHIMPORTCERTDIALOG_H
19 
20 #include <QDialog>
21 #include "qgis_sip.h"
22 #include "ui_qgsauthimportcertdialog.h"
23 
24 #include <QSslCertificate>
25 #include "qgis_gui.h"
26 
27 class QPushButton;
28 
33 class GUI_EXPORT QgsAuthImportCertDialog : public QDialog, private Ui::QgsAuthImportCertDialog
34 {
35  Q_OBJECT
36 
37  public:
40  {
41  NoFilter = 1,
42  CaFilter = 2,
43  };
44 
46  enum CertInput
47  {
48  AllInputs = 1,
49  FileInput = 2,
50  TextInput = 3,
51  };
52 
59  explicit QgsAuthImportCertDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr,
60  QgsAuthImportCertDialog::CertFilter filter = NoFilter,
61  QgsAuthImportCertDialog::CertInput input = AllInputs );
62 
64  const QList<QSslCertificate> certificatesToImport();
65 
67  const QString certFileToImport();
68 
70  const QString certTextToImport();
71 
73  bool allowInvalidCerts();
74 
76  QgsAuthCertUtils::CertTrustPolicy certTrustPolicy();
77 
78  private slots:
79  void updateGui();
80 
81  void validateCertificates();
82 
83  void btnImportFile_clicked();
84 
85  void chkAllowInvalid_toggled( bool checked );
86 
87  private:
88  QString getOpenFileName( const QString &title, const QString &extfilter );
89 
90  QPushButton *okButton();
91 
92  QList<QSslCertificate> mCerts;
95 
96  bool mDisabled = false;
97  QVBoxLayout *mAuthNotifyLayout = nullptr;
98  QLabel *mAuthNotify = nullptr;
99 };
100 
101 #endif // QGSAUTHIMPORTCERTDIALOG_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
CertInput
Type of inputs for certificates.
Widget for importing a certificate into the authentication database.
CertTrustPolicy
Type of certificate trust policy.
CertFilter
Type of filter to apply to dialog.