File indexing completed on 2022-10-04 17:28:18

0001 /*
0002     SPDX-FileCopyrightText: 2008, 2009, 2018 Rolf Eike Beer <kde@opensource.sf-tec.de>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef KGPGDELKEY_H
0007 #define KGPGDELKEY_H
0008 
0009 #include "kgpgtransaction.h"
0010 
0011 #include <core/KGpgKeyNode.h>
0012 
0013 #include <QObject>
0014 
0015 /**
0016  * @brief delete a public key
0017  */
0018 class KGpgDelKey: public KGpgTransaction {
0019     Q_OBJECT
0020 
0021     Q_DISABLE_COPY(KGpgDelKey)
0022     KGpgDelKey() = delete;
0023 public:
0024     inline KGpgDelKey(QObject *parent, KGpgKeyNode *key)
0025         : KGpgDelKey(parent, KGpgKeyNode::List({key})) {}
0026     KGpgDelKey(QObject *parent, const KGpgKeyNode::List &keys);
0027     ~KGpgDelKey() override;
0028 
0029     /**
0030      * @brief the keys that were requested to be removed
0031      */
0032     const KGpgKeyNode::List keys;
0033 
0034     /**
0035      * @brief the fingerprints of everything in keys
0036      */
0037     const QStringList fingerprints;
0038 
0039 protected:
0040     bool nextLine(const QString &line) override;
0041     ts_boolanswer boolQuestion(const QString &line) override;
0042     bool preStart() override;
0043     
0044 private:
0045     int m_argscount;
0046 
0047     void setCmdLine();
0048 };
0049 
0050 #endif // KGPGDELKEY_H