All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
WebBrowserCef::DownloadManager Class Reference

Download files using browser framework, uses cache automatically Inherit from this class and override any virtual function you need. More...

#include <WebBrowserCef/DownloadManager.hpp>

Public Member Functions

void cancel (int requestId)
 Cancel previously started download, thread-safe.
 
void cancelAll ()
 Cancel all downloads, thread-safe.
 
int download (QUrl url, const WebPagePtr &browser)
 Start new download, thread-safe. More...
 
virtual void downloadComplete (int requestId, std::shared_ptr< QTemporaryFile > file)
 Called in the main thread, default implementation does nothing.
 
virtual void downloadFailed (int requestId, cef_errorcode_t error)
 Called in the main thread, default implementation does nothing.
 
 DownloadManager (DownloadManager &&)=delete
 
virtual void downloadProgress (int requestId, int64_t current, int64_t total)
 Called in the main thread, default implementation does nothing.
 
DownloadManageroperator= (DownloadManager &&)=delete
 

Static Public Member Functions

template<typename T = DownloadManager, typename... Args>
static std::shared_ptr< T > create (Args...args)
 

Protected Member Functions

void init (std::weak_ptr< DownloadManager > self)
 

Detailed Description

Download files using browser framework, uses cache automatically Inherit from this class and override any virtual function you need.

Create instance of the new class by calling DownloadManager::create<MyDownloader>(args);

Member Function Documentation

int WebBrowserCef::DownloadManager::download ( QUrl  url,
const WebPagePtr &  browser 
)

Start new download, thread-safe.

Returns
request id