1 #ifndef HANDSHAKERESPONSE_P_H
2 #define HANDSHAKERESPONSE_P_H
7 // This file is not part of the Qt API. It exists purely as an
8 // implementation detail. This header file may change from version to
9 // version without notice, or even be removed.
15 #include "qwebsocketprotocol.h"
17 class HandshakeRequest;
21 class HandshakeResponse:public QObject
25 HandshakeResponse(const HandshakeRequest &request,
26 const QString &serverName,
28 const QList<QWebSocketProtocol::Version> &supportedVersions,
29 const QList<QString> &supportedProtocols,
30 const QList<QString> &supportedExtensions);
32 virtual ~HandshakeResponse();
35 bool canUpgrade() const;
36 QString getAcceptedProtocol() const;
37 QString getAcceptedExtension() const;
38 QWebSocketProtocol::Version getAcceptedVersion() const;
45 Q_DISABLE_COPY(HandshakeResponse)
49 QString m_acceptedProtocol;
50 QString m_acceptedExtension;
51 QWebSocketProtocol::Version m_acceptedVersion;
53 QString calculateAcceptKey(const QString &key) const;
54 QString getHandshakeResponse(const HandshakeRequest &request,
55 const QString &serverName,
57 const QList<QWebSocketProtocol::Version> &supportedVersions,
58 const QList<QString> &supportedProtocols,
59 const QList<QString> &supportedExtensions);
61 QTextStream &writeToStream(QTextStream &textStream) const;
62 friend QTextStream &operator <<(QTextStream &stream, const HandshakeResponse &response);
65 #endif // HANDSHAKERESPONSE_P_H