File indexing completed on 2024-06-23 05:13:53

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     crypto/gui/signingcertificateselectiondialog.h
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include <QDialog>
0012 
0013 #include <gpgme++/key.h>
0014 
0015 #include <utils/pimpl_ptr.h>
0016 
0017 #include <set>
0018 
0019 template<typename K, typename U>
0020 class QMap;
0021 
0022 namespace Kleo
0023 {
0024 struct CertificatePair;
0025 
0026 namespace Crypto
0027 {
0028 namespace Gui
0029 {
0030 
0031 class SigningCertificateSelectionWidget;
0032 
0033 class SigningCertificateSelectionDialog : public QDialog
0034 {
0035     Q_OBJECT
0036 public:
0037     explicit SigningCertificateSelectionDialog(QWidget *parent = nullptr);
0038     ~SigningCertificateSelectionDialog() override;
0039 
0040     void setAllowedProtocols(const std::set<GpgME::Protocol> &allowedProtocols);
0041     void setSelectedCertificates(const CertificatePair &certificates);
0042     [[nodiscard]] CertificatePair selectedCertificates() const;
0043 
0044     [[nodiscard]] bool rememberAsDefault() const;
0045 
0046 private:
0047     SigningCertificateSelectionWidget *const widget;
0048 };
0049 
0050 }
0051 }
0052 }