File indexing completed on 2024-06-02 05:24:12
0001 /* -*- mode: c++; c-basic-offset:4 -*- 0002 commands/exportopenpgpcerttoprovidercommand.h 0003 0004 This file is part of Kleopatra, the KDE keymanager 0005 SPDX-FileCopyrightText: 2022 Felix Tiede 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #pragma once 0011 0012 #include "command.h" 0013 0014 #include <QPointer> 0015 0016 #include <gpgme++/key.h> 0017 0018 namespace QGpgME 0019 { 0020 class WKSPublishJob; 0021 } 0022 0023 namespace Kleo 0024 { 0025 namespace Commands 0026 { 0027 0028 class ExportOpenPGPCertToProviderCommand : public Command 0029 { 0030 Q_OBJECT 0031 public: 0032 explicit ExportOpenPGPCertToProviderCommand(QAbstractItemView *view, KeyListController *parent); 0033 explicit ExportOpenPGPCertToProviderCommand(const GpgME::UserID &uid); 0034 0035 ~ExportOpenPGPCertToProviderCommand() override; 0036 0037 static Restrictions restrictions() 0038 { 0039 return OnlyOneKey | NeedSecretKey | MustBeOpenPGP; 0040 } 0041 0042 private Q_SLOTS: 0043 void wksJobResult(const GpgME::Error &, const QByteArray &, const QByteArray &); 0044 0045 private: 0046 void doStart() override; 0047 void doCancel() override; 0048 0049 QString senderAddress() const; 0050 0051 private: 0052 GpgME::UserID uid; 0053 QPointer<QGpgME::WKSPublishJob> wksJob; 0054 }; 0055 0056 } 0057 }