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

0001 /*  commands/changepincommand.h
0002 
0003     This file is part of Kleopatra, the KDE keymanager
0004     SPDX-FileCopyrightText: 2020 g10 Code GmbH
0005     SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include "cardcommand.h"
0012 
0013 namespace Kleo
0014 {
0015 namespace Commands
0016 {
0017 
0018 class ChangePinCommand : public CardCommand
0019 {
0020     Q_OBJECT
0021 public:
0022     enum ChangePinMode {
0023         NormalMode = 0,
0024         ResetMode = 1,
0025         NullPinMode = 2,
0026     };
0027 
0028     explicit ChangePinCommand(const std::string &serialNumber, const std::string &appName, QWidget *parent);
0029     ~ChangePinCommand() override;
0030 
0031     void setKeyRef(const std::string &keyRef);
0032     void setMode(ChangePinMode mode = NormalMode);
0033 
0034 private:
0035     void doStart() override;
0036     void doCancel() override;
0037 
0038 private:
0039     class Private;
0040     inline Private *d_func();
0041     inline const Private *d_func() const;
0042 };
0043 
0044 } // namespace Commands
0045 } // namespace Kleo