| 1 | // Copyright (C) 2024 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTQMLGRPCSTREAMSENDER_H |
| 5 | #define QTQMLGRPCSTREAMSENDER_H |
| 6 | |
| 7 | #include <QtGrpcQuick/qtgrpcquickexports.h> |
| 8 | |
| 9 | #include <QtGrpc/qgrpcstream.h> |
| 10 | |
| 11 | #include <QtProtobuf/qprotobufmessage.h> |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | #if 0 // Avoid generating any CaMeL-case header aliases. |
| 16 | # pragma qt_sync_suspend_processing |
| 17 | #endif |
| 18 | |
| 19 | class QQmlGrpcClientStreamSenderPrivate; |
| 20 | class Q_GRPCQUICK_EXPORT QQmlGrpcClientStreamSender : public QObject |
| 21 | { |
| 22 | Q_OBJECT |
| 23 | public: |
| 24 | ~QQmlGrpcClientStreamSender() override; |
| 25 | |
| 26 | protected: |
| 27 | explicit QQmlGrpcClientStreamSender(QGrpcClientStream *stream, QObject *parent = nullptr); |
| 28 | |
| 29 | void writeMessageImpl(const QProtobufMessage &message) const; |
| 30 | |
| 31 | private: |
| 32 | Q_DECLARE_PRIVATE(QQmlGrpcClientStreamSender) |
| 33 | Q_DISABLE_COPY_MOVE(QQmlGrpcClientStreamSender) |
| 34 | }; |
| 35 | |
| 36 | class QQmlGrpcBidiStreamSenderPrivate; |
| 37 | class Q_GRPCQUICK_EXPORT QQmlGrpcBidiStreamSender : public QObject |
| 38 | { |
| 39 | Q_OBJECT |
| 40 | public: |
| 41 | ~QQmlGrpcBidiStreamSender() override; |
| 42 | |
| 43 | protected: |
| 44 | explicit QQmlGrpcBidiStreamSender(QGrpcBidiStream *stream, QObject *parent = nullptr); |
| 45 | |
| 46 | void writeMessageImpl(const QProtobufMessage &message) const; |
| 47 | |
| 48 | private: |
| 49 | Q_DECLARE_PRIVATE(QQmlGrpcBidiStreamSender) |
| 50 | Q_DISABLE_COPY_MOVE(QQmlGrpcBidiStreamSender) |
| 51 | }; |
| 52 | |
| 53 | #if 0 |
| 54 | # pragma qt_sync_resume_processing |
| 55 | #endif |
| 56 | |
| 57 | QT_END_NAMESPACE |
| 58 | |
| 59 | #endif // QTQMLGRPCSTREAMSENDER_H |
| 60 |
