1// Copyright (C) 2014 BlackBerry Limited. All rights reserved.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QABSTRACTPROTOCOLHANDLER_H
6#define QABSTRACTPROTOCOLHANDLER_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of the Network Access API. This header file may change from
14// version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtNetwork/private/qtnetworkglobal_p.h>
20
21#include <QtCore/qtpreprocessorsupport.h>
22
23QT_REQUIRE_CONFIG(http);
24
25QT_BEGIN_NAMESPACE
26
27class QHttpNetworkConnectionChannel;
28class QHttpNetworkReply;
29class QIODevice;
30class QHttpNetworkConnection;
31
32class QAbstractProtocolHandler {
33public:
34 QAbstractProtocolHandler(QHttpNetworkConnectionChannel *channel);
35 virtual ~QAbstractProtocolHandler();
36
37 virtual void _q_receiveReply() = 0;
38 virtual void _q_readyRead() = 0;
39 virtual bool sendRequest() = 0;
40 // Called when the reply is being destroyed and removing itself from any other internals
41 virtual bool tryRemoveReply(QHttpNetworkReply *reply)
42 {
43 Q_UNUSED(reply);
44 // base implementation is a noop
45 return false;
46 }
47 void setReply(QHttpNetworkReply *reply);
48
49protected:
50 QHttpNetworkConnectionChannel *m_channel;
51 QHttpNetworkReply *m_reply;
52 QIODevice *m_socket;
53 QHttpNetworkConnection *m_connection;
54};
55
56QT_END_NAMESPACE
57
58#endif // QABSTRACTPROTOCOLHANDLER_H
59

source code of qtbase/src/network/access/qabstractprotocolhandler_p.h