|
CEF C++ API Docs - Revision 439 | ||||||
| FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
| Method Summary | |
CEF_EXPORT int |
cef_build_revision()
Returns the CEF build revision of the libcef library. |
CEF_EXPORT int |
cef_string_ascii_to_utf16( const char* src, size_t src_len, cef_string_utf16_t* output )
|
CEF_EXPORT int |
cef_string_ascii_to_wide( const char* src, size_t src_len, cef_string_wide_t* output )
These functions convert an ASCII string, typically a hardcoded constant, to a Wide/UTF16 string. |
CEF_EXPORT cef_string_list_t |
cef_string_list_alloc()
Allocate a new string map. |
CEF_EXPORT void |
cef_string_list_append( cef_string_list_t list, const cef_string_t* value )
Append a new value at the end of the string list. |
CEF_EXPORT void |
cef_string_list_clear( cef_string_list_t list )
Clear the string list. |
CEF_EXPORT cef_string_list_t |
cef_string_list_copy( cef_string_list_t list )
Creates a copy of an existing string list. |
CEF_EXPORT void |
cef_string_list_free( cef_string_list_t list )
Free the string list. |
CEF_EXPORT int |
cef_string_list_size( cef_string_list_t list )
Return the number of elements in the string list. |
CEF_EXPORT int |
cef_string_list_value( cef_string_list_t list, int index, cef_string_t* value )
Retrieve the value at the specified zero-based string list index. |
CEF_EXPORT cef_string_map_t |
cef_string_map_alloc()
Allocate a new string map. |
CEF_EXPORT int |
cef_string_map_append( cef_string_map_t map, const cef_string_t* key, const cef_string_t* value )
Append a new key/value pair at the end of the string map. |
CEF_EXPORT void |
cef_string_map_clear( cef_string_map_t map )
Clear the string map. |
CEF_EXPORT int |
cef_string_map_find( cef_string_map_t map, const cef_string_t* key, cef_string_t* value )
Return the value assigned to the specified key. |
CEF_EXPORT void |
cef_string_map_free( cef_string_map_t map )
Free the string map. |
CEF_EXPORT int |
cef_string_map_key( cef_string_map_t map, int index, cef_string_t* key )
Return the key at the specified zero-based string map index. |
CEF_EXPORT int |
cef_string_map_size( cef_string_map_t map )
Return the number of elements in the string map. |
CEF_EXPORT int |
cef_string_map_value( cef_string_map_t map, int index, cef_string_t* value )
Return the value at the specified zero-based string map index. |
CEF_EXPORT cef_string_multimap_t |
cef_string_multimap_alloc()
Allocate a new string multimap. |
CEF_EXPORT int |
cef_string_multimap_append( cef_string_multimap_t map, const cef_string_t* key, const cef_string_t* value )
Append a new key/value pair at the end of the string multimap. |
CEF_EXPORT void |
cef_string_multimap_clear( cef_string_multimap_t map )
Clear the string multimap. |
CEF_EXPORT int |
cef_string_multimap_enumerate( cef_string_multimap_t map, const cef_string_t* key, int value_index, cef_string_t* value )
Return the value_index-th value with the specified key. |
CEF_EXPORT int |
cef_string_multimap_find_count( cef_string_multimap_t map, const cef_string_t* key )
Return the number of values with the specified key. |
CEF_EXPORT void |
cef_string_multimap_free( cef_string_multimap_t map )
Free the string multimap. |
CEF_EXPORT int |
cef_string_multimap_key( cef_string_multimap_t map, int index, cef_string_t* key )
Return the key at the specified zero-based string multimap index. |
CEF_EXPORT int |
cef_string_multimap_size( cef_string_multimap_t map )
Return the number of elements in the string multimap. |
CEF_EXPORT int |
cef_string_multimap_value( cef_string_multimap_t map, int index, cef_string_t* value )
Return the value at the specified zero-based string multimap index. |
CEF_EXPORT cef_string_userfree_utf16_t |
cef_string_userfree_utf16_alloc()
|
CEF_EXPORT void |
cef_string_userfree_utf16_free( cef_string_userfree_utf16_t str )
|
CEF_EXPORT cef_string_userfree_utf8_t |
cef_string_userfree_utf8_alloc()
|
CEF_EXPORT void |
cef_string_userfree_utf8_free( cef_string_userfree_utf8_t str )
|
CEF_EXPORT cef_string_userfree_wide_t |
cef_string_userfree_wide_alloc()
These functions allocate a new string structure. |
CEF_EXPORT void |
cef_string_userfree_wide_free( cef_string_userfree_wide_t str )
These functions free the string structure allocated by the associated alloc function. |
CEF_EXPORT void |
cef_string_utf16_clear( cef_string_utf16_t* str )
|
CEF_EXPORT int |
cef_string_utf16_cmp( const cef_string_utf16_t* str1, const cef_string_utf16_t* str2 )
|
CEF_EXPORT int |
cef_string_utf16_set( const char16* src, size_t src_len, cef_string_utf16_t* output, int copy )
|
CEF_EXPORT int |
cef_string_utf16_to_utf8( const char16* src, size_t src_len, cef_string_utf8_t* output )
|
CEF_EXPORT int |
cef_string_utf16_to_wide( const char16* src, size_t src_len, cef_string_wide_t* output )
|
CEF_EXPORT void |
cef_string_utf8_clear( cef_string_utf8_t* str )
|
CEF_EXPORT int |
cef_string_utf8_cmp( const cef_string_utf8_t* str1, const cef_string_utf8_t* str2 )
|
CEF_EXPORT int |
cef_string_utf8_set( const char* src, size_t src_len, cef_string_utf8_t* output, int copy )
|
CEF_EXPORT int |
cef_string_utf8_to_utf16( const char* src, size_t src_len, cef_string_utf16_t* output )
|
CEF_EXPORT int |
cef_string_utf8_to_wide( const char* src, size_t src_len, cef_string_wide_t* output )
|
CEF_EXPORT void |
cef_string_wide_clear( cef_string_wide_t* str )
These functions clear string values. |
CEF_EXPORT int |
cef_string_wide_cmp( const cef_string_wide_t* str1, const cef_string_wide_t* str2 )
These functions compare two string values with the same results as strcmp(). |
CEF_EXPORT int |
cef_string_wide_set( const wchar_t* src, size_t src_len, cef_string_wide_t* output, int copy )
These functions set string values. |
CEF_EXPORT int |
cef_string_wide_to_utf16( const wchar_t* src, size_t src_len, cef_string_utf16_t* output )
|
CEF_EXPORT int |
cef_string_wide_to_utf8( const wchar_t* src, size_t src_len, cef_string_utf8_t* output )
These functions convert between UTF-8, -16, and -32 strings. |
CEF_EXPORT int |
cef_time_from_doublet( double time, cef_time_t* cef_time )
|
CEF_EXPORT int |
cef_time_from_timet( time_t time, cef_time_t* cef_time )
|
CEF_EXPORT int |
cef_time_to_doublet( const cef_time_t* cef_time, double* time )
Converts cef_time_t to/from a double which is the number of seconds since epoch (Jan 1, 1970). |
CEF_EXPORT int |
cef_time_to_timet( const cef_time_t* cef_time, time_t* time )
Converts cef_time_t to/from time_t. |
bool |
CefAddCrossOriginWhitelistEntry( const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, bool allow_target_subdomains )
Add an entry to the cross-origin access whitelist. |
bool |
CefClearCrossOriginWhitelist()
Remove all entries from the cross-origin access whitelist. |
bool |
CefClearSchemeHandlerFactories()
Clear all registered scheme handler factories. |
bool |
CefCreateURL( const CefURLParts& parts, CefString& url )
Creates a URL from the specified |parts|, which must contain a non-empty spec or a non-empty host and path (at a minimum), but not both. |
bool |
CefCurrentlyOn( CefThreadId threadId )
CEF maintains multiple internal threads that are used for handling different types of tasks. |
bool |
CefDeleteCookies( const CefString& url, const CefString& cookie_name )
Delete all cookies that match the specified parameters. |
bool |
CefDeleteStorage( CefStorageType type, const CefString& origin, const CefString& key )
Deletes all storage of the specified type. |
void |
CefDoMessageLoopWork()
Perform a single iteration of CEF message loop processing. |
bool |
CefInitialize( const CefSettings& settings, CefRefPtr< CefApp > application )
This function should be called on the main application thread to initialize CEF when the application is started. |
bool |
CefParseURL( const CefString& url, CefURLParts& parts )
Parse the specified |url| into its component parts. |
bool |
CefPostDelayedTask( CefThreadId threadId, CefRefPtr< CefTask > task, long delay_ms )
Post a task for delayed execution on the specified thread. |
bool |
CefPostTask( CefThreadId threadId, CefRefPtr< CefTask > task )
Post a task for execution on the specified thread. |
void |
CefQuitMessageLoop()
Quit the CEF message loop that was started by calling CefRunMessageLoop(). |
bool |
CefRegisterCustomScheme( const CefString& scheme_name, bool is_standard, bool is_local, bool is_display_isolated )
Register a custom scheme. |
bool |
CefRegisterExtension( const CefString& extension_name, const CefString& javascript_code, CefRefPtr< CefV8Handler > handler )
Register a new V8 extension with the specified JavaScript extension code and handler. |
bool |
CefRegisterPlugin( const CefPluginInfo& plugin_info )
Register a plugin with the system. |
bool |
CefRegisterSchemeHandlerFactory( const CefString& scheme_name, const CefString& domain_name, CefRefPtr< CefSchemeHandlerFactory > factory )
Register a scheme handler factory for the specified |scheme_name| and optional |domain_name|. |
bool |
CefRemoveCrossOriginWhitelistEntry( const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, bool allow_target_subdomains )
Remove an entry from the cross-origin access whitelist. |
void |
CefRunMessageLoop()
Run the CEF message loop. |
bool |
CefSetCookie( const CefString& url, const CefCookie& cookie )
Sets a cookie given a valid URL and explicit user-provided cookie attributes. |
bool |
CefSetCookiePath( const CefString& path )
Sets the directory path that will be used for storing cookie data. |
bool |
CefSetStorage( CefStorageType type, const CefString& origin, const CefString& key, const CefString& value )
Sets storage of the specified type, origin, key and value. |
bool |
CefSetStoragePath( CefStorageType type, const CefString& path )
Sets the directory path that will be used for storing data of the specified type. |
void |
CefShutdown()
This function should be called on the main application thread to shut down CEF before the application exits. |
bool |
CefVisitAllCookies( CefRefPtr< CefCookieVisitor > visitor )
Visit all cookies. |
bool |
CefVisitStorage( CefStorageType type, const CefString& origin, const CefString& key, CefRefPtr< CefStorageVisitor > visitor )
Visit storage of the specified type. |
bool |
CefVisitUrlCookies( const CefString& url, bool includeHttpOnly, CefRefPtr< CefCookieVisitor > visitor )
Visit a subset of cookies. |
inline bool |
operator!=( const CefRect& a, const CefRect& b )
|
inline bool |
operator==( const CefRect& a, const CefRect& b )
|
| Method Detail |
CEF_EXPORT int cef_build_revision();
CEF_EXPORT int cef_string_ascii_to_utf16( const char* src, size_t src_len, cef_string_utf16_t* output );
CEF_EXPORT int cef_string_ascii_to_wide( const char* src, size_t src_len, cef_string_wide_t* output );
CEF_EXPORT cef_string_list_t cef_string_list_alloc();
CEF_EXPORT void cef_string_list_append( cef_string_list_t list, const cef_string_t* value );
CEF_EXPORT void cef_string_list_clear( cef_string_list_t list );
CEF_EXPORT cef_string_list_t cef_string_list_copy( cef_string_list_t list );
CEF_EXPORT void cef_string_list_free( cef_string_list_t list );
CEF_EXPORT int cef_string_list_size( cef_string_list_t list );
CEF_EXPORT int cef_string_list_value( cef_string_list_t list, int index, cef_string_t* value );
CEF_EXPORT cef_string_map_t cef_string_map_alloc();
CEF_EXPORT int cef_string_map_append( cef_string_map_t map, const cef_string_t* key, const cef_string_t* value );
CEF_EXPORT void cef_string_map_clear( cef_string_map_t map );
CEF_EXPORT int cef_string_map_find( cef_string_map_t map, const cef_string_t* key, cef_string_t* value );
CEF_EXPORT void cef_string_map_free( cef_string_map_t map );
CEF_EXPORT int cef_string_map_key( cef_string_map_t map, int index, cef_string_t* key );
CEF_EXPORT int cef_string_map_size( cef_string_map_t map );
CEF_EXPORT int cef_string_map_value( cef_string_map_t map, int index, cef_string_t* value );
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc();
CEF_EXPORT int cef_string_multimap_append( cef_string_multimap_t map, const cef_string_t* key, const cef_string_t* value );
CEF_EXPORT void cef_string_multimap_clear( cef_string_multimap_t map );
CEF_EXPORT int cef_string_multimap_enumerate( cef_string_multimap_t map, const cef_string_t* key, int value_index, cef_string_t* value );
CEF_EXPORT int cef_string_multimap_find_count( cef_string_multimap_t map, const cef_string_t* key );
CEF_EXPORT void cef_string_multimap_free( cef_string_multimap_t map );
CEF_EXPORT int cef_string_multimap_key( cef_string_multimap_t map, int index, cef_string_t* key );
CEF_EXPORT int cef_string_multimap_size( cef_string_multimap_t map );
CEF_EXPORT int cef_string_multimap_value( cef_string_multimap_t map, int index, cef_string_t* value );
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc();
CEF_EXPORT void cef_string_userfree_utf16_free( cef_string_userfree_utf16_t str );
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc();
CEF_EXPORT void cef_string_userfree_utf8_free( cef_string_userfree_utf8_t str );
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc();
CEF_EXPORT void cef_string_userfree_wide_free( cef_string_userfree_wide_t str );
CEF_EXPORT void cef_string_utf16_clear( cef_string_utf16_t* str );
CEF_EXPORT int cef_string_utf16_cmp( const cef_string_utf16_t* str1, const cef_string_utf16_t* str2 );
CEF_EXPORT int cef_string_utf16_set( const char16* src, size_t src_len, cef_string_utf16_t* output, int copy );
CEF_EXPORT int cef_string_utf16_to_utf8( const char16* src, size_t src_len, cef_string_utf8_t* output );
CEF_EXPORT int cef_string_utf16_to_wide( const char16* src, size_t src_len, cef_string_wide_t* output );
CEF_EXPORT void cef_string_utf8_clear( cef_string_utf8_t* str );
CEF_EXPORT int cef_string_utf8_cmp( const cef_string_utf8_t* str1, const cef_string_utf8_t* str2 );
CEF_EXPORT int cef_string_utf8_set( const char* src, size_t src_len, cef_string_utf8_t* output, int copy );
CEF_EXPORT int cef_string_utf8_to_utf16( const char* src, size_t src_len, cef_string_utf16_t* output );
CEF_EXPORT int cef_string_utf8_to_wide( const char* src, size_t src_len, cef_string_wide_t* output );
CEF_EXPORT void cef_string_wide_clear( cef_string_wide_t* str );
CEF_EXPORT int cef_string_wide_cmp( const cef_string_wide_t* str1, const cef_string_wide_t* str2 );
CEF_EXPORT int cef_string_wide_set( const wchar_t* src, size_t src_len, cef_string_wide_t* output, int copy );
CEF_EXPORT int cef_string_wide_to_utf16( const wchar_t* src, size_t src_len, cef_string_utf16_t* output );
CEF_EXPORT int cef_string_wide_to_utf8( const wchar_t* src, size_t src_len, cef_string_utf8_t* output );
CEF_EXPORT int cef_time_from_doublet( double time, cef_time_t* cef_time );
CEF_EXPORT int cef_time_from_timet( time_t time, cef_time_t* cef_time );
CEF_EXPORT int cef_time_to_doublet( const cef_time_t* cef_time, double* time );
CEF_EXPORT int cef_time_to_timet( const cef_time_t* cef_time, time_t* time );
bool CefAddCrossOriginWhitelistEntry( const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, bool allow_target_subdomains );
bool CefClearCrossOriginWhitelist();
bool CefClearSchemeHandlerFactories();
bool CefCreateURL( const CefURLParts& parts, CefString& url );
bool CefCurrentlyOn( CefThreadId threadId );
bool CefDeleteCookies( const CefString& url, const CefString& cookie_name );
bool CefDeleteStorage( CefStorageType type, const CefString& origin, const CefString& key );
void CefDoMessageLoopWork();
bool CefInitialize( const CefSettings& settings, CefRefPtr< CefApp > application );
bool CefParseURL( const CefString& url, CefURLParts& parts );
bool CefPostDelayedTask( CefThreadId threadId, CefRefPtr< CefTask > task, long delay_ms );
bool CefPostTask( CefThreadId threadId, CefRefPtr< CefTask > task );
void CefQuitMessageLoop();
bool CefRegisterCustomScheme( const CefString& scheme_name, bool is_standard, bool is_local, bool is_display_isolated );
[scheme]://[username]:[password]@[host]:[port]/[url-path]Standard scheme URLs must have a host component that is a fully qualified domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC 1123. These URLs will be canonicalized to "scheme://host/path" in the simplest case and "scheme://username:password@host:port/path" in the most explicit case. For example, "scheme:host/path" and "scheme:///host/path" will both be canonicalized to "scheme://host/path". The origin of a standard scheme URL is the combination of scheme, host and port (i.e., "scheme://host:port" in the most explicit case). For non-standard scheme URLs only the "scheme:" component is parsed and canonicalized. The remainder of the URL will be passed to the handler as-is. For example, "scheme:///some%20text" will remain the same. Non-standard scheme URLs cannot be used as a target for form submission. If |is_local| is true the scheme will be treated as local (i.e., with the same security rules as those applied to "file" URLs). Normal pages cannot link to or access local URLs. Also, by default, local URLs can only perform XMLHttpRequest calls to the same URL (origin + path) that originated the request. To allow XMLHttpRequest calls from a local URL to other URLs with the same origin set the CefSettings.file_access_from_file_urls_allowed value to true. To allow XMLHttpRequest calls from a local URL to all origins set the CefSettings.universal_access_from_file_urls_allowed value to true. If |is_display_isolated| is true the scheme will be treated as display- isolated. This means that pages cannot display these URLs unless they are from the same scheme. For example, pages in another origin cannot create iframes or hyperlinks to URLs with this scheme. This function may be called on any thread. It should only be called once per unique |scheme_name| value. If |scheme_name| is already registered or if an error occurs this method will return false.
bool CefRegisterExtension( const CefString& extension_name, const CefString& javascript_code, CefRefPtr< CefV8Handler > handler );
// create the 'example' global object if it doesn't already exist.
if (!example)
example = {};
// create the 'example.test' global object if it doesn't already exist.
if (!example.test)
example.test = {};
(function() {
// Define the function 'example.test.myfunction'.
example.test.myfunction = function() {
// Call CefV8Handler::Execute() with the function name 'MyFunction'
// and no arguments.
native function MyFunction();
return MyFunction();
};
// Define the getter function for parameter 'example.test.myparam'.
example.test.__defineGetter__('myparam', function() {
// Call CefV8Handler::Execute() with the function name 'GetMyParam'
// and no arguments.
native function GetMyParam();
return GetMyParam();
});
// Define the setter function for parameter 'example.test.myparam'.
example.test.__defineSetter__('myparam', function(b) {
// Call CefV8Handler::Execute() with the function name 'SetMyParam'
// and a single argument.
native function SetMyParam();
if(b) SetMyParam(b);
});
// Extension definitions can also contain normal JavaScript variables
// and functions.
var myint = 0;
example.test.increment = function() {
myint += 1;
return myint;
};
})();
Example usage in the page:
// Call the function. example.test.myfunction(); // Set the parameter. example.test.myparam = value; // Get the parameter. value = example.test.myparam; // Call another function. example.test.increment();
bool CefRegisterPlugin( const CefPluginInfo& plugin_info );
bool CefRegisterSchemeHandlerFactory( const CefString& scheme_name, const CefString& domain_name, CefRefPtr< CefSchemeHandlerFactory > factory );
bool CefRemoveCrossOriginWhitelistEntry( const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, bool allow_target_subdomains );
void CefRunMessageLoop();
bool CefSetCookie( const CefString& url, const CefCookie& cookie );
bool CefSetCookiePath( const CefString& path );
bool CefSetStorage( CefStorageType type, const CefString& origin, const CefString& key, const CefString& value );
bool CefSetStoragePath( CefStorageType type, const CefString& path );
void CefShutdown();
bool CefVisitAllCookies( CefRefPtr< CefCookieVisitor > visitor );
bool CefVisitStorage( CefStorageType type, const CefString& origin, const CefString& key, CefRefPtr< CefStorageVisitor > visitor );
bool CefVisitUrlCookies( const CefString& url, bool includeHttpOnly, CefRefPtr< CefCookieVisitor > visitor );
inline bool operator!=( const CefRect& a, const CefRect& b );
inline bool operator==( const CefRect& a, const CefRect& b );
|
CEF C++ API Docs - Revision 439 | ||||||
| FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||