File indexing completed on 2024-06-23 05:13:36

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     commands/adduseridcommand.h
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
0006     SPDX-FileCopyrightText: 2022 g10 Code GmbH
0007     SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
0008 
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #pragma once
0013 
0014 #include "command.h"
0015 
0016 namespace Kleo
0017 {
0018 namespace Commands
0019 {
0020 
0021 class AddUserIDCommand : public Command
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit AddUserIDCommand(QAbstractItemView *view, KeyListController *parent);
0026     explicit AddUserIDCommand(const GpgME::Key &key);
0027     ~AddUserIDCommand() override;
0028 
0029     /* reimp */ static Restrictions restrictions()
0030     {
0031         return OnlyOneKey | MustBeOpenPGP | NeedSecretKey;
0032     }
0033 
0034     void setName(const QString &name);
0035     const QString &name() const;
0036 
0037     void setEmail(const QString &email);
0038     const QString &email() const;
0039 
0040     void setComment(const QString &comment);
0041     const QString &comment() const;
0042 
0043 private:
0044     void doStart() override;
0045     void doCancel() override;
0046 
0047 private:
0048     class Private;
0049     inline Private *d_func();
0050     inline const Private *d_func() const;
0051 };
0052 
0053 }
0054 }