QCefView
|
Represents the CEF context. More...
#include <QCefContext.h>
Public Member Functions | |
QCefContext (QCoreApplication *app, int argc, char **argv, const QCefConfig *config) | |
Constructs the CEF context. | |
~QCefContext () | |
Destructs the CEF context. | |
void | addLocalFolderResource (const QString &path, const QString &url, int priority=0) |
Adds a url mapping item with local web resource directory. This works for all QCefView instances created subsequently. | |
void | addArchiveResource (const QString &path, const QString &url, const QString &password="", int priority=0) |
Adds a url mapping item with local archive (.zip) file which contains the web resource. This works for all QCefView instances created subsequently. | |
bool | addCookie (const QString &name, const QString &value, const QString &domain, const QString &url) |
Adds a cookie to the CEF context, this cookie is accessible from all browsers created with this context. | |
bool | deleteAllCookies () |
Deletes all cookies from the CEF context. | |
bool | addCrossOriginWhitelistEntry (const QString &sourceOrigin, const QString &targetSchema, const QString &targetDomain, bool allowTargetSubdomains) |
Adds an entry to the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L81C23-L81C23. | |
bool | removeCrossOriginWhitelistEntry (const QString &sourceOrigin, const QString &targetSchema, const QString &targetDomain, bool allowTargetSubdomains) |
Removes an entry from the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L91C12-L91C12. | |
bool | clearCrossOriginWhitelistEntry () |
Removes all entries from the cross-origin access whitelist. | |
const QCefConfig * | cefConfig () const |
Gets the QCefConfig. | |
Static Public Member Functions | |
static QCefContext * | instance () |
Gets the unique default instance. | |
Protected Member Functions | |
bool | init (const QCefConfig *config) |
Initialize the CEF context. | |
void | uninit () |
Uninitialize the CEF context. | |
Represents the CEF context.
QCefContext::QCefContext | ( | QCoreApplication * | app, |
int | argc, | ||
char ** | argv, | ||
const QCefConfig * | config ) |
Constructs the CEF context.
app | The application |
argc | The argument count |
argv | The argument list pointer |
config | The QCefConfig instance |
QCefContext::~QCefContext | ( | ) |
Destructs the CEF context.
|
static |
Gets the unique default instance.
void QCefContext::addLocalFolderResource | ( | const QString & | path, |
const QString & | url, | ||
int | priority = 0 ) |
Adds a url mapping item with local web resource directory. This works for all QCefView instances created subsequently.
path | The path to the local resource directory |
url | The url to be mapped to |
priority | The priority |
void QCefContext::addArchiveResource | ( | const QString & | path, |
const QString & | url, | ||
const QString & | password = "", | ||
int | priority = 0 ) |
Adds a url mapping item with local archive (.zip) file which contains the web resource. This works for all QCefView instances created subsequently.
path | The path to the local archive file |
url | The url to be mapped to |
password | The password of the archive |
priority | The priority |
bool QCefContext::addCookie | ( | const QString & | name, |
const QString & | value, | ||
const QString & | domain, | ||
const QString & | url ) |
Adds a cookie to the CEF context, this cookie is accessible from all browsers created with this context.
name | The cookie item name |
value | The cookie item value |
domain | The applicable domain name |
url | The applicable url |
bool QCefContext::deleteAllCookies | ( | ) |
Deletes all cookies from the CEF context.
bool QCefContext::addCrossOriginWhitelistEntry | ( | const QString & | sourceOrigin, |
const QString & | targetSchema, | ||
const QString & | targetDomain, | ||
bool | allowTargetSubdomains ) |
Adds an entry to the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L81C23-L81C23.
sourceOrigin | The source origin |
targetSchema | The target schema |
targetDomain | The target domain |
allowTargetSubdomains | Whether to allow subdomain or not |
bool QCefContext::removeCrossOriginWhitelistEntry | ( | const QString & | sourceOrigin, |
const QString & | targetSchema, | ||
const QString & | targetDomain, | ||
bool | allowTargetSubdomains ) |
Removes an entry from the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L91C12-L91C12.
sourceOrigin | The source origin |
targetSchema | The target schema |
targetDomain | The target domain |
allowTargetSubdomains | Whether to allow subdomain or not |
bool QCefContext::clearCrossOriginWhitelistEntry | ( | ) |
Removes all entries from the cross-origin access whitelist.
const QCefConfig * QCefContext::cefConfig | ( | ) | const |
Gets the QCefConfig.
|
protected |
Initialize the CEF context.
config | The QCefConfig instance |
|
protected |
Uninitialize the CEF context.