File indexing completed on 2024-10-27 04:58:02

0001 /*
0002     SPDX-FileCopyrightText: 2010-2023 Laurent Montel <montel@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 // This code was taken from kmail-account-wizard
0008 
0009 #pragma once
0010 
0011 #include "setupobject.h"
0012 
0013 #include <gpgme++/global.h>
0014 
0015 class Transport;
0016 
0017 namespace KIdentityManagement
0018 {
0019 class Identity;
0020 }
0021 
0022 class Identity : public SetupObject
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit Identity(QObject *parent = nullptr);
0027     ~Identity() override;
0028     void create() override;
0029     void destroy() override;
0030 
0031 public Q_SLOTS:
0032     Q_SCRIPTABLE void setIdentityName(const QString &name);
0033     Q_SCRIPTABLE void setRealName(const QString &name);
0034     Q_SCRIPTABLE void setEmail(const QString &email);
0035     Q_SCRIPTABLE void setOrganization(const QString &org);
0036     Q_SCRIPTABLE void setSignature(const QString &sig);
0037     Q_SCRIPTABLE uint uoid() const;
0038     Q_SCRIPTABLE void setTransport(QObject *transport);
0039     Q_SCRIPTABLE void setPreferredCryptoMessageFormat(const QString &format);
0040     Q_SCRIPTABLE void setXFace(const QString &xface);
0041     Q_SCRIPTABLE void setPgpAutoSign(bool autosign);
0042     Q_SCRIPTABLE void setPgpAutoEncrypt(bool autoencrypt);
0043     Q_SCRIPTABLE void setKey(GpgME::Protocol protocol, const QByteArray &fingerprint);
0044 
0045 private:
0046     Q_REQUIRED_RESULT QString identityName() const;
0047     QString m_identityName;
0048     KIdentityManagement::Identity *m_identity = nullptr;
0049 };
0050