Molybden API
Loading...
Searching...
No Matches
network_events.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_NETWORK_EVENTS_HPP
6#define MOLYBDEN_NETWORK_EVENTS_HPP
7
8#include <memory>
9#include <string>
10
11#include "molybden/base/event.hpp"
12#include "molybden/network/net_error.hpp"
13#include "molybden/network/url_request.hpp"
14
15namespace molybden {
16
17class Network;
18
26 std::shared_ptr<Network> network;
27
31 ConnectionType connection_type;
32};
33
41 std::shared_ptr<Network> network;
42
46 uint32_t line_number;
47
51 std::string error_text;
52};
53
61 std::shared_ptr<Network> network;
62
67
72 uint32_t response_code;
73
79 std::string new_url;
80};
81
89 std::shared_ptr<Network> network;
90
95
99 uint32_t response_code;
100
104 UrlRequestStatus status;
105
111 NetError error_code;
112
117};
118
126 std::shared_ptr<Network> network;
127
132};
133
141 std::shared_ptr<Network> network;
142
147
152 std::string mime_type;
153
159 std::string charset;
160
164 std::string data;
165};
166
174 std::shared_ptr<Network> network;
175
180
185};
186
285} // namespace molybden
286
287#endif // MOLYBDEN_NETWORK_EVENTS_HPP
Events allow you to be notified when something happens in Molybden.
Definition event.hpp:25
A class that contains all network events.
Definition network_events.hpp:190
Event< RedirectResponseCodeReceived > onRedirectResponseCodeReceived
Invoked when a redirect response code (3xx) has been received for the URL request.
Definition network_events.hpp:236
Event< RequestDestroyed > onRequestDestroyed
Invoked when the URL request has been destroyed.
Definition network_events.hpp:258
Event< RequestCompleted > onRequestCompleted
Invoked when the URL request has been completed.
Definition network_events.hpp:247
Event< ResponseStarted > onResponseStarted
Invoked when the first byte of the URL response body has been received.
Definition network_events.hpp:283
Event< NetworkChanged > onNetworkChanged
Invoked when the current network connection has changed.
Definition network_events.hpp:213
Event< PacScriptErrorReceived > onPacScriptErrorReceived
Invoked when the PAC file processing has been failed.
Definition network_events.hpp:224
Event< ResponseBytesReceived > onResponseBytesReceived
Invoked when a part of HTTP response body has been received over the network.
Definition network_events.hpp:270
The NetworkEvents::onNetworkChanged event arguments.
Definition network_events.hpp:22
ConnectionType connection_type
The connection type of the network.
Definition network_events.hpp:31
std::shared_ptr< Network > network
The network instance initiated this event.
Definition network_events.hpp:26
The NetworkEvents::onPacScriptErrorReceived event arguments.
Definition network_events.hpp:37
std::string error_text
The description of the script processing error.
Definition network_events.hpp:51
uint32_t line_number
The line of code in the PAC script which caused the error.
Definition network_events.hpp:46
std::shared_ptr< Network > network
The network instance initiated this event.
Definition network_events.hpp:41
The NetworkEvents::onRedirectResponseCodeReceived event arguments.
Definition network_events.hpp:57
std::shared_ptr< Network > network
The network instance initiated this event.
Definition network_events.hpp:61
uint32_t response_code
The HTTP response code (e.g., 300, 301, and so on).
Definition network_events.hpp:72
UrlRequest url_request
The URL request that has been redirected.
Definition network_events.hpp:66
std::string new_url
The new location of the redirected URL request.
Definition network_events.hpp:79
The NetworkEvents::onRequestCompleted event arguments.
Definition network_events.hpp:85
NetError error_code
The URL request error code.
Definition network_events.hpp:111
uint32_t response_code
The HTTP response code or 0 if the request has been failed or canceled.
Definition network_events.hpp:99
std::shared_ptr< Network > network
The network instance initiated this event.
Definition network_events.hpp:89
UrlRequest url_request
The URL request that has been completed.
Definition network_events.hpp:94
UrlRequestStatus status
The status of the URL request.
Definition network_events.hpp:104
bool is_cached
True if the response has been taken from cache.
Definition network_events.hpp:116
The NetworkEvents::onRequestDestroyed event arguments.
Definition network_events.hpp:122
UrlRequest url_request
The URL request that has been destroyed.
Definition network_events.hpp:131
std::shared_ptr< Network > network
The network instance initiated this event.
Definition network_events.hpp:126
The NetworkEvents::onResponseBytesReceived event arguments.
Definition network_events.hpp:137
std::shared_ptr< Network > network
The network instance initiated this event.
Definition network_events.hpp:141
std::string charset
The charset in lower case retrieved from the HTTP response headers of this request or an empty string...
Definition network_events.hpp:159
UrlRequest url_request
The URL request associated with the response.
Definition network_events.hpp:146
std::string mime_type
The MIME type value retrieved from the Content-Type header of this request or an empty string if ther...
Definition network_events.hpp:152
std::string data
The received part of HTTP response body.
Definition network_events.hpp:164
The NetworkEvents::onResponseStarted event arguments.
Definition network_events.hpp:170
uint32_t response_code
The HTTP response code.
Definition network_events.hpp:184
std::shared_ptr< Network > network
The network instance initiated this event.
Definition network_events.hpp:174
UrlRequest url_request
The URL request associated with the response.
Definition network_events.hpp:179
The details about a URL request.
Definition url_request.hpp:185