QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 "ui_qgsauthimportcertdialog.h"
22 #include "qgsauthcertutils.h"
23 
24 #include <QSslCertificate>
25 
26 class QPushButton;
27 
31 class GUI_EXPORT QgsAuthImportCertDialog : public QDialog, private Ui::QgsAuthImportCertDialog
32 {
33  Q_OBJECT
34 
35  public:
38  {
39  NoFilter = 1,
40  CaFilter = 2,
41  };
42 
44  enum CertInput
45  {
46  AllInputs = 1,
47  FileInput = 2,
48  TextInput = 3,
49  };
50 
57  explicit QgsAuthImportCertDialog( QWidget *parent = nullptr,
58  QgsAuthImportCertDialog::CertFilter filter = NoFilter,
59  QgsAuthImportCertDialog::CertInput input = AllInputs );
61 
63  const QList<QSslCertificate> certificatesToImport();
64 
66  const QString certFileToImport();
67 
69  const QString certTextToImport();
70 
72  bool allowInvalidCerts();
73 
75  QgsAuthCertUtils::CertTrustPolicy certTrustPolicy();
76 
77  private slots:
78  void updateGui();
79 
80  void validateCertificates();
81 
82  void on_btnImportFile_clicked();
83 
84  void on_chkAllowInvalid_toggled( bool checked );
85 
86  private:
87  QString getOpenFileName( const QString& title, const QString& extfilter );
88 
89  QPushButton* okButton();
90 
94 
95  bool mDisabled;
96  QVBoxLayout *mAuthNotifyLayout;
97  QLabel *mAuthNotify;
98 };
99 
100 #endif // QGSAUTHIMPORTCERTDIALOG_H
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.