CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FxNANetworkReply.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2025 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
20#include "../UI/FxUIObject.h"
21#include "../UI/FxUISignal.h"
23#include "../Core/FxUIVariant.h"
24#include "../Core/FxUIUrl.h"
25#include "FxNANetworkRequest.h"
26
27#include <cstddef>
28#include <vector>
29#include <utility>
30
32template <typename T>
33using CFxNAList = std::vector<T>;
34template< typename T1, typename T2 >
35using CFxNAPair = std::pair< T1, T2 >;
39
44{
45public:
96
103
105 explicit CFxNANetworkReply( FxNativeHandle nativeReply );
106
108 CFxNANetworkReply( std::nullptr_t ) = delete;
109
112
119
126
132 bool isFinished() const;
133
139 bool isRunning() const;
140
147
154
162 long long bytesAvailable() const;
163
170
176 long long pos() const;
177
185 bool seek( long long pos );
186
195
204
212 bool hasRawHeader( const CFxNAByteArray& headerName ) const;
213
221 CFxNAByteArray rawHeader( const CFxNAByteArray& headerName ) const;
222
231
237 CFxNAUrl url() const;
238
241
242 // Slots
243
249 void abort();
250
251 // Signals
252
258 CFxUISignal<void( long long bytesReceived, long long bytesTotal )>& downloadProgress();
259
267 CFxUISignal<void( long long bytesSent, long long bytesTotal )>& uploadProgress();
268
275
282
289
290 //...
291};
#define COMMONUI_API
CFxUIByteArray CFxNAByteArray
CFxUIVariant CFxNAVariant
std::pair< T1, T2 > CFxNAPair
CFxUIString CFxNAString
CFxUIUrl CFxNAUrl
std::vector< T > CFxNAList
CFxString CFxUIString
QObject * FxNativeHandle
const CFxNANetworkRequest & request() const
NetworkError error() const
CFxNAVariant attribute(CFxNANetworkRequest::Attribute code) const
void setRequest(const CFxNANetworkRequest &request)
bool seek(long long pos)
CFxNANetworkReply()=delete
CFxNANetworkReply(FxNativeHandle nativeReply)
long long bytesAvailable() const
long long pos() const
CFxNANetworkReply(std::nullptr_t)=delete
CFxNAList< CFxNAByteArray > rawHeaderList() const
CFxUISignal< void(void)> & encrypted()
CFxUISignal< void(NetworkError)> & error()
CFxUISignal< void(long long bytesSent, long long bytesTotal)> & uploadProgress()
CFxUISignal< void(long long bytesReceived, long long bytesTotal)> & downloadProgress()
const CFxNAList< RawHeaderPair > & rawHeaderPairs() const
CFxNAByteArray rawHeader(const CFxNAByteArray &headerName) const
CFxNAVariant header(CFxNANetworkRequest::KnownHeaders header) const
bool hasRawHeader(const CFxNAByteArray &headerName) const
CFxNAPair< CFxNAByteArray, CFxNAByteArray > RawHeaderPair
CFxNAString errorString() const
@ NoError
no error condition.
@ BackgroundRequestNotAllowedError
the background request is not currently allowed due to platform policy.
@ TemporaryNetworkFailureError
the connection was broken due to disconnection from the network, however the system has initiated roa...
@ OperationNotImplementedError
the server does not support the functionality required to fulfill the request.
@ ProxyAuthenticationRequiredError
the proxy requires authentication in order to honour the request but did not accept any credentials o...
@ ContentReSendError
the request needed to be sent again, but this failed for example because the upload data could not be...
@ ProxyConnectionRefusedError
the connection to the proxy server was refused (the proxy server is not accepting requests)
@ InsecureRedirectError
while following redirects, the network access API detected a redirect from a encrypted protocol (http...
@ NetworkSessionFailedError
the connection was broken due to disconnection from the network or failure to start the network.
@ ContentAccessDenied
the access to the remote content was denied (similar to HTTP error 403)
@ ProxyTimeoutError
the connection to the proxy timed out or the proxy did not reply in time to the request sent
@ UnknownServerError
an unknown error related to the server response was detected
@ ContentOperationNotPermittedError
the operation requested on the remote content is not permitted
@ RemoteHostClosedError
the remote server closed the connection prematurely, before the entire reply was received and process...
@ UnknownProxyError
an unknown proxy-related error was detected
@ UnknownContentError
an unknown error related to the remote content was detected
@ ContentConflictError
the request could not be completed due to a conflict with the current state of the resource.
@ HostNotFoundError
the remote host name was not found (invalid hostname)
@ InternalServerError
the server encountered an unexpected condition which prevented it from fulfilling the request.
@ ProxyConnectionClosedError
the proxy server closed the connection prematurely, before the entire reply was received and processe...
@ ServiceUnavailableError
the server is unable to handle the request at this time.
@ UnknownNetworkError
an unknown network-related error was detected
@ SslHandshakeFailedError
the SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() sign...
@ ContentGoneError
the requested resource is no longer available at the server.
@ ProtocolInvalidOperationError
the requested operation is invalid for this protocol
@ ContentNotFoundError
the remote content was not found at the server (similar to HTTP error 404)
@ ProtocolUnknownError
the Network Access API cannot honor the request because the protocol is not known
@ ProtocolFailure
a breakdown in protocol was detected (parsing error, invalid or unexpected responses,...
@ AuthenticationRequiredError
the remote server requires authentication to serve the content but the credentials provided were not ...
@ OperationCanceledError
the operation was canceled via calls to abort() or close() before it was finished.
@ ProxyNotFoundError
the proxy host name was not found (invalid proxy hostname)
@ ConnectionRefusedError
the remote server refused the connection (the server is not accepting requests)
@ TooManyRedirectsError
while following redirects, the maximum limit was reached.
@ TimeoutError
the connection to the remote server timed out
bool isRunning() const
bool isFinished() const
CFxNAUrl url() const
CFxNAByteArray readAll()
CFxUISignal< void(void)> & finished()
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)