Added check on QT_NO_NETWORKPROXY to include proxy functionality only when required
[contrib/qtwebsockets.git] / src / handshakerequest_p.h
1 #ifndef HANDSHAKEREQUEST_P_H
2 #define HANDSHAKEREQUEST_P_H
3 //
4 //  W A R N I N G
5 //  -------------
6 //
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.
10 //
11 // We mean it.
12 //
13
14 #include <QObject>
15 #include <QMap>
16 #include <QString>
17 #include <QUrl>
18 #include <QSet>
19
20 #include "qwebsocketprotocol.h"
21
22 QT_BEGIN_NAMESPACE
23
24 class QTextStream;
25
26 class HandshakeRequest
27 {
28 public:
29         HandshakeRequest(int port, bool isSecure);
30         virtual ~HandshakeRequest();
31
32         void clear();
33
34         int getPort() const;
35         bool isSecure() const;
36         bool isValid() const;
37         QMap<QString, QString> getHeaders() const;
38         QList<QWebSocketProtocol::Version> getVersions() const;
39         QString getKey() const;
40         QString getOrigin() const;
41         QList<QString> getProtocols() const;
42         QList<QString> getExtensions() const;
43         QUrl getRequestUrl() const;
44         QString getResourceName() const;
45         QString getHost() const;
46
47 private:
48         Q_DISABLE_COPY(HandshakeRequest)
49         QTextStream &readFromStream(QTextStream &textStream);
50         friend QTextStream &operator >>(QTextStream &stream, HandshakeRequest &request);
51
52         int m_port;
53         bool m_isSecure;
54         bool m_isValid;
55         QMap<QString, QString> m_headers;
56         QList<QWebSocketProtocol::Version> m_versions;
57         QString m_key;
58         QString m_origin;
59         QList<QString> m_protocols;
60         QList<QString> m_extensions;
61         QUrl m_requestUrl;
62 };
63
64 QTextStream &operator >>(QTextStream &stream, HandshakeRequest &request);
65
66 QT_END_NAMESPACE
67
68 #endif // HANDSHAKEREQUEST_P_H