2011-05-20 16:42:25 +02:00
|
|
|
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
2010-10-03 23:04:50 +02:00
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above
|
|
|
|
// copyright notice, this list of conditions and the following disclaimer
|
|
|
|
// in the documentation and/or other materials provided with the
|
|
|
|
// distribution.
|
|
|
|
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
|
|
|
// Framework nor the names of its contributors may be used to endorse
|
|
|
|
// or promote products derived from this software without specific prior
|
|
|
|
// written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool and should not edited
|
|
|
|
// by hand. See the translator.README.txt file in the tools directory for
|
|
|
|
// more information.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _CEF_CAPI_H
|
|
|
|
#define _CEF_CAPI_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-05-20 22:52:47 +02:00
|
|
|
#include "internal/cef_export.h"
|
|
|
|
#include "internal/cef_string.h"
|
|
|
|
#include "internal/cef_string_list.h"
|
|
|
|
#include "internal/cef_string_map.h"
|
2011-10-28 23:31:26 +02:00
|
|
|
#include "internal/cef_string_multimap.h"
|
2011-05-20 22:52:47 +02:00
|
|
|
#include "internal/cef_types.h"
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// This function should be called on the main application thread to initialize
|
|
|
|
// CEF when the application is started. A return value of true (1) indicates
|
|
|
|
// that it succeeded and false (0) indicates that it failed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
CEF_EXPORT int cef_initialize(const struct _cef_settings_t* settings);
|
2010-11-18 22:05:25 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// This function should be called on the main application thread to shut down
|
|
|
|
// CEF before the application exits.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT void cef_shutdown();
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Perform a single iteration of CEF message loop processing. This function is
|
|
|
|
// used to integrate the CEF message loop into an existing application message
|
|
|
|
// loop. Care must be taken to balance performance against excessive CPU usage.
|
|
|
|
// This function should only be called on the main application thread and only
|
|
|
|
// if cef_initialize() is called with a CefSettings.multi_threaded_message_loop
|
|
|
|
// value of false (0). This function will not block.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT void cef_do_message_loop_work();
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Run the CEF message loop. Use this function instead of an application-
|
|
|
|
// provided message loop to get the best balance between performance and CPU
|
|
|
|
// usage. This function should only be called on the main application thread and
|
|
|
|
// only if cef_initialize() is called with a
|
|
|
|
// CefSettings.multi_threaded_message_loop value of false (0). This function
|
|
|
|
// will block until a quit message is received by the system.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
CEF_EXPORT void cef_run_message_loop();
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Register a new V8 extension with the specified JavaScript extension code and
|
|
|
|
// handler. Functions implemented by the handler are prototyped using the
|
|
|
|
// keyword 'native'. The calling of a native function is restricted to the scope
|
2011-01-29 02:42:59 +01:00
|
|
|
// in which the prototype of the native function is defined. This function may
|
|
|
|
// be called on any thread.
|
2010-10-03 23:04:50 +02:00
|
|
|
//
|
2011-05-31 19:12:37 +02:00
|
|
|
// Example JavaScript extension code: <pre>
|
2010-10-03 23:04:50 +02:00
|
|
|
// // 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;
|
|
|
|
// };
|
|
|
|
// })();
|
2011-05-31 19:12:37 +02:00
|
|
|
// </pre> Example usage in the page: <pre>
|
2010-10-03 23:04:50 +02:00
|
|
|
// // 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();
|
2011-05-31 19:12:37 +02:00
|
|
|
// </pre>
|
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
|
|
|
|
const cef_string_t* javascript_code, struct _cef_v8handler_t* handler);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Register a custom scheme. This function should not be called for the built-in
|
|
|
|
// HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
2011-03-04 18:56:01 +01:00
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// If |is_standard| is true (1) the scheme will be treated as a standard scheme.
|
2011-03-04 18:56:01 +01:00
|
|
|
// Standard schemes are subject to URL canonicalization and parsing rules as
|
|
|
|
// defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available
|
|
|
|
// at http://www.ietf.org/rfc/rfc1738.txt
|
|
|
|
//
|
2011-05-31 19:12:37 +02:00
|
|
|
// In particular, the syntax for standard scheme URLs must be of the form: <pre>
|
|
|
|
// [scheme]://[username]:[password]@[host]:[port]/[url-path]
|
|
|
|
// </pre> 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
|
2011-03-04 18:56:01 +01:00
|
|
|
// explicit case. For example, "scheme:host/path" and "scheme:///host/path" will
|
|
|
|
// both be canonicalized to "scheme://host/path".
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// If |is_local| is true (1) the scheme will be treated as local (i.e., with the
|
|
|
|
// same security rules as those applied to "file" URLs). This means that normal
|
|
|
|
// pages cannot link to or access URLs of this scheme.
|
|
|
|
//
|
|
|
|
// If |is_display_isolated| is true (1) 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 function will return false (0).
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name,
|
|
|
|
int is_standard, int is_local, int is_display_isolated);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Register a scheme handler factory for the specified |scheme_name| and
|
|
|
|
// optional |domain_name|. An NULL |domain_name| value for a standard scheme
|
|
|
|
// will cause the factory to match all domain names. The |domain_name| value
|
|
|
|
// will be ignored for non-standard schemes. If |scheme_name| is a built-in
|
|
|
|
// scheme and no handler is returned by |factory| then the built-in scheme
|
|
|
|
// handler factory will be called. If |scheme_name| is a custom scheme the
|
|
|
|
// cef_register_custom_scheme() function should be called for that scheme. This
|
|
|
|
// function may be called multiple times to change or remove the factory that
|
|
|
|
// matches the specified |scheme_name| and optional |domain_name|. Returns false
|
|
|
|
// (0) if an error occurs. This function may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
CEF_EXPORT int cef_register_scheme_handler_factory(
|
|
|
|
const cef_string_t* scheme_name, const cef_string_t* domain_name,
|
2010-11-22 18:49:46 +01:00
|
|
|
struct _cef_scheme_handler_factory_t* factory);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Clear all registered scheme handler factories. Returns false (0) on error.
|
|
|
|
// This function may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
CEF_EXPORT int cef_clear_scheme_handler_factories();
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Add an entry to the cross-origin access whitelist.
|
|
|
|
//
|
|
|
|
// The same-origin policy restricts how scripts hosted from different origins
|
|
|
|
// (scheme + domain) can communicate. By default, scripts can only access
|
|
|
|
// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes
|
|
|
|
// (but no other schemes) can use the "Access-Control-Allow-Origin" header to
|
|
|
|
// allow cross-origin requests. For example, https://source.example.com can make
|
|
|
|
// XMLHttpRequest requests on http://target.example.com if the
|
|
|
|
// http://target.example.com request returns an "Access-Control-Allow-Origin:
|
|
|
|
// https://source.example.com" response header.
|
|
|
|
//
|
|
|
|
// Scripts in separate frames or iframes and hosted from the same protocol and
|
|
|
|
// domain suffix can execute cross-origin JavaScript if both pages set the
|
|
|
|
// document.domain value to the same domain suffix. For example,
|
|
|
|
// scheme://foo.example.com and scheme://bar.example.com can communicate using
|
|
|
|
// JavaScript if both domains set document.domain="example.com".
|
|
|
|
//
|
|
|
|
// This function is used to allow access to origins that would otherwise violate
|
|
|
|
// the same-origin policy. Scripts hosted underneath the fully qualified
|
|
|
|
// |source_origin| URL (like http://www.example.com) will be allowed access to
|
|
|
|
// all resources hosted on the specified |target_protocol| and |target_domain|.
|
|
|
|
// If |allow_target_subdomains| is true (1) access will also be allowed to all
|
|
|
|
// subdomains of the target domain. This function may be called on any thread.
|
|
|
|
// Returns false (0) if |source_origin| is invalid or the whitelist cannot be
|
|
|
|
// accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
|
|
|
|
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
|
|
|
const cef_string_t* target_domain, int allow_target_subdomains);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
|
|
|
|
// |source_origin| is invalid or the whitelist cannot be accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
|
|
|
|
const cef_string_t* source_origin, const cef_string_t* target_protocol,
|
|
|
|
const cef_string_t* target_domain, int allow_target_subdomains);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Remove all entries from the cross-origin access whitelist. Returns false (0)
|
|
|
|
// if the whitelist cannot be accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
CEF_EXPORT int cef_clear_cross_origin_whitelist();
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// CEF maintains multiple internal threads that are used for handling different
|
|
|
|
// types of tasks. The UI thread creates the browser window and is used for all
|
|
|
|
// interaction with the WebKit rendering engine and V8 JavaScript engine (The UI
|
2011-01-29 02:42:59 +01:00
|
|
|
// thread will be the same as the main application thread if cef_initialize() is
|
|
|
|
// called with a CefSettings.multi_threaded_message_loop value of false (0).)
|
|
|
|
// The IO thread is used for handling schema and network requests. The FILE
|
|
|
|
// thread is used for the application cache and other miscellaneous activities.
|
|
|
|
// This function will return true (1) if called on the specified thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Post a task for execution on the specified thread. This function may be
|
|
|
|
// called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT int cef_post_task(cef_thread_id_t threadId,
|
|
|
|
struct _cef_task_t* task);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Post a task for delayed execution on the specified thread. This function may
|
|
|
|
// be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId,
|
|
|
|
struct _cef_task_t* task, long delay_ms);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-31 21:47:04 +01:00
|
|
|
// Parse the specified |url| into its component parts. Returns false (0) if the
|
|
|
|
// URL is NULL or invalid.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-31 21:47:04 +01:00
|
|
|
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
|
|
|
struct _cef_urlparts_t* parts);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-31 21:47:04 +01:00
|
|
|
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
|
|
|
|
// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
|
|
|
|
// if |parts| isn't initialized as described.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-31 21:47:04 +01:00
|
|
|
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
|
|
|
|
cef_string_t* url);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
// Visit all cookies. The returned cookies are ordered by longest path, then by
|
|
|
|
// earliest creation date. Returns false (0) if cookies cannot be accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
// Visit a subset of cookies. The results are filtered by the given url scheme,
|
|
|
|
// host, domain and path. If |includeHttpOnly| is true (1) HTTP-only cookies
|
|
|
|
// will also be included in the results. The returned cookies are ordered by
|
|
|
|
// longest path, then by earliest creation date. Returns false (0) if cookies
|
|
|
|
// cannot be accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url,
|
|
|
|
int includeHttpOnly, struct _cef_cookie_visitor_t* visitor);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
// Sets a cookie given a valid URL and explicit user-provided cookie attributes.
|
|
|
|
// This function expects each attribute to be well-formed. It will check for
|
|
|
|
// disallowed characters (e.g. the ';' character is disallowed within the cookie
|
|
|
|
// value attribute) and will return false (0) without setting the cookie if such
|
|
|
|
// characters are found. This function must be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
CEF_EXPORT int cef_set_cookie(const cef_string_t* url,
|
|
|
|
const struct _cef_cookie_t* cookie);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
// Delete all cookies that match the specified parameters. If both |url| and
|
|
|
|
// |cookie_name| are specified all host and domain cookies matching both values
|
|
|
|
// will be deleted. If only |url| is specified all host cookies (but not domain
|
|
|
|
// cookies) irrespective of path will be deleted. If |url| is NULL all cookies
|
|
|
|
// for all hosts and domains will be deleted. Returns false (0) if a non-NULL
|
|
|
|
// invalid URL is specified or if cookies cannot be accessed. This function must
|
|
|
|
// be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
CEF_EXPORT int cef_delete_cookies(const cef_string_t* url,
|
|
|
|
const cef_string_t* cookie_name);
|
|
|
|
|
2011-11-02 20:50:00 +01:00
|
|
|
///
|
|
|
|
// Sets the directory path that will be used for storing cookie data. If |path|
|
|
|
|
// is NULL data will be stored in memory only. By default the cookie path is the
|
|
|
|
// same as the cache path. Returns false (0) if cookies cannot be accessed.
|
|
|
|
///
|
|
|
|
CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path);
|
|
|
|
|
2011-10-06 15:34:47 +02:00
|
|
|
///
|
|
|
|
// Visit storage of the specified type. If |origin| is non-NULL only data
|
|
|
|
// matching that origin will be visited. If |key| is non-NULL only data matching
|
|
|
|
// that key will be visited. Otherwise, all data for the storage type will be
|
2011-11-02 20:50:00 +01:00
|
|
|
// visited. Origin should be of the form scheme://domain. If no origin is
|
|
|
|
// specified only data currently in memory will be returned. Returns false (0)
|
|
|
|
// if the storage cannot be accessed.
|
2011-10-06 15:34:47 +02:00
|
|
|
///
|
|
|
|
CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type,
|
|
|
|
const cef_string_t* origin, const cef_string_t* key,
|
|
|
|
struct _cef_storage_visitor_t* visitor);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Sets storage of the specified type, origin, key and value. Returns false (0)
|
|
|
|
// if storage cannot be accessed. This function must be called on the UI thread.
|
|
|
|
///
|
|
|
|
CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type,
|
|
|
|
const cef_string_t* origin, const cef_string_t* key,
|
|
|
|
const cef_string_t* value);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Deletes all storage of the specified type. If |origin| is non-NULL only data
|
|
|
|
// matching that origin will be cleared. If |key| is non-NULL only data matching
|
|
|
|
// that key will be cleared. Otherwise, all data for the storage type will be
|
|
|
|
// cleared. Returns false (0) if storage cannot be accessed. This function must
|
|
|
|
// be called on the UI thread.
|
|
|
|
///
|
|
|
|
CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type,
|
|
|
|
const cef_string_t* origin, const cef_string_t* key);
|
|
|
|
|
2011-11-02 20:50:00 +01:00
|
|
|
///
|
|
|
|
// Sets the directory path that will be used for storing data of the specified
|
|
|
|
// type. Currently only the ST_LOCALSTORAGE type is supported by this function.
|
|
|
|
// If |path| is NULL data will be stored in memory only. By default the storage
|
|
|
|
// path is the same as the cache path. Returns false (0) if the storage cannot
|
|
|
|
// be accessed.
|
|
|
|
///
|
|
|
|
CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type,
|
|
|
|
const cef_string_t* path);
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_base_t
|
|
|
|
{
|
|
|
|
// Size of the data structure.
|
|
|
|
size_t size;
|
|
|
|
|
|
|
|
// Increment the reference count.
|
|
|
|
int (CEF_CALLBACK *add_ref)(struct _cef_base_t* self);
|
|
|
|
// Decrement the reference count. Delete this object when no references
|
|
|
|
// remain.
|
|
|
|
int (CEF_CALLBACK *release)(struct _cef_base_t* self);
|
|
|
|
// Returns the current number of references.
|
|
|
|
int (CEF_CALLBACK *get_refct)(struct _cef_base_t* self);
|
|
|
|
|
|
|
|
} cef_base_t;
|
|
|
|
|
|
|
|
|
|
|
|
// Check that the structure |s|, which is defined with a cef_base_t member named
|
|
|
|
// |base|, is large enough to contain the specified member |f|.
|
|
|
|
#define CEF_MEMBER_EXISTS(s, f) \
|
2011-10-24 22:20:52 +02:00
|
|
|
((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= (s)->base.size)
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Implement this structure for task execution. The functions of this structure
|
|
|
|
// may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_task_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Method that will be executed. |threadId| is the thread executing the call.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *execute)(struct _cef_task_t* self,
|
|
|
|
cef_thread_id_t threadId);
|
|
|
|
|
|
|
|
} cef_task_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
// Structure to implement for visiting cookie values. The functions of this
|
|
|
|
// structure will always be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
typedef struct _cef_cookie_visitor_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
// Method that will be called once for each cookie. |count| is the 0-based
|
|
|
|
// index for the current cookie. |total| is the total number of cookies. Set
|
|
|
|
// |deleteCookie| to true (1) to delete the cookie currently being visited.
|
|
|
|
// Return false (0) to stop visiting cookies. This function may never be
|
|
|
|
// called if no cookies are found.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self,
|
|
|
|
const struct _cef_cookie_t* cookie, int count, int total,
|
|
|
|
int* deleteCookie);
|
|
|
|
|
|
|
|
} cef_cookie_visitor_t;
|
|
|
|
|
|
|
|
|
2011-10-06 15:34:47 +02:00
|
|
|
///
|
|
|
|
// Structure to implement for visiting storage. The functions of this structure
|
|
|
|
// will always be called on the UI thread.
|
|
|
|
///
|
|
|
|
typedef struct _cef_storage_visitor_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Method that will be called once for each key/value data pair in storage.
|
|
|
|
// |count| is the 0-based index for the current pair. |total| is the total
|
|
|
|
// number of pairs. Set |deleteData| to true (1) to delete the pair currently
|
|
|
|
// being visited. Return false (0) to stop visiting pairs. This function may
|
|
|
|
// never be called if no data is found.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *visit)(struct _cef_storage_visitor_t* self,
|
|
|
|
enum cef_storage_type_t type, const cef_string_t* origin,
|
|
|
|
const cef_string_t* key, const cef_string_t* value, int count, int total,
|
|
|
|
int* deleteData);
|
|
|
|
|
|
|
|
} cef_storage_visitor_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to represent a browser window. The functions of this structure
|
|
|
|
// may be called on any thread unless otherwise indicated in the comments.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_browser_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-08-03 17:35:51 +02:00
|
|
|
///
|
|
|
|
// Call this function before destroying a contained browser window. This
|
|
|
|
// function performs any internal cleanup that may be needed before the
|
|
|
|
// browser window is destroyed.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *parent_window_will_close)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-08 02:07:47 +01:00
|
|
|
// Closes this browser window.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-08 02:07:47 +01:00
|
|
|
void (CEF_CALLBACK *close_browser)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true (1) if the browser can navigate backwards.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:47:44 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Navigate backwards.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true (1) if the browser can navigate forwards.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-03 17:35:51 +02:00
|
|
|
// Navigate forwards.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Reload the current page.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *reload)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Reload the current page ignoring any cached data.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Stop loading the page.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Set focus for the browser window. If |enable| is true (1) focus will be set
|
|
|
|
// to the window. Otherwise, focus will be removed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *set_focus)(struct _cef_browser_t* self, int enable);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Retrieve the window handle for this browser.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
cef_window_handle_t (CEF_CALLBACK *get_window_handle)(
|
|
|
|
struct _cef_browser_t* self);
|
|
|
|
|
2011-06-14 17:09:55 +02:00
|
|
|
///
|
|
|
|
// Retrieve the window handle of the browser that opened this browser. Will
|
|
|
|
// return NULL for non-popup windows. This function can be used in combination
|
|
|
|
// with custom handling of modal windows.
|
|
|
|
///
|
|
|
|
cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)(
|
|
|
|
struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:47:44 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true (1) if the window is a popup window.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self);
|
|
|
|
|
2011-08-30 18:20:27 +02:00
|
|
|
// Returns true (1) if a document has been loaded in the browser.
|
|
|
|
int (CEF_CALLBACK *has_document)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Returns the client for this browser.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_client_t* (CEF_CALLBACK *get_client)(struct _cef_browser_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns the main (top-level) frame for the browser window.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)(
|
|
|
|
struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Returns the focused frame for the browser window. This function should only
|
|
|
|
// be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)(
|
|
|
|
struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Returns the frame with the specified name, or NULL if not found. This
|
|
|
|
// function should only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* name);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Returns the names of all existing frames. This function should only be
|
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self,
|
|
|
|
cef_string_list_t names);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Search for |searchText|. |identifier| can be used to have multiple searches
|
|
|
|
// running simultaniously. |forward| indicates whether to search forward or
|
|
|
|
// backward within the page. |matchCase| indicates whether the search should
|
|
|
|
// be case-sensitive. |findNext| indicates whether this is the first request
|
|
|
|
// or a follow-up.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *find)(struct _cef_browser_t* self, int identifier,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* searchText, int forward, int matchCase,
|
|
|
|
int findNext);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Cancel all searches that are currently going on.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *stop_finding)(struct _cef_browser_t* self,
|
|
|
|
int clearSelection);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 16:34:50 +01:00
|
|
|
// Get the zoom level.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 16:34:50 +01:00
|
|
|
double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 16:34:50 +01:00
|
|
|
// Change the zoom level to the specified value.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 16:34:50 +01:00
|
|
|
void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_t* self,
|
|
|
|
double zoomLevel);
|
|
|
|
|
2011-10-04 13:49:36 +02:00
|
|
|
///
|
|
|
|
// Clear the back/forward browsing history.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *clear_history)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 19:37:27 +01:00
|
|
|
// Open developer tools in its own window.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 19:37:27 +01:00
|
|
|
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 19:37:27 +01:00
|
|
|
// Explicitly close the developer tools window if one exists for this browser
|
|
|
|
// instance.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-25 19:37:27 +01:00
|
|
|
void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Returns true (1) if window rendering is disabled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
int (CEF_CALLBACK *is_window_rendering_disabled)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Get the size of the specified element. This function should only be called
|
|
|
|
// on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
int (CEF_CALLBACK *get_size)(struct _cef_browser_t* self,
|
|
|
|
enum cef_paint_element_type_t type, int* width, int* height);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Set the size of the specified element. This function is only used when
|
|
|
|
// window rendering is disabled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *set_size)(struct _cef_browser_t* self,
|
|
|
|
enum cef_paint_element_type_t type, int width, int height);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Returns true (1) if a popup is currently visible. This function should only
|
|
|
|
// be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
int (CEF_CALLBACK *is_popup_visible)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Hide the currently visible popup, if any.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *hide_popup)(struct _cef_browser_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Invalidate the |dirtyRect| region of the view. This function is only used
|
|
|
|
// when window rendering is disabled and will result in a call to
|
2011-05-20 16:42:25 +02:00
|
|
|
// HandlePaint().
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *invalidate)(struct _cef_browser_t* self,
|
|
|
|
const cef_rect_t* dirtyRect);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Get the raw image data contained in the specified element without
|
|
|
|
// performing validation. The specified |width| and |height| dimensions must
|
|
|
|
// match the current element size. On Windows |buffer| must be width*height*4
|
|
|
|
// bytes in size and represents a BGRA image with an upper-left origin. This
|
|
|
|
// function should only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
int (CEF_CALLBACK *get_image)(struct _cef_browser_t* self,
|
|
|
|
enum cef_paint_element_type_t type, int width, int height,
|
|
|
|
void* buffer);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Send a key event to the browser.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *send_key_event)(struct _cef_browser_t* self,
|
|
|
|
enum cef_key_type_t type, int key, int modifiers, int sysChar,
|
|
|
|
int imeChar);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Send a mouse click event to the browser. The |x| and |y| coordinates are
|
|
|
|
// relative to the upper-left corner of the view.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_t* self,
|
|
|
|
int x, int y, enum cef_mouse_button_type_t type, int mouseUp,
|
|
|
|
int clickCount);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Send a mouse move event to the browser. The |x| and |y| coordinates are
|
|
|
|
// relative to the upper-left corner of the view.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_t* self, int x,
|
|
|
|
int y, int mouseLeave);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
|
|
|
|
// relative to the upper-left corner of the view.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_t* self,
|
|
|
|
int x, int y, int delta);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Send a focus event to the browser.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_t* self,
|
|
|
|
int setFocus);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Send a capture lost event to the browser.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
void (CEF_CALLBACK *send_capture_lost_event)(struct _cef_browser_t* self);
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
} cef_browser_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Create a new browser window using the window parameters specified by
|
|
|
|
// |windowInfo|. All values will be copied internally and the actual window will
|
2011-05-20 16:42:25 +02:00
|
|
|
// be created on the UI thread. This function call will not block.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo,
|
|
|
|
struct _cef_client_t* client, const cef_string_t* url,
|
|
|
|
const struct _cef_browser_settings_t* settings);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Create a new browser window using the window parameters specified by
|
2011-05-20 16:42:25 +02:00
|
|
|
// |windowInfo|. This function should only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo,
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_client_t* client, const cef_string_t* url,
|
|
|
|
const struct _cef_browser_settings_t* settings);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to represent a frame in the browser window. The functions of
|
|
|
|
// this structure may be called on any thread unless otherwise indicated in the
|
|
|
|
// comments.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_frame_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute undo in this frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *undo)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute redo in this frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *redo)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute cut in this frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *cut)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute copy in this frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *copy)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute paste in this frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *paste)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute delete in this frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *del)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute select all in this frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute printing in the this frame. The user will be prompted with the
|
|
|
|
// print dialog appropriate to the operating system.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *print)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Save this frame's HTML source to a temporary file and open it in the
|
|
|
|
// default text viewing application.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Returns this frame's HTML source as a string. This function should only be
|
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_source)(struct _cef_frame_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Returns this frame's display text as a string. This function should only be
|
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_text)(struct _cef_frame_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Load the request represented by the |request| object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self,
|
|
|
|
struct _cef_request_t* request);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Load the specified |url|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self,
|
|
|
|
const cef_string_t* url);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Load the contents of |string| with the optional dummy target |url|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* string, const cef_string_t* url);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Load the contents of |stream| with the optional dummy target |url|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *load_stream)(struct _cef_frame_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
struct _cef_stream_reader_t* stream, const cef_string_t* url);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Execute a string of JavaScript code in this frame. The |script_url|
|
|
|
|
// parameter is the URL where the script in question can be found, if any. The
|
|
|
|
// renderer may request this URL to show the developer the source of the
|
|
|
|
// error. The |start_line| parameter is the base line number to use for error
|
|
|
|
// reporting.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* jsCode, const cef_string_t* scriptUrl,
|
|
|
|
int startLine);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true (1) if this is the main frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Returns true (1) if this is the focused frame. This function should only be
|
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns this frame's name.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Returns the URL currently loaded in this frame. This function should only
|
|
|
|
// be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Returns the browser that this frame belongs to.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Visit the DOM document.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self,
|
|
|
|
struct _cef_domvisitor_t* visitor);
|
|
|
|
|
2011-10-28 22:30:19 +02:00
|
|
|
///
|
|
|
|
// Get the V8 context associated with the frame. This function should only be
|
|
|
|
// called on the UI thread.
|
|
|
|
///
|
|
|
|
struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)(
|
|
|
|
struct _cef_frame_t* self);
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
} cef_frame_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to browser life span. The
|
|
|
|
// functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_life_span_handler_t
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called before a new popup window is created. The |parentBrowser| parameter
|
|
|
|
// will point to the parent browser window. The |popupFeatures| parameter will
|
|
|
|
// contain information about the style of popup window requested. Return false
|
|
|
|
// (0) to have the framework create the new popup window based on the
|
|
|
|
// parameters in |windowInfo|. Return true (1) to cancel creation of the popup
|
|
|
|
// window. By default, a newly created popup window will have the same client
|
|
|
|
// and settings as the parent window. To change the client for the new window
|
|
|
|
// modify the object that |client| points to. To change the settings for the
|
|
|
|
// new window modify the |settings| structure.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
|
|
|
|
struct _cef_browser_t* parentBrowser,
|
2010-11-18 22:05:25 +01:00
|
|
|
const struct _cef_popup_features_t* popupFeatures,
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_window_info_t* windowInfo, const cef_string_t* url,
|
|
|
|
struct _cef_client_t** client,
|
2010-11-18 22:05:25 +01:00
|
|
|
struct _cef_browser_settings_t* settings);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called after a new window is created.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser);
|
2011-03-24 21:36:47 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-03 17:35:51 +02:00
|
|
|
// Called when a modal window is about to display and the modal loop should
|
|
|
|
// begin running. Return false (0) to use the default modal loop
|
|
|
|
// implementation or true (1) to use a custom implementation.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-03 17:35:51 +02:00
|
|
|
int (CEF_CALLBACK *run_modal)(struct _cef_life_span_handler_t* self,
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_browser_t* browser);
|
|
|
|
|
2011-06-14 17:09:55 +02:00
|
|
|
///
|
2011-08-03 17:35:51 +02:00
|
|
|
// Called when a window has recieved a request to close. Return false (0) to
|
|
|
|
// proceed with the window close or true (1) to cancel the window close. If
|
|
|
|
// this is a modal window and a custom modal loop implementation was provided
|
|
|
|
// in run_modal() this callback should be used to restore the opener window to
|
|
|
|
// a usable state.
|
2011-06-14 17:09:55 +02:00
|
|
|
///
|
2011-08-03 17:35:51 +02:00
|
|
|
int (CEF_CALLBACK *do_close)(struct _cef_life_span_handler_t* self,
|
2011-06-14 17:09:55 +02:00
|
|
|
struct _cef_browser_t* browser);
|
|
|
|
|
|
|
|
///
|
2011-08-03 17:35:51 +02:00
|
|
|
// Called just before a window is closed. If this is a modal window and a
|
|
|
|
// custom modal loop implementation was provided in run_modal() this callback
|
|
|
|
// should be used to exit the custom modal loop.
|
2011-06-14 17:09:55 +02:00
|
|
|
///
|
2011-08-03 17:35:51 +02:00
|
|
|
void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self,
|
2011-06-14 17:09:55 +02:00
|
|
|
struct _cef_browser_t* browser);
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
} cef_life_span_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to browser load status. The
|
|
|
|
// functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_load_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser begins loading a frame. The |frame| value will
|
|
|
|
// never be NULL -- call the is_main() function to check if this frame is the
|
|
|
|
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
|
|
|
// start or continue loading after the main frame load has ended. This
|
|
|
|
// function may not be called for a particular frame if the load request for
|
|
|
|
// that frame fails.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser is done loading a frame. The |frame| value will
|
|
|
|
// never be NULL -- call the is_main() function to check if this frame is the
|
|
|
|
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
|
|
|
// start or continue loading after the main frame load has ended. This
|
|
|
|
// function will always be called for all frames irrespective of whether the
|
|
|
|
// request completes successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self,
|
2011-01-12 00:46:14 +01:00
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
2011-03-08 20:33:18 +01:00
|
|
|
int httpStatusCode);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser fails to load a resource. |errorCode| is the error
|
|
|
|
// code number and |failedUrl| is the URL that failed to load. To provide
|
|
|
|
// custom error text assign the text to |errorText| and return true (1).
|
|
|
|
// Otherwise, return false (0) for the default error text. See
|
|
|
|
// net\base\net_error_list.h for complete descriptions of the error codes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
|
|
|
enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl,
|
|
|
|
cef_string_t* errorText);
|
|
|
|
|
|
|
|
} cef_load_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to browser requests. The
|
|
|
|
// functions of this structure will be called on the thread indicated.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_request_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-07-07 16:57:58 +02:00
|
|
|
// Called on the UI thread before browser navigation. Return true (1) to
|
2011-05-20 16:42:25 +02:00
|
|
|
// cancel the navigation or false (0) to allow the navigation to proceed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
|
|
|
struct _cef_request_t* request, enum cef_handler_navtype_t navType,
|
|
|
|
int isRedirect);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Called on the IO thread before a resource is loaded. To allow the resource
|
2011-05-20 16:42:25 +02:00
|
|
|
// to load normally return false (0). To redirect the resource to a new url
|
|
|
|
// populate the |redirectUrl| value and return false (0). To specify data for
|
|
|
|
// the resource return a CefStream object in |resourceStream|, use the
|
2011-04-21 20:17:46 +02:00
|
|
|
// |response| object to set mime type, HTTP status code and optional header
|
2011-05-20 16:42:25 +02:00
|
|
|
// values, and return false (0). To cancel loading of the resource return true
|
|
|
|
// (1). Any modifications to |request| will be observed. If the URL in
|
2011-04-21 20:17:46 +02:00
|
|
|
// |request| is changed and |redirectUrl| is also set, the URL in |request|
|
|
|
|
// will be used.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_before_resource_load)(
|
|
|
|
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_request_t* request, cef_string_t* redirectUrl,
|
2011-04-21 18:46:16 +02:00
|
|
|
struct _cef_stream_reader_t** resourceStream,
|
|
|
|
struct _cef_response_t* response, int loadFlags);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
// Called on the UI thread after a response to the resource request is
|
|
|
|
// received. Set |filter| if response content needs to be monitored and/or
|
|
|
|
// modified as it arrives.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-07-02 19:57:00 +02:00
|
|
|
void (CEF_CALLBACK *on_resource_response)(struct _cef_request_handler_t* self,
|
2011-05-24 01:39:07 +02:00
|
|
|
struct _cef_browser_t* browser, const cef_string_t* url,
|
|
|
|
struct _cef_response_t* response,
|
|
|
|
struct _cef_content_filter_t** filter);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Called on the IO thread to handle requests for URLs with an unknown
|
2011-05-20 16:42:25 +02:00
|
|
|
// protocol component. Return true (1) to indicate that the request should
|
|
|
|
// succeed because it was handled externally. Set |allowOSExecution| to true
|
|
|
|
// (1) and return false (0) to attempt execution via the registered OS
|
|
|
|
// protocol handler, if any. If false (0) is returned and either
|
2011-01-29 02:42:59 +01:00
|
|
|
// |allow_os_execution| is false (0) or OS protocol handler execution fails
|
|
|
|
// then the request will fail with an error condition. SECURITY WARNING: YOU
|
|
|
|
// SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR
|
|
|
|
// OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_protocol_execution)(struct _cef_request_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, const cef_string_t* url,
|
|
|
|
int* allowOSExecution);
|
2011-01-12 02:33:03 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Called on the UI thread when a server indicates via the 'Content-
|
|
|
|
// Disposition' header that a response represents a file to download.
|
|
|
|
// |mimeType| is the mime type for the download, |fileName| is the suggested
|
|
|
|
// target file name and |contentLength| is either the value of the 'Content-
|
|
|
|
// Size' header or -1 if no size was provided. Set |handler| to the
|
|
|
|
// cef_download_handler_t instance that will recieve the file contents. Return
|
2011-05-20 16:42:25 +02:00
|
|
|
// true (1) to download the file or false (0) to cancel the file download.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *get_download_handler)(struct _cef_request_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, const cef_string_t* mimeType,
|
|
|
|
const cef_string_t* fileName, int64 contentLength,
|
|
|
|
struct _cef_download_handler_t** handler);
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Called on the IO thread when the browser needs credentials from the user.
|
|
|
|
// |isProxy| indicates whether the host is a proxy server. |host| contains the
|
2011-05-20 16:42:25 +02:00
|
|
|
// hostname and port number. Set |username| and |password| and return true (1)
|
|
|
|
// to handle the request. Return false (0) to cancel the request.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, int isProxy, const cef_string_t* host,
|
2011-09-23 02:16:03 +02:00
|
|
|
int port, const cef_string_t* realm, const cef_string_t* scheme,
|
2011-05-20 16:42:25 +02:00
|
|
|
cef_string_t* username, cef_string_t* password);
|
|
|
|
|
|
|
|
} cef_request_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to browser display state.
|
|
|
|
// The functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_display_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the navigation state has changed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_nav_state_change)(struct _cef_display_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, int canGoBack, int canGoForward);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when a frame's address has changed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
|
|
|
const cef_string_t* url);
|
|
|
|
|
2011-10-21 16:09:04 +02:00
|
|
|
///
|
|
|
|
// Called when the size of the content area has changed.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *on_contents_size_change)(
|
|
|
|
struct _cef_display_handler_t* self, struct _cef_browser_t* browser,
|
|
|
|
struct _cef_frame_t* frame, int width, int height);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the page title changes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, const cef_string_t* title);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser is about to display a tooltip. |text| contains the
|
|
|
|
// text that will be displayed in the tooltip. To handle the display of the
|
|
|
|
// tooltip yourself return true (1). Otherwise, you can optionally modify
|
|
|
|
// |text| and then return false (0) to allow the browser to display the
|
|
|
|
// tooltip.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, cef_string_t* text);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser receives a status message. |text| contains the text
|
|
|
|
// that will be displayed in the status message and |type| indicates the
|
|
|
|
// status message type.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, const cef_string_t* value,
|
|
|
|
enum cef_handler_statustype_t type);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to display a console message. Return true (1) to stop the message
|
|
|
|
// from being output to the console.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, const cef_string_t* message,
|
|
|
|
const cef_string_t* source, int line);
|
|
|
|
|
|
|
|
} cef_display_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to focus. The functions of
|
|
|
|
// this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_focus_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser component is about to loose focus. For instance, if
|
|
|
|
// focus was on the last HTML element and the user pressed the TAB key. |next|
|
|
|
|
// will be true (1) if the browser is giving focus to the next component and
|
|
|
|
// false (0) if the browser is giving focus to the previous component.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, int next);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-10-07 12:30:10 +02:00
|
|
|
// Called when the browser component is requesting focus. |source| indicates
|
|
|
|
// where the focus request is originating from. Return false (0) to allow the
|
|
|
|
// focus to be set or true (1) to cancel setting the focus.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self,
|
2011-10-07 12:30:10 +02:00
|
|
|
struct _cef_browser_t* browser, enum cef_handler_focus_source_t source);
|
2011-05-20 16:42:25 +02:00
|
|
|
|
2011-10-14 14:40:40 +02:00
|
|
|
///
|
|
|
|
// Called when a new node in the the browser gets focus. The |node| value may
|
|
|
|
// be NULL if no specific node has gained focus. The node object passed to
|
|
|
|
// this function represents a snapshot of the DOM at the time this function is
|
|
|
|
// executed. DOM objects are only valid for the scope of this function. Do not
|
|
|
|
// keep references to or attempt to access any DOM objects outside the scope
|
|
|
|
// of this function.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *on_focused_node_changed)(
|
|
|
|
struct _cef_focus_handler_t* self, struct _cef_browser_t* browser,
|
|
|
|
struct _cef_frame_t* frame, struct _cef_domnode_t* node);
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
} cef_focus_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to keyboard input. The
|
|
|
|
// functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_keyboard_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-11-04 19:19:14 +01:00
|
|
|
// Called when the browser component receives a keyboard event. This function
|
|
|
|
// is called both before the event is passed to the renderer and after
|
|
|
|
// JavaScript in the page has had a chance to handle the event. |type| is the
|
|
|
|
// type of keyboard event, |code| is the windows scan-code for the event,
|
|
|
|
// |modifiers| is a set of bit- flags describing any pressed modifier keys and
|
|
|
|
// |isSystemKey| is true (1) if Windows considers this a 'system key' message
|
|
|
|
// (see http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx). If
|
|
|
|
// |isAfterJavaScript| is true (1) then JavaScript in the page has had a
|
|
|
|
// chance to handle the event and has chosen not to. Only RAWKEYDOWN, KEYDOWN
|
|
|
|
// and CHAR events will be sent with |isAfterJavaScript| set to true (1).
|
|
|
|
// Return true (1) if the keyboard event was handled or false (0) to allow
|
|
|
|
// continued handling of the event by the renderer.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, enum cef_handler_keyevent_type_t type,
|
2011-11-04 19:19:14 +01:00
|
|
|
int code, int modifiers, int isSystemKey, int isAfterJavaScript);
|
2011-05-20 16:42:25 +02:00
|
|
|
|
|
|
|
} cef_keyboard_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to browser context menus.
|
|
|
|
// The functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_menu_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called before a context menu is displayed. Return false (0) to display the
|
|
|
|
// default context menu or true (1) to cancel the display.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_before_menu)(struct _cef_menu_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser,
|
2010-10-03 23:04:50 +02:00
|
|
|
const struct _cef_handler_menuinfo_t* menuInfo);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to optionally override the default text for a context menu item.
|
|
|
|
// |label| contains the default text and may be modified to substitute
|
|
|
|
// alternate text.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *get_menu_label)(struct _cef_menu_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, enum cef_handler_menuid_t menuId,
|
|
|
|
cef_string_t* label);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when an option is selected from the default context menu. Return
|
|
|
|
// false (0) to execute the default action or true (1) to cancel the action.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_menu_action)(struct _cef_menu_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, enum cef_handler_menuid_t menuId);
|
|
|
|
|
|
|
|
} cef_menu_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to printing. The functions
|
|
|
|
// of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_print_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to allow customization of standard print options before the print
|
|
|
|
// dialog is displayed. |printOptions| allows specification of paper size,
|
|
|
|
// orientation and margins. Note that the specified margins may be adjusted if
|
|
|
|
// they are outside the range supported by the printer. All units are in
|
|
|
|
// inches. Return false (0) to display the default print options or true (1)
|
|
|
|
// to display the modified |printOptions|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *get_print_options)(struct _cef_print_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser,
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_print_options_t* printOptions);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to format print headers and footers. |printInfo| contains platform-
|
|
|
|
// specific information about the printer context. |url| is the URL if the
|
|
|
|
// currently printing page, |title| is the title of the currently printing
|
|
|
|
// page, |currentPage| is the current page number and |maxPages| is the total
|
|
|
|
// number of pages. Six default header locations are provided by the
|
|
|
|
// implementation: top left, top center, top right, bottom left, bottom center
|
|
|
|
// and bottom right. To use one of these default locations just assign a
|
|
|
|
// string to the appropriate variable. To draw the header and footer yourself
|
|
|
|
// return true (1). Otherwise, populate the approprate variables and return
|
|
|
|
// false (0).
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *get_print_header_footer)(struct _cef_print_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
|
|
|
const struct _cef_print_info_t* printInfo, const cef_string_t* url,
|
|
|
|
const cef_string_t* title, int currentPage, int maxPages,
|
|
|
|
cef_string_t* topLeft, cef_string_t* topCenter, cef_string_t* topRight,
|
|
|
|
cef_string_t* bottomLeft, cef_string_t* bottomCenter,
|
|
|
|
cef_string_t* bottomRight);
|
|
|
|
|
|
|
|
} cef_print_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to find results. The
|
|
|
|
// functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_find_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to report find results returned by cef_browser_t::find().
|
|
|
|
// |identifer| is the identifier passed to cef_browser_t::find(), |count| is
|
|
|
|
// the number of matches currently identified, |selectionRect| is the location
|
|
|
|
// of where the match was found (in window coordinates), |activeMatchOrdinal|
|
|
|
|
// is the current position in the search results, and |finalUpdate| is true
|
|
|
|
// (1) if this is the last find notification.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, int identifier, int count,
|
|
|
|
const cef_rect_t* selectionRect, int activeMatchOrdinal,
|
|
|
|
int finalUpdate);
|
|
|
|
|
|
|
|
} cef_find_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events related to JavaScript dialogs. The
|
|
|
|
// functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_jsdialog_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to run a JavaScript alert message. Return false (0) to display the
|
|
|
|
// default alert or true (1) if you displayed a custom alert.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_jsalert)(struct _cef_jsdialog_handler_t* self,
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* message);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to run a JavaScript confirm request. Return false (0) to display the
|
|
|
|
// default alert or true (1) if you displayed a custom alert. If you handled
|
|
|
|
// the alert set |retval| to true (1) if the user accepted the confirmation.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_jsconfirm)(struct _cef_jsdialog_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
|
|
|
const cef_string_t* message, int* retval);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to run a JavaScript prompt request. Return false (0) to display the
|
|
|
|
// default prompt or true (1) if you displayed a custom prompt. If you handled
|
|
|
|
// the prompt set |retval| to true (1) if the user accepted the prompt and
|
|
|
|
// request and |result| to the resulting value.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *on_jsprompt)(struct _cef_jsdialog_handler_t* self,
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* message, const cef_string_t* defaultValue,
|
|
|
|
int* retval, cef_string_t* result);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
} cef_jsdialog_handler_t;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-01-26 16:12:49 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle JavaScript binding. The functions of this
|
|
|
|
// structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_jsbinding_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called for adding values to a frame's JavaScript 'window' object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_jsbinding)(struct _cef_jsbinding_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
|
|
|
struct _cef_v8value_t* object);
|
|
|
|
|
|
|
|
} cef_jsbinding_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to handle events when window rendering is disabled.
|
|
|
|
// The functions of this structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_render_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to retrieve the view rectangle which is relative to screen
|
|
|
|
// coordinates. Return true (1) if the rectangle was provided.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, cef_rect_t* rect);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to retrieve the simulated screen rectangle. Return true (1) if the
|
2011-03-24 21:36:47 +01:00
|
|
|
// rectangle was provided.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *get_screen_rect)(struct _cef_render_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, cef_rect_t* rect);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to retrieve the translation from view coordinates to actual screen
|
|
|
|
// coordinates. Return true (1) if the screen coordinates were provided.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, int viewX, int viewY, int* screenX,
|
|
|
|
int* screenY);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser wants to show or hide the popup widget. The popup
|
|
|
|
// should be shown if |show| is true (1) and hidden if |show| is false (0).
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, int show);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser wants to move or resize the popup widget. |rect|
|
|
|
|
// contains the new location and size.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, const cef_rect_t* rect);
|
2011-03-24 21:36:47 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Called when an element should be painted. |type| indicates whether the
|
2011-05-20 16:42:25 +02:00
|
|
|
// element is the view or the popup widget. |buffer| contains the pixel data
|
|
|
|
// for the whole image. |dirtyRect| indicates the portion of the image that
|
|
|
|
// has been repainted. On Windows |buffer| will be width*height*4 bytes in
|
|
|
|
// size and represents a BGRA image with an upper-left origin.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
|
2011-03-24 21:36:47 +01:00
|
|
|
struct _cef_browser_t* browser, enum cef_paint_element_type_t type,
|
|
|
|
const cef_rect_t* dirtyRect, const void* buffer);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called when the browser window's cursor has changed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, cef_cursor_handle_t cursor);
|
|
|
|
|
|
|
|
} cef_render_handler_t;
|
|
|
|
|
|
|
|
|
2011-08-22 03:31:55 +02:00
|
|
|
///
|
|
|
|
// Implement this structure to handle events related to dragging. The functions
|
|
|
|
// of this structure will be called on the UI thread.
|
|
|
|
///
|
|
|
|
typedef struct _cef_drag_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Called when the browser window initiates a drag event. |dragData| contains
|
|
|
|
// the drag event data and |mask| represents the type of drag operation.
|
|
|
|
// Return false (0) for default drag handling behavior or true (1) to cancel
|
|
|
|
// the drag event.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *on_drag_start)(struct _cef_drag_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData,
|
|
|
|
enum cef_drag_operations_mask_t mask);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Called when an external drag event enters the browser window. |dragData|
|
|
|
|
// contains the drag event data and |mask| represents the type of drag
|
|
|
|
// operation. Return false (0) for default drag handling behavior or true (1)
|
|
|
|
// to cancel the drag event.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData,
|
|
|
|
enum cef_drag_operations_mask_t mask);
|
|
|
|
|
|
|
|
} cef_drag_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this structure to provide handler implementations.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef struct _cef_client_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for browser life span events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for browser load status events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for browser request events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for browser display state events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for focus events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for keyboard events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for context menu events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_menu_handler_t* (CEF_CALLBACK *get_menu_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for printing events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for find result events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for JavaScript dialog events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for JavaScript binding events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_jsbinding_handler_t* (CEF_CALLBACK *get_jsbinding_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Return the handler for off-screen rendering events.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)(
|
|
|
|
struct _cef_client_t* self);
|
2011-03-24 21:36:47 +01:00
|
|
|
|
2011-08-22 03:31:55 +02:00
|
|
|
///
|
|
|
|
// Return the handler for drag events.
|
|
|
|
///
|
|
|
|
struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)(
|
|
|
|
struct _cef_client_t* self);
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
} cef_client_t;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to represent a web request. The functions of this structure
|
|
|
|
// may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_request_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the fully qualified URL.
|
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the fully qualified URL.
|
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
void (CEF_CALLBACK *set_url)(struct _cef_request_t* self,
|
|
|
|
const cef_string_t* url);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the request function type. The value will default to POST if post data
|
|
|
|
// is provided and GET otherwise.
|
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the request function type.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *set_method)(struct _cef_request_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* method);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the post data.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)(
|
|
|
|
struct _cef_request_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the post data.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self,
|
|
|
|
struct _cef_post_data_t* postData);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the header values.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self,
|
2011-10-28 23:31:26 +02:00
|
|
|
cef_string_multimap_t headerMap);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the header values.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self,
|
2011-10-28 23:31:26 +02:00
|
|
|
cef_string_multimap_t headerMap);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Set all values at one time.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
|
|
|
|
const cef_string_t* method, struct _cef_post_data_t* postData,
|
2011-10-28 23:31:26 +02:00
|
|
|
cef_string_multimap_t headerMap);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the flags used in combination with cef_web_urlrequest_t.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
enum cef_weburlrequest_flags_t (CEF_CALLBACK *get_flags)(
|
|
|
|
struct _cef_request_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the flags used in combination with cef_web_urlrequest_t.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self,
|
|
|
|
enum cef_weburlrequest_flags_t flags);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the URL to the first party for cookies used in combination with
|
2011-02-09 23:04:35 +01:00
|
|
|
// cef_web_urlrequest_t.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)(
|
|
|
|
struct _cef_request_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Get the URL to the first party for cookies used in combination with
|
|
|
|
// cef_web_urlrequest_t.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self,
|
|
|
|
const cef_string_t* url);
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
} cef_request_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Create a new cef_request_t object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_request_t* cef_request_create();
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to represent post data for a web request. The functions of
|
|
|
|
// this structure may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_post_data_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns the number of existing post data elements.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Retrieve the post data elements.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_post_data_element_t* (CEF_CALLBACK *get_elements)(
|
|
|
|
struct _cef_post_data_t* self, int elementIndex);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Remove the specified post data element. Returns true (1) if the removal
|
|
|
|
// succeeds.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self,
|
|
|
|
struct _cef_post_data_element_t* element);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Add the specified post data element. Returns true (1) if the add succeeds.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self,
|
|
|
|
struct _cef_post_data_element_t* element);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Remove all existing post data elements.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self);
|
|
|
|
|
|
|
|
} cef_post_data_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Create a new cef_post_data_t object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_post_data_t* cef_post_data_create();
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to represent a single element in the request post data. The
|
|
|
|
// functions of this structure may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_post_data_element_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Remove all contents from the post data element.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// The post data element will represent a file.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* fileName);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// The post data element will represent bytes. The bytes passed in will be
|
|
|
|
// copied.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self,
|
|
|
|
size_t size, const void* bytes);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the type of this post data element.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
enum cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
|
|
|
|
struct _cef_post_data_element_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the file name.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_file)(
|
|
|
|
struct _cef_post_data_element_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the number of bytes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Read up to |size| bytes into |bytes| and return the number of bytes
|
|
|
|
// actually read.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self,
|
|
|
|
size_t size, void* bytes);
|
|
|
|
|
|
|
|
} cef_post_data_element_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-12-07 02:30:26 +01:00
|
|
|
// Create a new cef_post_data_element_t object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Structure used to represent a web response. The functions of this structure
|
|
|
|
// may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
typedef struct _cef_response_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the response status code.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
int (CEF_CALLBACK *get_status)(struct _cef_response_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the response status code.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status);
|
2011-02-09 23:04:35 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the response status text.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_status_text)(
|
|
|
|
struct _cef_response_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the response status text.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self,
|
|
|
|
const cef_string_t* statusText);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the response mime type.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
|
|
|
|
struct _cef_response_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set the response mime type.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self,
|
|
|
|
const cef_string_t* mimeType);
|
2011-02-09 23:04:35 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the value for the specified response header field.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self,
|
|
|
|
const cef_string_t* name);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get all response header fields.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self,
|
2011-10-28 23:31:26 +02:00
|
|
|
cef_string_multimap_t headerMap);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Set all response header fields.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self,
|
2011-10-28 23:31:26 +02:00
|
|
|
cef_string_multimap_t headerMap);
|
2011-02-09 23:04:35 +01:00
|
|
|
|
|
|
|
} cef_response_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure the client can implement to provide a custom stream reader. The
|
|
|
|
// functions of this structure may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_read_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Read raw binary data.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
size_t (CEF_CALLBACK *read)(struct _cef_read_handler_t* self, void* ptr,
|
|
|
|
size_t size, size_t n);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
|
|
|
// SEEK_END or SEEK_SET.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, long offset,
|
|
|
|
int whence);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the current offset position.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
long (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return non-zero if at end of file.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self);
|
|
|
|
|
|
|
|
} cef_read_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to read data from a stream. The functions of this structure
|
|
|
|
// may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_stream_reader_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Read raw binary data.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
size_t (CEF_CALLBACK *read)(struct _cef_stream_reader_t* self, void* ptr,
|
|
|
|
size_t size, size_t n);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
|
|
|
// SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, long offset,
|
|
|
|
int whence);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the current offset position.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
long (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return non-zero if at end of file.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self);
|
|
|
|
|
|
|
|
} cef_stream_reader_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new cef_stream_reader_t object from a file.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file(
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* fileName);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_stream_reader_t object from data.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data,
|
|
|
|
size_t size);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_stream_reader_t object from a custom handler.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler(
|
|
|
|
cef_read_handler_t* handler);
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure the client can implement to provide a custom stream writer. The
|
|
|
|
// functions of this structure may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_write_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Write raw binary data.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
size_t (CEF_CALLBACK *write)(struct _cef_write_handler_t* self,
|
|
|
|
const void* ptr, size_t size, size_t n);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
|
|
|
// SEEK_END or SEEK_SET.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, long offset,
|
|
|
|
int whence);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the current offset position.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
long (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Flush the stream.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self);
|
|
|
|
|
|
|
|
} cef_write_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to write data to a stream. The functions of this structure may
|
|
|
|
// be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_stream_writer_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Write raw binary data.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
size_t (CEF_CALLBACK *write)(struct _cef_stream_writer_t* self,
|
|
|
|
const void* ptr, size_t size, size_t n);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
|
|
|
|
// SEEK_END or SEEK_SET.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, long offset,
|
|
|
|
int whence);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the current offset position.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
long (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Flush the stream.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self);
|
|
|
|
|
|
|
|
} cef_stream_writer_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new cef_stream_writer_t object for a file.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file(
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* fileName);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_stream_writer_t object for a custom handler.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler(
|
|
|
|
cef_write_handler_t* handler);
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Structure that encapsulates a V8 context handle.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
typedef struct _cef_v8context_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Returns the browser for this context.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
|
|
|
|
struct _cef_v8context_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Returns the frame for this context.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_v8context_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Returns the global object for this context.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
struct _cef_v8value_t* (CEF_CALLBACK *get_global)(
|
|
|
|
struct _cef_v8context_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Enter this context. A context must be explicitly entered before creating a
|
|
|
|
// V8 Object, Array or Function asynchronously. exit() must be called the same
|
|
|
|
// number of times as enter() before releasing this context. V8 objects belong
|
|
|
|
// to the context in which they are created. Returns true (1) if the scope was
|
|
|
|
// entered successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
int (CEF_CALLBACK *enter)(struct _cef_v8context_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Exit this context. Call this function only after calling enter(). Returns
|
|
|
|
// true (1) if the scope was exited successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
int (CEF_CALLBACK *exit)(struct _cef_v8context_t* self);
|
|
|
|
|
2011-02-21 23:44:06 +01:00
|
|
|
} cef_v8context_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Returns the current (top) context object in the V8 context stack.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context();
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Returns the entered (bottom) context object in the V8 context stack.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context();
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure that should be implemented to handle V8 function calls. The
|
|
|
|
// functions of this structure will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_v8handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Execute with the specified argument list and return value. Return true (1)
|
|
|
|
// if the function was handled. To invoke V8 callback functions outside the
|
|
|
|
// scope of this function you need to keep references to the current V8
|
|
|
|
// context (cef_v8context_t) along with any necessary callback objects.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *execute)(struct _cef_v8handler_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* name, struct _cef_v8value_t* object,
|
|
|
|
size_t argumentCount, struct _cef_v8value_t* const* arguments,
|
|
|
|
struct _cef_v8value_t** retval, cef_string_t* exception);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
} cef_v8handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Structure that should be implemented to handle V8 accessor calls. Accessor
|
|
|
|
// identifiers are registered by calling cef_v8value_t::set_value(). The
|
|
|
|
// functions of this structure will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
typedef struct _cef_v8accessor_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Called to get an accessor value. |name| is the name of the property being
|
|
|
|
// accessed. |object| is the This() object from V8's AccessorInfo structure.
|
|
|
|
// |retval| is the value to return for this property. Return true (1) if
|
|
|
|
// handled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
int (CEF_CALLBACK *get)(struct _cef_v8accessor_t* self,
|
|
|
|
const cef_string_t* name, struct _cef_v8value_t* object,
|
2011-09-20 22:41:54 +02:00
|
|
|
struct _cef_v8value_t** retval, cef_string_t* exception);
|
2011-04-07 03:58:49 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Called to set an accessor value. |name| is the name of the property being
|
|
|
|
// accessed. |value| is the new value being assigned to this property.
|
|
|
|
// |object| is the This() object from V8's AccessorInfo structure. Return true
|
|
|
|
// (1) if handled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
int (CEF_CALLBACK *set)(struct _cef_v8accessor_t* self,
|
|
|
|
const cef_string_t* name, struct _cef_v8value_t* object,
|
2011-09-20 22:41:54 +02:00
|
|
|
struct _cef_v8value_t* value, cef_string_t* exception);
|
2011-04-07 03:58:49 +02:00
|
|
|
|
|
|
|
} cef_v8accessor_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure representing a V8 value. The functions of this structure should
|
|
|
|
// only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_v8value_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is undefined.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_undefined)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is null.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_null)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is bool.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_bool)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is int.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_int)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is double.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_double)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is Date.
|
|
|
|
///
|
2011-05-23 19:43:53 +02:00
|
|
|
int (CEF_CALLBACK *is_date)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is string.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_string)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is object.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_object)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is array.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_array)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// True if the value type is function.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *is_function)(struct _cef_v8value_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Returns true (1) if this object is pointing to the same handle as |that|
|
|
|
|
// object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
int (CEF_CALLBACK *is_same)(struct _cef_v8value_t* self,
|
|
|
|
struct _cef_v8value_t* that);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Return a bool value. The underlying data will be converted to if
|
|
|
|
// necessary.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Return an int value. The underlying data will be converted to if
|
|
|
|
// necessary.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Return a double value. The underlying data will be converted to if
|
|
|
|
// necessary.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Return a Date value. The underlying data will be converted to if
|
|
|
|
// necessary.
|
|
|
|
///
|
2011-05-23 19:43:53 +02:00
|
|
|
cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Return a string value. The underlying data will be converted to if
|
|
|
|
// necessary.
|
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_string_value)(
|
|
|
|
struct _cef_v8value_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
// OBJECT METHODS - These functions are only available on objects. Arrays and
|
|
|
|
// functions are also objects. String- and integer-based keys can be used
|
|
|
|
// interchangably with the framework converting between them as necessary.
|
|
|
|
// Keys beginning with "Cef::" and "v8::" are reserved by the system.
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true (1) if the object has a value with the specified identifier.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *has_value_bykey)(struct _cef_v8value_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* key);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Returns true (1) if the object has a value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, int index);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Delete the value with the specified identifier.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* key);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Delete the value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self,
|
|
|
|
int index);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns the value with the specified identifier.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_v8value_t* (CEF_CALLBACK *get_value_bykey)(
|
2010-11-22 18:49:46 +01:00
|
|
|
struct _cef_v8value_t* self, const cef_string_t* key);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Returns the value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)(
|
|
|
|
struct _cef_v8value_t* self, int index);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Associate a value with the specified identifier.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *set_value_bykey)(struct _cef_v8value_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* key, struct _cef_v8value_t* value);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Associate a value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index,
|
|
|
|
struct _cef_v8value_t* value);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Register an identifier whose access will be forwarded to the
|
|
|
|
// cef_v8accessor_t instance passed to
|
|
|
|
// cef_v8value_t::cef_v8value_create_object_with_accessor().
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
int (CEF_CALLBACK *set_value_byaccessor)(struct _cef_v8value_t* self,
|
|
|
|
const cef_string_t* key, enum cef_v8_accesscontrol_t settings,
|
|
|
|
enum cef_v8_propertyattribute_t attribute);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Read the keys for the object's values into the specified vector. Integer-
|
|
|
|
// based keys will also be returned as strings.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *get_keys)(struct _cef_v8value_t* self,
|
|
|
|
cef_string_list_t keys);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns the user data, if any, specified when the object was created.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_base_t* (CEF_CALLBACK *get_user_data)(
|
|
|
|
struct _cef_v8value_t* self);
|
|
|
|
|
|
|
|
|
|
|
|
// ARRAY METHODS - These functions are only available on arrays.
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns the number of elements in the array.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *get_array_length)(struct _cef_v8value_t* self);
|
|
|
|
|
|
|
|
|
|
|
|
// FUNCTION METHODS - These functions are only available on functions.
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns the function name.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_function_name)(
|
|
|
|
struct _cef_v8value_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns the function handler or NULL if not a CEF-created function.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_v8handler_t* (CEF_CALLBACK *get_function_handler)(
|
|
|
|
struct _cef_v8value_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Execute the function using the current V8 context.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *execute_function)(struct _cef_v8value_t* self,
|
|
|
|
struct _cef_v8value_t* object, size_t argumentCount,
|
|
|
|
struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval,
|
|
|
|
cef_string_t* exception);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Execute the function using the specified V8 context.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
int (CEF_CALLBACK *execute_function_with_context)(struct _cef_v8value_t* self,
|
|
|
|
struct _cef_v8context_t* context, struct _cef_v8value_t* object,
|
|
|
|
size_t argumentCount, struct _cef_v8value_t* const* arguments,
|
|
|
|
struct _cef_v8value_t** retval, cef_string_t* exception);
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
} cef_v8value_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type undefined.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined();
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type null.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_null();
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type bool.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type int.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type double.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type Date.
|
|
|
|
///
|
2011-05-23 19:43:53 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type string.
|
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type object.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_base_t* user_data);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type object with accessors.
|
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_object_with_accessor(
|
|
|
|
cef_base_t* user_data, cef_v8accessor_t* accessor);
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type array.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_array();
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Create a new cef_v8value_t object of type function.
|
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name,
|
2010-10-03 23:04:50 +02:00
|
|
|
cef_v8handler_t* handler);
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure that creates cef_scheme_handler_t instances. The functions of this
|
|
|
|
// structure will always be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_scheme_handler_factory_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-10-07 12:13:04 +02:00
|
|
|
// Return a new scheme handler instance to handle the request. |browser| will
|
|
|
|
// be the browser window that initiated the request. If the request was
|
|
|
|
// initiated using the cef_web_urlrequest_t API |browser| will be NULL.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
struct _cef_scheme_handler_t* (CEF_CALLBACK *create)(
|
2011-05-27 18:20:32 +02:00
|
|
|
struct _cef_scheme_handler_factory_t* self,
|
2011-10-07 12:13:04 +02:00
|
|
|
struct _cef_browser_t* browser, const cef_string_t* scheme_name,
|
|
|
|
struct _cef_request_t* request);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
} cef_scheme_handler_factory_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-17 03:55:07 +02:00
|
|
|
// Structure used to facilitate asynchronous responses to custom scheme handler
|
|
|
|
// requests. The functions of this structure may be called on any thread.
|
|
|
|
///
|
|
|
|
typedef struct _cef_scheme_handler_callback_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Notify that header information is now available for retrieval.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *headers_available)(
|
|
|
|
struct _cef_scheme_handler_callback_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Notify that response data is now available for reading.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *bytes_available)(
|
|
|
|
struct _cef_scheme_handler_callback_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Cancel processing of the request.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_callback_t* self);
|
|
|
|
|
|
|
|
} cef_scheme_handler_callback_t;
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
// Structure used to implement a custom scheme handler structure. The functions
|
2011-01-29 02:42:59 +01:00
|
|
|
// of this structure will always be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef struct _cef_scheme_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-17 03:55:07 +02:00
|
|
|
// Begin processing the request. To handle the request return true (1) and
|
|
|
|
// call headers_available() once the response header information is available
|
|
|
|
// (headers_available() can also be called from inside this function if header
|
|
|
|
// information is available immediately). To redirect the request to a new URL
|
|
|
|
// set |redirectUrl| to the new URL and return true (1). To cancel the request
|
|
|
|
// return false (0).
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *process_request)(struct _cef_scheme_handler_t* self,
|
2011-04-21 20:17:46 +02:00
|
|
|
struct _cef_request_t* request, cef_string_t* redirectUrl,
|
2011-08-17 03:55:07 +02:00
|
|
|
struct _cef_scheme_handler_callback_t* callback);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-17 03:55:07 +02:00
|
|
|
// Retrieve response header information. If the response length is not known
|
|
|
|
// set |response_length| to -1 and read_response() will be called until it
|
|
|
|
// returns false (0). If the response length is known set |response_length| to
|
|
|
|
// a positive value and read_response() will be called until it returns false
|
|
|
|
// (0) or the specified number of bytes have been read. Use the |response|
|
|
|
|
// object to set the mime type, http status code and other optional header
|
|
|
|
// values.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-17 03:55:07 +02:00
|
|
|
void (CEF_CALLBACK *get_response_headers)(struct _cef_scheme_handler_t* self,
|
|
|
|
struct _cef_response_t* response, int64* response_length);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-17 03:55:07 +02:00
|
|
|
// Read response data. If data is available immediately copy up to
|
|
|
|
// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
|
|
|
|
// bytes copied, and return true (1). To read the data at a later time set
|
|
|
|
// |bytes_read| to 0, return true (1) and call bytes_available() when the data
|
|
|
|
// is available. To indicate response completion return false (0).
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
int (CEF_CALLBACK *read_response)(struct _cef_scheme_handler_t* self,
|
2011-08-17 03:55:07 +02:00
|
|
|
void* data_out, int bytes_to_read, int* bytes_read,
|
|
|
|
struct _cef_scheme_handler_callback_t* callback);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Request processing has been canceled.
|
|
|
|
///
|
|
|
|
void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_t* self);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
} cef_scheme_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Structure used to handle file downloads. The functions of this structure will
|
|
|
|
// always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
typedef struct _cef_download_handler_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
// A portion of the file contents have been received. This function will be
|
|
|
|
// called multiple times until the download is complete. Return |true (1)| to
|
|
|
|
// continue receiving data and |false (0)| to cancel.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
int (CEF_CALLBACK *received_data)(struct _cef_download_handler_t* self,
|
|
|
|
void* data, int data_size);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
// The download is complete.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
void (CEF_CALLBACK *complete)(struct _cef_download_handler_t* self);
|
|
|
|
|
|
|
|
} cef_download_handler_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Structure used to make a Web URL request. Web URL requests are not associated
|
2011-05-20 16:42:25 +02:00
|
|
|
// with a browser instance so no cef_client_t callbacks will be executed. The
|
2011-02-09 23:04:35 +01:00
|
|
|
// functions of this structure may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
typedef struct _cef_web_urlrequest_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Cancels the request.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *cancel)(struct _cef_web_urlrequest_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Returns the current ready state of the request.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
enum cef_weburlrequest_state_t (CEF_CALLBACK *get_state)(
|
|
|
|
struct _cef_web_urlrequest_t* self);
|
|
|
|
|
|
|
|
} cef_web_urlrequest_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefWebUrlRequest object.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create(
|
|
|
|
cef_request_t* request, struct _cef_web_urlrequest_client_t* client);
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Structure that should be implemented by the cef_web_urlrequest_t client. The
|
|
|
|
// functions of this structure will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
typedef struct _cef_web_urlrequest_client_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Notifies the client that the request state has changed. State change
|
|
|
|
// notifications will always be sent before the below notification functions
|
|
|
|
// are called.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *on_state_change)(
|
|
|
|
struct _cef_web_urlrequest_client_t* self,
|
|
|
|
struct _cef_web_urlrequest_t* requester,
|
|
|
|
enum cef_weburlrequest_state_t state);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Notifies the client that the request has been redirected and provides a
|
|
|
|
// chance to change the request parameters.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *on_redirect)(struct _cef_web_urlrequest_client_t* self,
|
|
|
|
struct _cef_web_urlrequest_t* requester, struct _cef_request_t* request,
|
|
|
|
struct _cef_response_t* response);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Notifies the client of the response data.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *on_headers_received)(
|
|
|
|
struct _cef_web_urlrequest_client_t* self,
|
|
|
|
struct _cef_web_urlrequest_t* requester,
|
|
|
|
struct _cef_response_t* response);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Notifies the client of the upload progress.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *on_progress)(struct _cef_web_urlrequest_client_t* self,
|
|
|
|
struct _cef_web_urlrequest_t* requester, uint64 bytesSent,
|
|
|
|
uint64 totalBytesToBeSent);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Notifies the client that content has been received.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *on_data)(struct _cef_web_urlrequest_client_t* self,
|
|
|
|
struct _cef_web_urlrequest_t* requester, const void* data,
|
|
|
|
int dataLength);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Notifies the client that the request ended with an error.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
void (CEF_CALLBACK *on_error)(struct _cef_web_urlrequest_client_t* self,
|
|
|
|
struct _cef_web_urlrequest_t* requester,
|
|
|
|
enum cef_handler_errorcode_t errorCode);
|
|
|
|
|
|
|
|
} cef_web_urlrequest_client_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Structure that supports the reading of XML data via the libxml streaming API.
|
2011-01-29 02:42:59 +01:00
|
|
|
// The functions of this structure should only be called on the thread that
|
|
|
|
// creates the object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
typedef struct _cef_xml_reader_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-21 17:19:43 +02:00
|
|
|
// Moves the cursor to the next node in the document. This function must be
|
|
|
|
// called at least once to set the current cursor position. Returns true (1)
|
|
|
|
// if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-21 17:19:43 +02:00
|
|
|
int (CEF_CALLBACK *move_to_next_node)(struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Close the document. This should be called directly to ensure that cleanup
|
2010-10-20 17:12:46 +02:00
|
|
|
// occurs on the correct thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *close)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns true (1) if an error has been reported by the XML parser.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *has_error)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the error string.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_error)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
// The below functions retrieve data for the node at the current cursor
|
|
|
|
// position.
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the node type.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
enum cef_xml_node_type_t (CEF_CALLBACK *get_type)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the node depth. Depth starts at 0 for the root node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *get_depth)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT-
|
|
|
|
// LocalPart for additional details.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_local_name)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for
|
|
|
|
// additional details.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_prefix)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the qualified name, equal to (Prefix:)LocalName. See
|
|
|
|
// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_qualified_name)(
|
2010-10-20 17:12:46 +02:00
|
|
|
struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the URI defining the namespace associated with the node. See
|
|
|
|
// http://www.w3.org/TR/REC-xml-names/ for additional details.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_namespace_uri)(
|
2010-10-20 17:12:46 +02:00
|
|
|
struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for
|
|
|
|
// additional details.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_base_uri)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the xml:lang scope within which the node resides. See
|
|
|
|
// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_xml_lang)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns true (1) if the node represents an NULL element. <a/> is considered
|
|
|
|
// NULL but <a></a> is not.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *is_empty_element)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns true (1) if the node has a text value.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *has_value)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the text value.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_value)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns true (1) if the node has attributes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *has_attributes)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the number of attributes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
size_t (CEF_CALLBACK *get_attribute_count)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the value of the attribute at the specified 0-based index.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_attribute_byindex)(
|
2010-10-20 17:12:46 +02:00
|
|
|
struct _cef_xml_reader_t* self, int index);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the value of the attribute with the specified qualified name.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_attribute_byqname)(
|
|
|
|
struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the value of the attribute with the specified local name and
|
|
|
|
// namespace URI.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_attribute_bylname)(
|
|
|
|
struct _cef_xml_reader_t* self, const cef_string_t* localName,
|
|
|
|
const cef_string_t* namespaceURI);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns an XML representation of the current node's children.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_inner_xml)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns an XML representation of the current node including its children.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_outer_xml)(
|
|
|
|
struct _cef_xml_reader_t* self);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns the line number for the current node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *get_line_number)(struct _cef_xml_reader_t* self);
|
|
|
|
|
|
|
|
|
|
|
|
// Attribute nodes are not traversed by default. The below functions can be
|
|
|
|
// used to move the cursor to an attribute node. move_to_carrying_element()
|
|
|
|
// can be called afterwards to return the cursor to the carrying element. The
|
|
|
|
// depth of an attribute node will be 1 + the depth of the carrying element.
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Moves the cursor to the attribute at the specified 0-based index. Returns
|
|
|
|
// true (1) if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *move_to_attribute_byindex)(struct _cef_xml_reader_t* self,
|
|
|
|
int index);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Moves the cursor to the attribute with the specified qualified name.
|
|
|
|
// Returns true (1) if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *move_to_attribute_byqname)(struct _cef_xml_reader_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* qualifiedName);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Moves the cursor to the attribute with the specified local name and
|
|
|
|
// namespace URI. Returns true (1) if the cursor position was set
|
|
|
|
// successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *move_to_attribute_bylname)(struct _cef_xml_reader_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* localName, const cef_string_t* namespaceURI);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Moves the cursor to the first attribute in the current element. Returns
|
|
|
|
// true (1) if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *move_to_first_attribute)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Moves the cursor to the next attribute in the current element. Returns true
|
|
|
|
// (1) if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *move_to_next_attribute)(struct _cef_xml_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Moves the cursor back to the carrying element. Returns true (1) if the
|
|
|
|
// cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
int (CEF_CALLBACK *move_to_carrying_element)(struct _cef_xml_reader_t* self);
|
|
|
|
|
|
|
|
} cef_xml_reader_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Create a new cef_xml_reader_t object. The returned object's functions can
|
|
|
|
// only be called from the thread that created the object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream,
|
2010-11-22 18:49:46 +01:00
|
|
|
enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Structure that supports the reading of zip archives via the zlib unzip API.
|
2011-01-29 02:42:59 +01:00
|
|
|
// The functions of this structure should only be called on the thread that
|
|
|
|
// creates the object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
typedef struct _cef_zip_reader_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Moves the cursor to the first file in the archive. Returns true (1) if the
|
|
|
|
// cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *move_to_first_file)(struct _cef_zip_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Moves the cursor to the next file in the archive. Returns true (1) if the
|
|
|
|
// cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *move_to_next_file)(struct _cef_zip_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Moves the cursor to the specified file in the archive. If |caseSensitive|
|
|
|
|
// is true (1) then the search will be case sensitive. Returns true (1) if the
|
|
|
|
// cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *move_to_file)(struct _cef_zip_reader_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* fileName, int caseSensitive);
|
2010-10-24 18:41:21 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Closes the archive. This should be called directly to ensure that cleanup
|
|
|
|
// occurs on the correct thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *close)(struct _cef_zip_reader_t* self);
|
|
|
|
|
|
|
|
|
|
|
|
// The below functions act on the file at the current cursor position.
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Returns the name of the file.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-11-22 18:49:46 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_file_name)(
|
|
|
|
struct _cef_zip_reader_t* self);
|
2010-10-24 18:41:21 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Returns the uncompressed size of the file.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
long (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Returns the last modified timestamp for the file.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
time_t (CEF_CALLBACK *get_file_last_modified)(struct _cef_zip_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Opens the file for reading of uncompressed data. A read password may
|
|
|
|
// optionally be specified.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *open_file)(struct _cef_zip_reader_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* password);
|
2010-10-24 18:41:21 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Closes the file.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *close_file)(struct _cef_zip_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Read uncompressed file contents into the specified buffer. Returns < 0 if
|
|
|
|
// an error occurred, 0 if at the end of file, or the number of bytes read.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *read_file)(struct _cef_zip_reader_t* self, void* buffer,
|
|
|
|
size_t bufferSize);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Returns the current offset in the uncompressed file contents.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
long (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Returns true (1) if at end of the file contents.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self);
|
|
|
|
|
|
|
|
} cef_zip_reader_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Create a new cef_zip_reader_t object. The returned object's functions can
|
|
|
|
// only be called from the thread that created the object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create(cef_stream_reader_t* stream);
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Structure to implement for visiting the DOM. The functions of this structure
|
|
|
|
// will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
typedef struct _cef_domvisitor_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Method executed for visiting the DOM. The document object passed to this
|
|
|
|
// function represents a snapshot of the DOM at the time this function is
|
|
|
|
// executed. DOM objects are only valid for the scope of this function. Do not
|
|
|
|
// keep references to or attempt to access any DOM objects outside the scope
|
|
|
|
// of this function.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self,
|
|
|
|
struct _cef_domdocument_t* document);
|
|
|
|
|
|
|
|
} cef_domvisitor_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Structure used to represent a DOM document. The functions of this structure
|
|
|
|
// should only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
typedef struct _cef_domdocument_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the document type.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
enum cef_dom_document_type_t (CEF_CALLBACK *get_type)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the root document node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_document)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the BODY node of an HTML document.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_body)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the HEAD node of an HTML document.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_head)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the title of an HTML document.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_title)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the document element with the specified ID value.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)(
|
|
|
|
struct _cef_domdocument_t* self, const cef_string_t* id);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the node that currently has keyboard focus.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if a portion of the document is selected.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the selection start node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_selection_start_node)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the selection offset within the start node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *get_selection_start_offset)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the selection end node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_selection_end_node)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the selection offset within the end node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the contents of this selection as markup.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the contents of this selection as text.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the base URL for the document.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_base_url)(
|
|
|
|
struct _cef_domdocument_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns a complete URL based on the document base URL and the specified
|
|
|
|
// partial URL.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_complete_url)(
|
|
|
|
struct _cef_domdocument_t* self, const cef_string_t* partialURL);
|
|
|
|
|
|
|
|
} cef_domdocument_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Structure used to represent a DOM node. The functions of this structure
|
|
|
|
// should only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
typedef struct _cef_domnode_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the type for this node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
enum cef_dom_node_type_t (CEF_CALLBACK *get_type)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if this is a text node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if this is an element node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self);
|
|
|
|
|
2011-10-14 14:40:40 +02:00
|
|
|
///
|
|
|
|
// Returns true (1) if this is a form control element node.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Returns the type of this form control element node.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-10 16:17:32 +02:00
|
|
|
// Returns true (1) if this object is pointing to the same handle as |that|
|
|
|
|
// object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-10 16:17:32 +02:00
|
|
|
int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self,
|
|
|
|
struct _cef_domnode_t* that);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the name of this node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the value of this node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Set the value of this node. Returns true (1) on success.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self,
|
|
|
|
const cef_string_t* value);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the contents of this node as markup.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_as_markup)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the document associated with this node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the parent node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_parent)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the previous sibling node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the next sibling node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if this node has child nodes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Return the first child node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the last child node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Add an event listener to this node for the specified event type. If
|
|
|
|
// |useCapture| is true (1) then this listener will be considered a capturing
|
|
|
|
// listener. Capturing listeners will recieve all events of the specified type
|
|
|
|
// before the events are dispatched to any other event targets beneath the
|
|
|
|
// current node in the tree. Events which are bubbling upwards through the
|
|
|
|
// tree will not trigger a capturing listener. Separate calls to this function
|
|
|
|
// can be used to register the same listener with and without capture. See
|
|
|
|
// WebCore/dom/EventNames.h for the list of supported event types.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
void (CEF_CALLBACK *add_event_listener)(struct _cef_domnode_t* self,
|
|
|
|
const cef_string_t* eventType, struct _cef_domevent_listener_t* listener,
|
|
|
|
int useCapture);
|
|
|
|
|
|
|
|
|
|
|
|
// The following functions are valid only for element nodes.
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the tag name of this element.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if this element has attributes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if this element has an attribute named |attrName|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self,
|
|
|
|
const cef_string_t* attrName);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the element attribute named |attrName|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)(
|
|
|
|
struct _cef_domnode_t* self, const cef_string_t* attrName);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns a map of all element attributes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self,
|
|
|
|
cef_string_map_t attrMap);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Set the value for the element attribute named |attrName|. Returns true (1)
|
|
|
|
// on success.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self,
|
|
|
|
const cef_string_t* attrName, const cef_string_t* value);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the inner text of the element.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)(
|
|
|
|
struct _cef_domnode_t* self);
|
|
|
|
|
|
|
|
} cef_domnode_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Structure used to represent a DOM event. The functions of this structure
|
|
|
|
// should only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
typedef struct _cef_domevent_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the event type.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_type)(struct _cef_domevent_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the event category.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
enum cef_dom_event_category_t (CEF_CALLBACK *get_category)(
|
|
|
|
struct _cef_domevent_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the event processing phase.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
enum cef_dom_event_phase_t (CEF_CALLBACK *get_phase)(
|
|
|
|
struct _cef_domevent_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if the event can bubble up the tree.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *can_bubble)(struct _cef_domevent_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true (1) if the event can be canceled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
int (CEF_CALLBACK *can_cancel)(struct _cef_domevent_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the document associated with this event.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
|
|
|
|
struct _cef_domevent_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the target of the event.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_target)(
|
|
|
|
struct _cef_domevent_t* self);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns the current target of the event.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
struct _cef_domnode_t* (CEF_CALLBACK *get_current_target)(
|
|
|
|
struct _cef_domevent_t* self);
|
|
|
|
|
|
|
|
} cef_domevent_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Structure to implement for handling DOM events. The functions of this
|
|
|
|
// structure will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
typedef struct _cef_domevent_listener_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Called when an event is received. The event object passed to this function
|
|
|
|
// contains a snapshot of the DOM at the time this function is executed. DOM
|
|
|
|
// objects are only valid for the scope of this function. Do not keep
|
|
|
|
// references to or attempt to access any DOM objects outside the scope of
|
|
|
|
// this function.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
void (CEF_CALLBACK *handle_event)(struct _cef_domevent_listener_t* self,
|
|
|
|
struct _cef_domevent_t* event);
|
|
|
|
|
|
|
|
} cef_domevent_listener_t;
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
// Structure to implement for filtering response content. The functions of this
|
|
|
|
// structure will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
typedef struct _cef_content_filter_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
// Set |substitute_data| to the replacement for the data in |data| if data
|
|
|
|
// should be modified.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
void (CEF_CALLBACK *process_data)(struct _cef_content_filter_t* self,
|
|
|
|
const void* data, int data_size,
|
|
|
|
struct _cef_stream_reader_t** substitute_data);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
// Called when there is no more data to be processed. It is expected that
|
|
|
|
// whatever data was retained in the last process_data() call, it should be
|
|
|
|
// returned now by setting |remainder| if appropriate.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
void (CEF_CALLBACK *drain)(struct _cef_content_filter_t* self,
|
|
|
|
struct _cef_stream_reader_t** remainder);
|
|
|
|
|
|
|
|
} cef_content_filter_t;
|
|
|
|
|
|
|
|
|
2011-08-22 03:31:55 +02:00
|
|
|
///
|
|
|
|
// Structure used to represent drag data. The functions of this structure may be
|
|
|
|
// called on any thread.
|
|
|
|
///
|
|
|
|
typedef struct _cef_drag_data_t
|
|
|
|
{
|
|
|
|
// Base structure.
|
|
|
|
cef_base_t base;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Returns true (1) if the drag data is a link.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Returns true (1) if the drag data is a text or html fragment.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Returns true (1) if the drag data is a file.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the link URL that is being dragged.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_link_url)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the title associated with the link being dragged.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_link_title)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the metadata, if any, associated with the link being dragged.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the plain text fragment that is being dragged.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the text/html fragment that is being dragged.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the base URL that the fragment came from. This value is used for
|
|
|
|
// resolving relative URLs and may be NULL.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the extension of the file being dragged out of the browser window.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_file_extension)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the name of the file being dragged out of the browser window.
|
|
|
|
///
|
|
|
|
// The resulting string must be freed by calling cef_string_userfree_free().
|
|
|
|
cef_string_userfree_t (CEF_CALLBACK *get_file_name)(
|
|
|
|
struct _cef_drag_data_t* self);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Retrieve the list of file names that are being dragged into the browser
|
|
|
|
// window.
|
|
|
|
///
|
|
|
|
int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self,
|
|
|
|
cef_string_list_t names);
|
|
|
|
|
|
|
|
} cef_drag_data_t;
|
|
|
|
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _CEF_CAPI_H
|