KHealthCertificate

khealthcertificatetypes.h
1 /*
2  * SPDX-FileCopyrightText: 2021 Volker Krause <[email protected]>
3  * SPDX-License-Identifier: LGPL-2.0-or-later
4  */
5 
6 #ifndef KHEALTHCERTIFICATETYPES_H
7 #define KHEALTHCERTIFICATETYPES_H
8 
9 #include "khealthcertificate.h"
10 
11 #include <QMetaType>
12 #include <QSharedDataPointer>
13 
14 #include <type_traits>
15 
16 class QVariant;
17 
19 template <typename T>
20 struct parameter_type
21 {
22  using type = typename std::conditional<std::is_fundamental<T>::value || std::is_enum<T>::value, T, const T&>::type;
23 };
24 }
25 
26 #define KHEALTHCERTIFICATE_GADGET(Class) \
27  Q_GADGET \
28  Q_PROPERTY(KHealthCertificate::CertificateType type READ type) \
29 public: \
30  K ## Class ## Certificate(); \
31  K ## Class ## Certificate(K ## Class ## Certificate &&) noexcept; \
32  K ## Class ## Certificate(const K ## Class ##Certificate &); \
33  ~K ## Class ## Certificate(); \
34  K ## Class ## Certificate& operator=(K ## Class ## Certificate &&) noexcept; \
35  K ## Class ## Certificate& operator=(const K ## Class ## Certificate &); \
36  operator QVariant () const; \
37 private: \
38  KHealthCertificate::CertificateType type() const; \
39  friend class K ## Class ## CertificatePrivate; \
40  QExplicitlySharedDataPointer<K ## Class ## CertificatePrivate> d;
41 
42 #define KHEALTHCERTIFICATE_PROPERTY(Type, Getter, Setter) \
43 public: \
44  Q_PROPERTY(Type Getter READ Getter CONSTANT) \
45  Type Getter() const; \
46  void Setter(KHealthCertificateInternal::parameter_type<Type>::type value); \
47 
48 #endif // KHEALTHCERTIFICATETYPES_H
49 
Type type(const QSqlDatabase &db)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 23:21:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.