KHealthCertificate

kvaccinationcertificate.h
1/*
2 * SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
3 * SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5
6#ifndef KVACCINATIONCERTIFICATE_H
7#define KVACCINATIONCERTIFICATE_H
8
9#include "khealthcertificate_export.h"
10#include "khealthcertificatetypes.h"
11
12#include <QDateTime>
13#include <QUrl>
14
15class KVaccinationCertificatePrivate;
16
17/** A vaccination certificate. */
18class KHEALTHCERTIFICATE_EXPORT KVaccinationCertificate
19{
20 KHEALTHCERTIFICATE_GADGET(Vaccination)
21 KHEALTHCERTIFICATE_PROPERTY(QString, name, setName)
22 KHEALTHCERTIFICATE_PROPERTY(QDate, dateOfBirth, setDateOfBirth)
23 KHEALTHCERTIFICATE_PROPERTY(QDate, date, setDate)
24 KHEALTHCERTIFICATE_PROPERTY(QString, disease, setDisease)
25 /** The vaccine type, such as mRNA or vector. */
26 KHEALTHCERTIFICATE_PROPERTY(QString, vaccineType, setVaccineType)
27 /** The name of the vaccine as given by the manufacturer. */
28 KHEALTHCERTIFICATE_PROPERTY(QString, vaccine, setVaccine)
29 /** URL to further details on the vaccine. */
30 KHEALTHCERTIFICATE_PROPERTY(QUrl, vaccineUrl, setVaccineUrl)
31 /** Name of the manufacturer of the vaccine. */
32 KHEALTHCERTIFICATE_PROPERTY(QString, manufacturer, setManufacturer)
33 KHEALTHCERTIFICATE_PROPERTY(int, dose, setDose)
34 KHEALTHCERTIFICATE_PROPERTY(int, totalDoses, setTotalDoses)
35 /** Country the certificate was issued in, as ISO 3166-1 alpha 2 code. */
36 KHEALTHCERTIFICATE_PROPERTY(QString, country, setCountry)
37 /** The entity that issued this certificate. */
38 KHEALTHCERTIFICATE_PROPERTY(QString, certificateIssuer, setCertificateIssuer)
39 /** The unique identifier of this certificate. */
40 KHEALTHCERTIFICATE_PROPERTY(QString, certificateId, setCertificateId)
41 /** Date/time this certificate has been issued at. */
42 KHEALTHCERTIFICATE_PROPERTY(QDateTime, certificateIssueDate, setCertificateIssueDate)
43 /** Date/time this certificate expires. */
44 KHEALTHCERTIFICATE_PROPERTY(QDateTime, certificateExpiryDate, setCertificateExpiryDate)
45 /** Validation status of the cryptographic signature of this certificate. */
46 KHEALTHCERTIFICATE_PROPERTY(KHealthCertificate::SignatureValidation, signatureState, setSignatureState)
47
48 Q_PROPERTY(KHealthCertificate::CertificateValidation validationState READ validationState)
49
50 /** Fully encoded data as represented in the barcode. */
51 KHEALTHCERTIFICATE_PROPERTY(QByteArray, rawData, setRawData)
52public:
53 KHealthCertificate::CertificateValidation validationState() const;
54
55 /** More detailed information about the vaccination certificate. */
57 Invalid, ///< certificate is invalid
58 VaccinationTooRecent, ///< the vaccination happened too recently
59 PartiallyVaccinated, ///< a multi-dose vaccination hasn't been fully applied yet
60 Vaccinated, ///< valid vaccination, but not information about a multi-dose requirement specified
61 FullyVaccinated, ///< complete vaccination with all required doses
62 };
63 Q_ENUM(VaccinationState)
64
65 Q_PROPERTY(VaccinationState vaccinationState READ vaccinationState)
66public:
67 VaccinationState vaccinationState() const;
68};
69
70Q_DECLARE_METATYPE(KVaccinationCertificate)
71
72#endif // KVACCINATIONCERTIFICATE_H
Dummy RTTI for QML, which doesn't support instanceof on Q_GADGETs...
SignatureValidation
Result of attempting to verify the cryptographic signature of a certificate.
A vaccination certificate.
VaccinationState
More detailed information about the vaccination certificate.
@ Invalid
certificate is invalid
@ Vaccinated
valid vaccination, but not information about a multi-dose requirement specified
@ PartiallyVaccinated
a multi-dose vaccination hasn't been fully applied yet
@ FullyVaccinated
complete vaccination with all required doses
@ VaccinationTooRecent
the vaccination happened too recently
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:01:39 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.