File indexing completed on 2024-11-24 04:44:41
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org> 0003 * SPDX-License-Identifier: LGPL-2.0-or-later 0004 */ 0005 0006 #ifndef KHEALTHCERTIFICATETYPES_P_H 0007 #define KHEALTHCERTIFICATETYPES_P_H 0008 0009 #include "khealthcertificatetypes.h" 0010 0011 #include <QSharedData> 0012 #include <QVariant> 0013 0014 #define KHEALTHCERTIFICATE_MAKE_GADGET(Class) \ 0015 K ## Class ## Certificate::K ## Class ## Certificate() : d(new K ## Class ## Certificate ## Private) {} \ 0016 K ## Class ## Certificate::K ## Class ## Certificate(const K ## Class ## Certificate&) = default; \ 0017 K ## Class ## Certificate::K ## Class ## Certificate(K ## Class ## Certificate&&) noexcept = default; \ 0018 K ## Class ## Certificate::~K ## Class ## Certificate() = default; \ 0019 K ## Class ## Certificate& K ## Class ## Certificate::operator=(const K ## Class ## Certificate&) = default; \ 0020 K ## Class ## Certificate& K ## Class ## Certificate::operator=(K ## Class ## Certificate&&) noexcept = default; \ 0021 K ## Class ## Certificate::operator QVariant() const { return QVariant::fromValue(*this); } \ 0022 bool K ## Class ## Certificate::operator==(const K ## Class ## Certificate &other) const { return d->rawData == other.d->rawData; } \ 0023 bool K ## Class ## Certificate::operator!=(const K ## Class ## Certificate &other) const { return d->rawData == other.d->rawData; } \ 0024 KHealthCertificate::CertificateType K ## Class ## Certificate::type() const { return KHealthCertificate::Class; } 0025 0026 #define KHEALTHCERTIFICATE_MAKE_PROPERTY(Class, Type, Getter, Setter) \ 0027 Type K ## Class ## Certificate::Getter() const { return d->Getter; } \ 0028 void K ## Class ## Certificate::Setter(KHealthCertificateInternal::parameter_type<Type>::type value) \ 0029 { \ 0030 d.detach(); \ 0031 d->Getter = value; \ 0032 } 0033 0034 #endif // KHEALTHCERTIFICATETYPES_P_H 0035 0036