| 1 | // Copyright (C) 2025 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QPROTOBUFJSONSERIALIZER_P_H |
| 5 | #define QPROTOBUFJSONSERIALIZER_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtProtobuf/qtprotobufexports.h> |
| 19 | |
| 20 | #include <QtCore/qtconfigmacros.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QProtobufMessage; |
| 25 | class QJsonValue; |
| 26 | class QMetaType; |
| 27 | |
| 28 | namespace QtProtobufPrivate { |
| 29 | |
| 30 | struct QProtobufFieldInfo; |
| 31 | |
| 32 | using CustomJsonSerializer = QJsonValue (*)(const QProtobufMessage *); |
| 33 | using CustomJsonDeserializer = bool (*)(QProtobufMessage *, const QJsonValue &); |
| 34 | |
| 35 | Q_PROTOBUF_EXPORT void registerCustomJsonHandler(QMetaType metaType, |
| 36 | CustomJsonSerializer serializer, |
| 37 | CustomJsonDeserializer deserializer); |
| 38 | |
| 39 | [[nodiscard]] CustomJsonSerializer findCustomJsonSerializer(QMetaType metaType); |
| 40 | [[nodiscard]] CustomJsonDeserializer findCustomJsonDeserializer(QMetaType metaType); |
| 41 | } |
| 42 | |
| 43 | QT_END_NAMESPACE |
| 44 | |
| 45 | #endif // QPROTOBUFJSONSERIALIZER_P_H |
| 46 |
