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

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     crypto/gui/signingcertificateselectionwidget.h
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2007, 2009 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include <QWidget>
0012 
0013 #include <gpgme++/global.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 GpgME
0023 {
0024 class Key;
0025 }
0026 
0027 namespace Kleo
0028 {
0029 struct CertificatePair;
0030 
0031 namespace Crypto
0032 {
0033 namespace Gui
0034 {
0035 
0036 class SigningCertificateSelectionWidget : public QWidget
0037 {
0038     Q_OBJECT
0039 public:
0040     explicit SigningCertificateSelectionWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
0041     ~SigningCertificateSelectionWidget() override;
0042 
0043     void setAllowedProtocols(const std::set<GpgME::Protocol> &allowedProtocols);
0044     void setAllowedProtocols(bool pgp, bool cms);
0045     void setSelectedCertificates(const CertificatePair &certificates);
0046     void setSelectedCertificates(const GpgME::Key &pgp, const GpgME::Key &cms);
0047     CertificatePair selectedCertificates() const;
0048 
0049     bool rememberAsDefault() const;
0050 
0051 private:
0052     class Private;
0053     kdtools::pimpl_ptr<Private> d;
0054 };
0055 
0056 }
0057 }
0058 }