1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQMLGRPCCHANNELOPTIONS_P_H
5#define QQMLGRPCCHANNELOPTIONS_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 <QtGrpcQuick/qtgrpcquickexports.h>
19
20#include <QtGrpc/qgrpcchanneloptions.h>
21#include <QtGrpc/qtgrpcnamespace.h>
22
23#include <QtQmlIntegration/qqmlintegration.h>
24#if QT_CONFIG(ssl)
25# include <QtQmlNetwork/private/qqmlsslconfiguration_p.h>
26#endif
27
28#include <QtCore/qobject.h>
29
30QT_BEGIN_NAMESPACE
31
32class QQmlGrpcMetadata;
33class QQmlGrpcChannelOptionsPrivate;
34class Q_GRPCQUICK_EXPORT QQmlGrpcChannelOptions : public QObject
35{
36 Q_OBJECT
37 QML_NAMED_ELEMENT(GrpcChannelOptions)
38 QML_ADDED_IN_VERSION(6, 7)
39
40 Q_PROPERTY(qint64 deadlineTimeout READ deadlineTimeout WRITE setDeadlineTimeout NOTIFY
41 deadlineTimeoutChanged)
42 Q_PROPERTY(QQmlGrpcMetadata *metadata READ metadata WRITE setMetadata NOTIFY metadataChanged)
43 Q_PROPERTY(QtGrpc::SerializationFormat serializationFormat
44 READ serializationFormat WRITE setSerializationFormat
45 NOTIFY serializationFormatChanged)
46#if QT_CONFIG(ssl)
47 Q_PROPERTY(QQmlSslConfiguration sslConfiguration READ sslConfiguration
48 WRITE setSslConfiguration NOTIFY sslConfigurationChanged)
49#endif // QT_CONFIG(ssl)
50
51public:
52 explicit QQmlGrpcChannelOptions(QObject *parent = nullptr);
53 ~QQmlGrpcChannelOptions() override;
54
55 const QGrpcChannelOptions &options() const & noexcept;
56 void options() && = delete;
57
58 qint64 deadlineTimeout() const;
59 void setDeadlineTimeout(qint64 value);
60
61 QQmlGrpcMetadata *metadata() const;
62 void setMetadata(QQmlGrpcMetadata *value);
63
64 QtGrpc::SerializationFormat serializationFormat() const;
65 void setSerializationFormat(QtGrpc::SerializationFormat format);
66
67#if QT_CONFIG(ssl)
68 QQmlSslConfiguration sslConfiguration() const;
69 void setSslConfiguration(const QQmlSslConfiguration &config);
70#endif // QT_CONFIG(ssl)
71
72Q_SIGNALS:
73 void deadlineTimeoutChanged();
74 void metadataChanged();
75 void serializationFormatChanged();
76#if QT_CONFIG(ssl)
77 void sslConfigurationChanged();
78#endif // QT_CONFIG(ssl)
79
80private:
81 Q_DECLARE_PRIVATE(QQmlGrpcChannelOptions)
82 Q_DISABLE_COPY_MOVE(QQmlGrpcChannelOptions)
83};
84
85QT_END_NAMESPACE
86
87#endif // QQMLGRPCCHANNELOPTIONS_P_H
88

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtgrpc/src/grpcquick/qqmlgrpcchanneloptions_p.h