File indexing completed on 2024-06-23 05:14:04

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     dialogs/expirydialog.h
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
0006     SPDX-FileCopyrightText: 2021 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 <QDialog>
0015 
0016 #include <memory.h>
0017 
0018 class QDate;
0019 class QShowEvent;
0020 
0021 namespace GpgME
0022 {
0023 class Key;
0024 }
0025 
0026 namespace Kleo
0027 {
0028 namespace Dialogs
0029 {
0030 
0031 class ExpiryDialog : public QDialog
0032 {
0033     Q_OBJECT
0034 public:
0035     enum class Mode {
0036         UpdateCertificateWithSubkeys,
0037         UpdateCertificateWithoutSubkeys,
0038         UpdateIndividualSubkey,
0039     };
0040 
0041     explicit ExpiryDialog(Mode mode, QWidget *parent = nullptr);
0042     ~ExpiryDialog() override;
0043 
0044     void setDateOfExpiry(const QDate &date);
0045     QDate dateOfExpiry() const;
0046 
0047     void setUpdateExpirationOfAllSubkeys(bool update);
0048     bool updateExpirationOfAllSubkeys() const;
0049     void setPrimaryKey(const GpgME::Key &key);
0050 
0051     void accept() override;
0052 
0053 protected:
0054     void showEvent(QShowEvent *event) override;
0055 
0056 private:
0057     class Private;
0058     std::unique_ptr<Private> d;
0059 };
0060 
0061 }
0062 }