summaryrefslogtreecommitdiff
path: root/src/webchannel/qwebchannelabstracttransport.cpp
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2014-07-16 17:39:31 +0200
committerSumedha Widyadharma <sumedha.widyadharma@basyskom.com>2014-08-01 09:16:16 +0200
commitb84e46090b5230d7ebcdbdabd8c03a9ae5d2f860 (patch)
tree9687c3b47f4e77e931916a8afe1d516d3b280101 /src/webchannel/qwebchannelabstracttransport.cpp
parent5051411b92b4aca4ed5ec462e7b0e52af4d3951e (diff)
downloadqtwebchannel-b84e46090b5230d7ebcdbdabd8c03a9ae5d2f860.tar.gz
Add documentation for the QtWebChannel module.
Please proof-read it and tell me what needs to be improved. I assume most people will probably not use the QWebChannel directly. Rather, they will only consume its features indirectly through the integration in QtWebKit/QtWebEngine. Thus the documentation here is for QWebChannel as a library. User-end documentation should be added to QtWebKit, I think. Change-Id: I259c204e24331271b8dc74ea11695988234a79d3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/webchannel/qwebchannelabstracttransport.cpp')
-rw-r--r--src/webchannel/qwebchannelabstracttransport.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/webchannel/qwebchannelabstracttransport.cpp b/src/webchannel/qwebchannelabstracttransport.cpp
index 86c3121..0d56ff6 100644
--- a/src/webchannel/qwebchannelabstracttransport.cpp
+++ b/src/webchannel/qwebchannelabstracttransport.cpp
@@ -43,16 +43,53 @@
QT_BEGIN_NAMESPACE
+/*!
+ \class QWebChannelAbstractTransport
+
+ \inmodule QtWebChannel
+ \brief Communication channel between the C++ QWebChannel server and a HTML/JS client.
+ \since 5.4
+
+ Users of the QWebChannel must implement this interface and connect instances of it
+ to the QWebChannel server for every client that should be connected to the QWebChannel.
+ The {Standalone Example} shows how this can be done using QtWebSockets. QtWebKit implements
+ this interface internally and uses the native WebKit IPC mechanism to transmit messages
+ to HTML clients.
+
+ \note The JSON message protocol is considered internal and might change over time.
+
+ \sa {Standalone Example}
+*/
+
+/*!
+ \fn QWebChannelAbstractTransport::messageReceived(const QJsonObject &message, QWebChannelAbstractTransport *transport)
+
+ This signal must be emitted when a new JSON \a message was received from the remote client. The
+ \a transport argument should be set to this transport object.
+*/
+
+/*!
+ \fn QWebChannelAbstractTransport::sendMessage(const QJsonObject &message)
+
+ Send a JSON \a message to the remote client. An implementation would serialize the message and
+ transmit it to the remote JavaScript client.
+*/
+
+/*!
+ Constructs a transport object with the given \a parent.
+*/
QWebChannelAbstractTransport::QWebChannelAbstractTransport(QObject *parent)
: QObject(parent)
{
}
+/*!
+ Destroys the transport object.
+*/
QWebChannelAbstractTransport::~QWebChannelAbstractTransport()
{
}
-
QT_END_NAMESPACE