File indexing completed on 2025-02-02 05:08:36

0001 /*
0002     SPDX-FileCopyrightText: 2016 Klarälvdalens Datakonsult AB
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "key.h"
0010 #include "page.h"
0011 #include "ui_cryptopage.h"
0012 
0013 #include <QPointer>
0014 
0015 class Dialog;
0016 class SetupManager;
0017 class KeyGenerationJob;
0018 
0019 namespace QGpgME
0020 {
0021 class Job;
0022 }
0023 
0024 class CryptoPage : public Page
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit CryptoPage(Dialog *parent);
0030 
0031     void enterPageNext() override;
0032     void leavePageNext() override;
0033 
0034 private Q_SLOTS:
0035     void customItemSelected(const QVariant &data);
0036     void keySelected(const GpgME::Key &key);
0037 
0038 private:
0039     enum PublishingOptionPage { CheckingkWKSPage, WKSPage, PKSPage };
0040 
0041     enum Action { NoKey = 1, GenerateKey, ImportKey };
0042 
0043     void setPublishingEnabled(bool enabled);
0044     void importKey();
0045     Key::PublishingMethod currentPublishingMethod() const;
0046 
0047     Ui::CryptoPage ui;
0048     SetupManager *mSetupManager = nullptr;
0049     QPointer<KeyGenerationJob> mKeyGenerationJob;
0050 };