QCefView
Loading...
Searching...
No Matches
QCefDownloadItem

Represents the download item. More...

#include <QCefDownloadItem.h>

Public Member Functions

 ~QCefDownloadItem ()
 Destructs the download item instance.
 
void start (const QString &path, bool useDefaultDialog=true) const
 Starts to download the item.
 
void pause () const
 Pauses the download.
 
void resume () const
 Resume the download.
 
void cancel () const
 Cancels the download.
 
bool isStarted () const
 Gets whether the download is started.
 
bool isInProgress () const
 Gets whether the download is in progress.
 
bool isComplete () const
 Gets whether the download is complete.
 
bool isCanceled () const
 Gets whether the download has been canceled or interrupted.
 
qint64 currentSpeed () const
 Gets current download speed.
 
int percentComplete () const
 Gets the completion percentage.
 
qint64 totalBytes () const
 Gets total number of bytes.
 
qint64 receivedBytes () const
 Gets number of received bytes.
 
QDateTime startTime () const
 Gets the time that the download started.
 
QDateTime endTime () const
 Gets the time that the download ended.
 
QString fullPath () const
 Gets the full path to the downloaded or downloading file.
 
quint32 id () const
 Gets the unique identifier for this download.
 
QString url () const
 Gets the URL.
 
QString originalUrl () const
 Gets the original URL before any redirections.
 
QString suggestedFileName () const
 Gets the suggested file name.
 
QString contentDisposition () const
 Gets the content disposition.
 
QString mimeType () const
 Gets the mime type.
 

Detailed Description

Represents the download item.

Constructor & Destructor Documentation

◆ ~QCefDownloadItem()

QCefDownloadItem::~QCefDownloadItem ( )

Destructs the download item instance.

Member Function Documentation

◆ start()

void QCefDownloadItem::start ( const QString & path,
bool useDefaultDialog = true ) const

Starts to download the item.

Parameters
pathThe full path name (must include file name) to save the downloaded item
useDefaultDialogWhether to use the default 'Save As...' dialog or not

The 'path' parameter only works when 'useDefaultDialog' is set to false. If you set 'useDefaultDialog' to true then you cannot control the initial location of the opened 'Save As...' dialog, it is determined by CEF internal implementation.

◆ pause()

void QCefDownloadItem::pause ( ) const

Pauses the download.

◆ resume()

void QCefDownloadItem::resume ( ) const

Resume the download.

◆ cancel()

void QCefDownloadItem::cancel ( ) const

Cancels the download.

◆ isStarted()

bool QCefDownloadItem::isStarted ( ) const

Gets whether the download is started.

Returns

◆ isInProgress()

bool QCefDownloadItem::isInProgress ( ) const

Gets whether the download is in progress.

Returns
True if the download is in progress; otherwise false

◆ isComplete()

bool QCefDownloadItem::isComplete ( ) const

Gets whether the download is complete.

Returns
True if the download is complete; otherwise false

◆ isCanceled()

bool QCefDownloadItem::isCanceled ( ) const

Gets whether the download has been canceled or interrupted.

Returns
True if the download has been canceled or interrupted; otherwise false

◆ currentSpeed()

qint64 QCefDownloadItem::currentSpeed ( ) const

Gets current download speed.

Returns
A simple speed estimate in bytes/s

◆ percentComplete()

int QCefDownloadItem::percentComplete ( ) const

Gets the completion percentage.

Returns
The rough percent complete or -1 if the receive total size is unknown

◆ totalBytes()

qint64 QCefDownloadItem::totalBytes ( ) const

Gets total number of bytes.

Returns
The total number of bytes

◆ receivedBytes()

qint64 QCefDownloadItem::receivedBytes ( ) const

Gets number of received bytes.

Returns
The number of received bytes

◆ startTime()

QDateTime QCefDownloadItem::startTime ( ) const

Gets the time that the download started.

Returns
The time that the download started

◆ endTime()

QDateTime QCefDownloadItem::endTime ( ) const

Gets the time that the download ended.

Returns
The time that the download ended

◆ fullPath()

QString QCefDownloadItem::fullPath ( ) const

Gets the full path to the downloaded or downloading file.

Returns
The full path to the downloaded or downloading file

◆ id()

quint32 QCefDownloadItem::id ( ) const

Gets the unique identifier for this download.

Returns
The unique identifier for this download

◆ url()

QString QCefDownloadItem::url ( ) const

Gets the URL.

Returns
The the URL

◆ originalUrl()

QString QCefDownloadItem::originalUrl ( ) const

Gets the original URL before any redirections.

Returns
The original URL before any redirections

◆ suggestedFileName()

QString QCefDownloadItem::suggestedFileName ( ) const

Gets the suggested file name.

Returns
The suggested file name

◆ contentDisposition()

QString QCefDownloadItem::contentDisposition ( ) const

Gets the content disposition.

Returns
The the content disposition

◆ mimeType()

QString QCefDownloadItem::mimeType ( ) const

Gets the mime type.

Returns
The mime type