Coherent UI  2.5.3
A modern user interface library for games
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Coherent::UI::Download Class Referenceabstract

Encapsulates a download task. More...

#include <Coherent/UI/Download.h>

Public Member Functions

virtual void Destroy ()=0
 Must be called when the client is ready with the download to free the resources associated with it If the download is not yet complete this implies a Cancel operation Calling any method after Finish is undefined.
 
virtual unsigned GetId () const =0
 An opaque id of the download. Ids are unique per-context per-session and can be used to distinguish downloads poinitng to the same resource. More...
 
virtual bool Cancel ()=0
 Cancels a download task. More...
 
virtual const wchar_t * GetURL () const =0
 The download url. More...
 
virtual const wchar_t * GetFilename () const =0
 The name of the downloaded file. More...
 
virtual const wchar_t * GetReferrer () const =0
 The referrer of the download. More...
 
virtual unsigned GetTotalBytes () const =0
 The estimated size of the download. More...
 
virtual unsigned GetDownloadedBytesSoFar () const =0
 The bytes downloaded so far. NB. Downloads are completed asynchronously, this is an estimation and might not be up-to-date. More...
 
virtual bool IsComplete () const =0
 Tells if the download is complete. More...
 
virtual bool IsCancelled () const =0
 Tells if the download has been cancelled. More...
 
virtual bool HasFailed () const =0
 Tells if the download has failed. More...
 

Detailed Description

Encapsulates a download task.

Member Function Documentation

virtual bool Coherent::UI::Download::Cancel ( )
pure virtual

Cancels a download task.

Returns
true if the task has been cancelled. Calling Cancel on an already finished or stopped task will return false
virtual unsigned Coherent::UI::Download::GetDownloadedBytesSoFar ( ) const
pure virtual

The bytes downloaded so far. NB. Downloads are completed asynchronously, this is an estimation and might not be up-to-date.

Returns
the bytes downloaded so far
virtual const wchar_t* Coherent::UI::Download::GetFilename ( ) const
pure virtual

The name of the downloaded file.

Returns
the name of the file being doenloaded
virtual unsigned Coherent::UI::Download::GetId ( ) const
pure virtual

An opaque id of the download. Ids are unique per-context per-session and can be used to distinguish downloads poinitng to the same resource.

Returns
a unique id of the download
virtual const wchar_t* Coherent::UI::Download::GetReferrer ( ) const
pure virtual

The referrer of the download.

Returns
the referrer
virtual unsigned Coherent::UI::Download::GetTotalBytes ( ) const
pure virtual

The estimated size of the download.

Returns
the estimated size in bytes
virtual const wchar_t* Coherent::UI::Download::GetURL ( ) const
pure virtual

The download url.

Returns
the url to download
virtual bool Coherent::UI::Download::HasFailed ( ) const
pure virtual

Tells if the download has failed.

Returns
if the download has failed
virtual bool Coherent::UI::Download::IsCancelled ( ) const
pure virtual

Tells if the download has been cancelled.

Returns
if the download has been cancelled
virtual bool Coherent::UI::Download::IsComplete ( ) const
pure virtual

Tells if the download is complete.

Returns
if the download is complete