34#include <NDEVR/SoftwareService.h>
35#include <NDEVR/BaseValues.h>
36#include <NDEVR/TimeSpan.h>
37#include <NDEVR/Dictionary.h>
38#include <NDEVR/String.h>
43class QNetworkAccessManager;
74 virtual QByteArray
data() = 0;
262 void fileDownloadedSlot();
266 void updateDownloadProgressSlot(qint64 ist, qint64 max);
274 uint08 m_last_percent = 0U;
275 uint08 m_current_download_size;
276 uint08 m_total_download_size;
The equivelent of std::vector but with a bit more control.
A hash-based key-value store, useful for quick associative lookups.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
ItemDownloader(const StringView &url, QObject *parent=nullptr)
Constructs an ItemDownloader for the given URL string.
const QByteArray & downloadedData() const
Returns the downloaded data.
ItemDownloader(QUrl url, QObject *parent=nullptr)
Constructs an ItemDownloader for the given QUrl.
void start(TimeSpan timeout=TimeSpan(10.0))
Starts the download with an optional timeout.
uint08 currentDownloadSize() const
Returns the number of bytes downloaded so far.
static bool DownloadToFile(const StringView &url, const File &location, ProgressInfo &log)
Downloads a file from a URL and saves it to a local path.
static NetworkAccessManager * NetworkManager()
Returns the global NetworkAccessManager.
static bool HasNetworkManager()
Returns whether a NetworkAccessManager has been set.
void setNetworkRequest(const StringView &url)
Configures the internal network request for the given URL.
void downloadFailedSignal(StringView)
Emitted when a download fails, with an error message.
static ItemDownloader * GetItemDownloader(const StringView &url)
Returns an existing or new ItemDownloader for the given URL.
fltp08 downloadPercent() const
Returns the download progress as a percentage.
void percentChangedSignal()
Emitted when the download progress percentage changes.
static void SetAccessManager(NetworkAccessManager *manager)
Sets the global NetworkAccessManager used for all downloads.
void downloadedSignal()
Emitted when the download completes successfully.
uint08 totalDownloadSize() const
Returns the total expected download size.
Provides an interface for accessing resources on the internet.
virtual NetworkRequest * downloadFromURL(const WebTarget &url)=0
Creates a network request to download data from the given URL.
virtual NetworkRequest * uploadToURL(const WebTarget &request, const Buffer< uint01 > &data)=0
Creates a network request to upload raw data to the given URL.
virtual TimeRequest * networkTimeFromURL(const StringView &url, uint02 port=123)=0
Creates a time request to query network time from the given URL.
virtual NetworkRequest * uploadToURL(const WebTarget &request, const File &data)=0
Creates a network request to upload a file to the given URL.
A request for data or information from a network.
virtual void close()=0
Closes the network request and releases resources.
void requestSentSignal()
Emitted when the request has been sent.
void metaDataChangedSignal()
Emitted when response metadata changes.
void errorOccurredSignal(StringView error)
Emitted when an error occurs, with a description.
virtual bool isRunning()=0
Returns whether the request is currently in progress.
void uploadProgressSignal(qint64 bytesSent, qint64 bytesTotal)
Emitted to report upload progress.
void finishedSignal()
Emitted when the request has finished.
virtual QByteArray data()=0
Returns the data received from the network request.
virtual bool start()=0
Starts the network request.
void socketStartedConnectingSignal()
Emitted when the socket begins connecting.
virtual void abort()=0
Aborts the network request immediately.
void downloadProgressSignal(qint64 bytesReceived, qint64 bytesTotal)
Emitted to report download progress.
void redirectAllowedSignal()
Emitted when a redirect is allowed.
Used with InfoPipe to signal that the system will be using progress.
Handles timing out certain operations such as downloads.
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
A request to get the time from the network.
virtual Time txTime() const =0
Returns the time the request was transmitted.
virtual Time serverTime() const =0
Returns the time reported by the server.
void finishedSignal()
Emitted when the time request has finished.
TimeSpan localClockOffset() const
Calculates the offset between the local clock and the server clock.
void errorOccurredSignal(int error)
Emitted when an error occurs, with the error code.
TimeSpan roundTripDelay() const
Calculates the round-trip delay of the time request.
virtual Time rxTime() const =0
Returns the time the response was received.
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
The primary namespace for the NDEVR SDK.
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
double fltp08
Defines an alias representing an 8 byte floating-point number.
A url target and optional username and password for a network request.
String password
Optional password for authentication.
String username
Optional username for authentication.
String url
The target URL.
uint02 port
Optional port number, or Invalid for default.