File indexing completed on 2024-05-26 05:24:19

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     kleo/auditlogentry.h
0003 
0004     This file is part of libkleopatra, the KDE keymanagement library
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 "kleo_export.h"
0015 
0016 #include <memory>
0017 
0018 class QDebug;
0019 class QString;
0020 class QUrl;
0021 
0022 namespace GpgME
0023 {
0024 class Error;
0025 }
0026 namespace QGpgME
0027 {
0028 class Job;
0029 }
0030 
0031 namespace Kleo
0032 {
0033 
0034 class KLEO_EXPORT AuditLogEntry
0035 {
0036 public:
0037     AuditLogEntry();
0038     explicit AuditLogEntry(const GpgME::Error &error);
0039     AuditLogEntry(const QString &text, const GpgME::Error &error);
0040     ~AuditLogEntry();
0041 
0042     AuditLogEntry(const AuditLogEntry &other);
0043     AuditLogEntry &operator=(const AuditLogEntry &other);
0044 
0045     AuditLogEntry(AuditLogEntry &&other);
0046     AuditLogEntry &operator=(AuditLogEntry &&other);
0047 
0048     static AuditLogEntry fromJob(const QGpgME::Job *);
0049 
0050     GpgME::Error error() const;
0051     QString text() const;
0052 
0053     QUrl asUrl(const QUrl &urlTemplate) const;
0054 
0055 private:
0056     class Private;
0057     std::unique_ptr<Private> d;
0058 };
0059 
0060 }
0061 
0062 KLEO_EXPORT QDebug operator<<(QDebug debug, const Kleo::AuditLogEntry &auditLog);