diff --git a/src/commands/authenticatepivcardapplicationcommand.h b/src/commands/authenticatepivcardapplicationcommand.h index 8ef93f16e..4de7debda 100644 --- a/src/commands/authenticatepivcardapplicationcommand.h +++ b/src/commands/authenticatepivcardapplicationcommand.h @@ -1,44 +1,39 @@ /* commands/authenticatepivcardapplicationcommand.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2020 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "cardcommand.h" -namespace GpgME -{ -class Error; -} - namespace Kleo { namespace Commands { class AuthenticatePIVCardApplicationCommand : public CardCommand { Q_OBJECT public: explicit AuthenticatePIVCardApplicationCommand(const std::string &serialNumber, QWidget *parent); ~AuthenticatePIVCardApplicationCommand() override; void setPrompt(const QString& prompt); private: void doStart() override; void doCancel() override; private: class Private; inline Private *d_func(); inline const Private *d_func() const; }; } // namespace Commands } // namespace Kleo diff --git a/src/commands/changepincommand.h b/src/commands/changepincommand.h index 935b9efe4..928642485 100644 --- a/src/commands/changepincommand.h +++ b/src/commands/changepincommand.h @@ -1,52 +1,47 @@ /* commands/changepincommand.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2020 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "cardcommand.h" -namespace GpgME -{ -class Error; -} - namespace Kleo { namespace Commands { class ChangePinCommand : public CardCommand { Q_OBJECT public: enum ChangePinMode { NormalMode = 0, ResetMode = 1, NullPinMode = 2 }; explicit ChangePinCommand(const std::string &serialNumber, const std::string &appName, QWidget *parent); ~ChangePinCommand() override; void setKeyRef(const std::string &keyRef); void setMode(ChangePinMode mode = NormalMode); private: void doStart() override; void doCancel() override; private: class Private; inline Private *d_func(); inline const Private *d_func() const; }; } // namespace Commands } // namespace Kleo diff --git a/src/commands/pivgeneratecardkeycommand.h b/src/commands/pivgeneratecardkeycommand.h index b2c8d624d..b06c8df14 100644 --- a/src/commands/pivgeneratecardkeycommand.h +++ b/src/commands/pivgeneratecardkeycommand.h @@ -1,44 +1,39 @@ /* commands/pivgeneratecardkeycommand.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2020 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "cardcommand.h" -namespace GpgME -{ -class Error; -} - namespace Kleo { namespace Commands { class PIVGenerateCardKeyCommand : public CardCommand { Q_OBJECT public: explicit PIVGenerateCardKeyCommand(const std::string &serialNumber, QWidget *parent); ~PIVGenerateCardKeyCommand() override; void setKeyRef(const std::string &keyref); private: void doStart() override; void doCancel() override; private: class Private; inline Private *d_func(); inline const Private *d_func() const; }; } // namespace Commands } // namespace Kleo diff --git a/src/commands/setpivcardapplicationadministrationkeycommand.h b/src/commands/setpivcardapplicationadministrationkeycommand.h index d0a3b0568..5c9877193 100644 --- a/src/commands/setpivcardapplicationadministrationkeycommand.h +++ b/src/commands/setpivcardapplicationadministrationkeycommand.h @@ -1,42 +1,37 @@ /* commands/setpivcardapplicationadministrationkeycommand.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2020 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "cardcommand.h" -namespace GpgME -{ -class Error; -} - namespace Kleo { namespace Commands { class SetPIVCardApplicationAdministrationKeyCommand : public CardCommand { Q_OBJECT public: explicit SetPIVCardApplicationAdministrationKeyCommand(const std::string &serialNumber, QWidget *parent); ~SetPIVCardApplicationAdministrationKeyCommand() override; private: void doStart() override; void doCancel() override; private: class Private; inline Private *d_func(); inline const Private *d_func() const; }; } // namespace Commands } // namespace Kleo diff --git a/src/view/anchorcache_p.h b/src/view/anchorcache_p.h index 773c906bd..d25d1aa78 100644 --- a/src/view/anchorcache_p.h +++ b/src/view/anchorcache_p.h @@ -1,44 +1,43 @@ /* view/anchorcache_p.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2022 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include #include -class QLabel; class QString; struct AnchorData { int start; int end; QString text; QString href; }; class AnchorCache { public: void setText(const QString &text); void clear(); int size() const; const AnchorData &operator[](int index) const; int findAnchor(int start) const; private: const std::vector &anchors() const; private: QString mText; mutable bool mAnchorsValid = false; mutable std::vector mAnchors; }; diff --git a/src/view/nullpinwidget.h b/src/view/nullpinwidget.h index 303c95cc5..90701e9a6 100644 --- a/src/view/nullpinwidget.h +++ b/src/view/nullpinwidget.h @@ -1,42 +1,37 @@ #pragma once /* view/nullpinwidget.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2017 Intevation GmbH SPDX-License-Identifier: GPL-2.0-or-later */ #include class QPushButton; -namespace GpgME -{ - class Error; -} // namespace GpgME - namespace Kleo { class NullPinWidget: public QWidget { Q_OBJECT public: explicit NullPinWidget(QWidget *parent = nullptr); void setSerialNumber(const std::string &serialNumber); void setSigGVisible(bool val); void setNKSVisible(bool val); private: void doChangePin(const std::string &keyRef); private: std::string mSerialNumber; QPushButton *mNKSBtn, *mSigGBtn; }; } // namespace Kleo diff --git a/src/view/pivcardwidget.h b/src/view/pivcardwidget.h index 736f35883..e76d75b1d 100644 --- a/src/view/pivcardwidget.h +++ b/src/view/pivcardwidget.h @@ -1,69 +1,68 @@ /* view/pivcardwiget.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2020 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include #include #include -class QGridLayout; class QLabel; class QPushButton; namespace Kleo { namespace SmartCard { struct KeyPairInfo; class PIVCard; } // namespace SmartCard class PIVCardWidget: public QWidget { Q_OBJECT public: explicit PIVCardWidget(QWidget *parent = nullptr); ~PIVCardWidget() override; void setCard(const SmartCard::PIVCard* card); struct KeyWidgets { QLabel *keyGrip = nullptr; QLabel *keyAlgorithm = nullptr; QLabel *certificateInfo = nullptr; QPushButton *generateButton = nullptr; QPushButton *createCSRButton = nullptr; QPushButton *writeCertificateButton = nullptr; QPushButton *importCertificateButton = nullptr; QPushButton *writeKeyButton = nullptr; }; private: KeyWidgets createKeyWidgets(const SmartCard::KeyPairInfo &keyInfo); void updateKeyWidgets(const std::string &keyRef, const SmartCard::PIVCard *card); void generateKey(const std::string &keyref); void createCSR(const std::string &keyref); void writeCertificateToCard(const std::string &keyref); void importCertificateFromCard(const std::string &keyref); void writeKeyToCard(const std::string &keyref); void createKeyFromCardKeys(); void changePin(const std::string &keyRef); void setAdminKey(); private: std::string mCardSerialNumber; QLabel *mSerialNumber = nullptr; QLabel *mVersionLabel = nullptr; QPushButton *mKeyForCardKeysButton = nullptr; QMap mKeyWidgets; }; } // namespace Kleo