File indexing completed on 2024-06-23 05:14:04

0001 /*  SPDX-FileCopyrightText: 2017 Intevation GmbH
0002 
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #pragma once
0007 
0008 #include <QDialog>
0009 #include <QWidget>
0010 
0011 namespace GpgME
0012 {
0013 class Key;
0014 class Subkey;
0015 class Error;
0016 }
0017 
0018 namespace Kleo
0019 {
0020 
0021 class ExportWidget : public QWidget
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit ExportWidget(QWidget *parent = nullptr);
0027     ~ExportWidget() override;
0028 
0029     void setKey(const GpgME::Key &key, unsigned int flags = 0);
0030     void setKey(const GpgME::Subkey &key, unsigned int flags = 0);
0031     GpgME::Key key() const;
0032 
0033 private Q_SLOTS:
0034     void exportResult(const GpgME::Error &err, const QByteArray &data);
0035 
0036 private:
0037     class Private;
0038     const QScopedPointer<Private> d;
0039 };
0040 
0041 class ExportDialog : public QDialog
0042 {
0043     Q_OBJECT
0044 
0045 public:
0046     explicit ExportDialog(QWidget *parent = nullptr);
0047     ~ExportDialog() override;
0048 
0049     void setKey(const GpgME::Key &key, unsigned int flags = 0);
0050     void setKey(const GpgME::Subkey &key, unsigned int flags = 0);
0051     GpgME::Key key() const;
0052 
0053 private:
0054     ExportWidget *mWidget;
0055 };
0056 
0057 } // namespace Kleo