File indexing completed on 2024-04-14 05:43:28

0001 /*
0002     SPDX-FileCopyrightText: 2008-2022 Rolf Eike Beer <kde@opensource.sf-tec.de>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef KGPGCHANGETRUST_H
0007 #define KGPGCHANGETRUST_H
0008 
0009 #include "kgpgeditkeytransaction.h"
0010 
0011 #include "core/kgpgkey.h"
0012 
0013 #include <gpgme.h>
0014 #include <QObject>
0015 
0016 /**
0017  * @brief change the owner trust level of a public key
0018  */
0019 class KGpgChangeTrust: public KGpgEditKeyTransaction {
0020     Q_OBJECT
0021 
0022     Q_DISABLE_COPY(KGpgChangeTrust)
0023 public:
0024     explicit KGpgChangeTrust(QObject *parent, const QString &keyid, const gpgme_validity_t trust);
0025     ~KGpgChangeTrust() override = default;
0026 
0027     void setTrust(const gpgme_validity_t trust);
0028 
0029 protected:
0030     bool nextLine(const QString &line) override;
0031     ts_boolanswer boolQuestion(const QString &line) override;
0032     bool preStart() override;
0033 
0034 private:
0035     gpgme_validity_t m_trust;
0036 };
0037 
0038 #endif // KGPGCHANGETRUST_H