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.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// The contents of this file must follow a specific format in order to
|
|
|
|
// support the CEF translator tool. See the translator.README.txt file in the
|
|
|
|
// tools directory for more information.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _CEF_H
|
|
|
|
#define _CEF_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2011-05-20 22:52:47 +02:00
|
|
|
#include "internal/cef_build.h"
|
|
|
|
#include "internal/cef_ptr.h"
|
|
|
|
#include "internal/cef_types_wrappers.h"
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Bring in platform-specific definitions.
|
|
|
|
#if defined(OS_WIN)
|
2011-05-20 22:52:47 +02:00
|
|
|
#include "internal/cef_win.h"
|
2011-05-20 16:42:25 +02:00
|
|
|
#elif defined(OS_MACOSX)
|
2011-05-20 22:52:47 +02:00
|
|
|
#include "internal/cef_mac.h"
|
2011-05-20 16:42:25 +02:00
|
|
|
#elif defined(OS_LINUX)
|
2011-05-20 22:52:47 +02:00
|
|
|
#include "internal/cef_linux.h"
|
2011-05-20 16:42:25 +02:00
|
|
|
#endif
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
class CefBrowser;
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefClient;
|
2011-05-24 01:39:07 +02:00
|
|
|
class CefContentFilter;
|
2011-04-09 03:05:30 +02:00
|
|
|
class CefCookieVisitor;
|
2011-02-23 04:45:13 +01:00
|
|
|
class CefDOMDocument;
|
|
|
|
class CefDOMEvent;
|
|
|
|
class CefDOMEventListener;
|
|
|
|
class CefDOMNode;
|
|
|
|
class CefDOMVisitor;
|
2010-10-16 21:10:11 +02:00
|
|
|
class CefDownloadHandler;
|
2011-08-22 03:31:55 +02:00
|
|
|
class CefDragData;
|
2010-10-03 23:04:50 +02:00
|
|
|
class CefFrame;
|
|
|
|
class CefPostData;
|
|
|
|
class CefPostDataElement;
|
|
|
|
class CefRequest;
|
2011-02-09 23:04:35 +01:00
|
|
|
class CefResponse;
|
2010-10-03 23:04:50 +02:00
|
|
|
class CefSchemeHandler;
|
|
|
|
class CefSchemeHandlerFactory;
|
2011-10-06 15:34:47 +02:00
|
|
|
class CefStorageVisitor;
|
2010-10-03 23:04:50 +02:00
|
|
|
class CefStreamReader;
|
|
|
|
class CefStreamWriter;
|
|
|
|
class CefTask;
|
2011-02-21 23:44:06 +01:00
|
|
|
class CefV8Context;
|
2010-10-03 23:04:50 +02:00
|
|
|
class CefV8Handler;
|
|
|
|
class CefV8Value;
|
2011-02-09 23:04:35 +01:00
|
|
|
class CefWebURLRequest;
|
|
|
|
class CefWebURLRequestClient;
|
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 indicates that
|
|
|
|
// it succeeded and false indicates that it failed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
bool CefInitialize(const CefSettings& 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
|
|
|
// 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()--*/
|
|
|
|
void CefShutdown();
|
|
|
|
|
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 CefInitialize() is called with a CefSettings.multi_threaded_message_loop
|
|
|
|
// value of false. This function will not block.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
void CefDoMessageLoopWork();
|
|
|
|
|
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 CefInitialize() is called with a
|
|
|
|
// CefSettings.multi_threaded_message_loop value of false. 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()--*/
|
|
|
|
void CefRunMessageLoop();
|
|
|
|
|
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.
|
2011-05-31 19:12:37 +02:00
|
|
|
//
|
2010-10-03 23:04:50 +02:00
|
|
|
// Example JavaScript extension code:
|
2011-05-31 19:12:37 +02:00
|
|
|
// <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>
|
2010-10-03 23:04:50 +02:00
|
|
|
// Example usage in the page:
|
2011-05-31 19:12:37 +02:00
|
|
|
// <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-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
bool CefRegisterExtension(const CefString& extension_name,
|
|
|
|
const CefString& javascript_code,
|
2010-10-03 23:04:50 +02:00
|
|
|
CefRefPtr<CefV8Handler> handler);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Register a custom scheme. This method should not be called for the built-in
|
|
|
|
// HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
|
2011-05-31 19:12:37 +02:00
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// If |is_standard| is true 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
|
|
|
//
|
2011-03-04 18:56:01 +01:00
|
|
|
// In particular, the syntax for standard scheme URLs must be of the form:
|
2011-05-31 19:12:37 +02:00
|
|
|
// <pre>
|
|
|
|
// [scheme]://[username]:[password]@[host]:[port]/[url-path]
|
|
|
|
// </pre>
|
2011-03-04 18:56:01 +01:00
|
|
|
// Standard scheme URLs must have a host component that is a fully qualified
|
|
|
|
// domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC
|
|
|
|
// 1123. These URLs will be canonicalized to "scheme://host/path" in the
|
|
|
|
// simplest case and "scheme://username:password@host:port/path" in the most
|
|
|
|
// explicit case. For example, "scheme:host/path" and "scheme:///host/path" will
|
|
|
|
// both be canonicalized to "scheme://host/path".
|
2011-05-31 19:12:37 +02:00
|
|
|
//
|
2011-03-04 18:56:01 +01:00
|
|
|
// 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-31 19:12:37 +02:00
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// If |is_local| is true the scheme will be treated as local (i.e., with the
|
|
|
|
// same security rules as those applied to "file" URLs). This means that normal
|
|
|
|
// pages cannot link to or access URLs of this scheme.
|
2011-05-31 19:12:37 +02:00
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// If |is_display_isolated| is true the scheme will be treated as display-
|
|
|
|
// isolated. This means that pages cannot display these URLs unless they are
|
|
|
|
// from the same scheme. For example, pages in another origin cannot create
|
|
|
|
// iframes or hyperlinks to URLs with this scheme.
|
2011-05-31 19:12:37 +02:00
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// This function may be called on any thread. It should only be called once
|
|
|
|
// per unique |scheme_name| value. If |scheme_name| is already registered or if
|
|
|
|
// an error occurs this method will return false.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefRegisterCustomScheme(const CefString& scheme_name,
|
|
|
|
bool is_standard,
|
|
|
|
bool is_local,
|
|
|
|
bool 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 empty |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
|
|
|
|
// CefRegisterCustomScheme() 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 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()--*/
|
|
|
|
bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name,
|
|
|
|
const CefString& domain_name,
|
|
|
|
CefRefPtr<CefSchemeHandlerFactory> factory);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-27 18:20:32 +02:00
|
|
|
// Clear all registered scheme handler factories. Returns false 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()--*/
|
|
|
|
bool CefClearSchemeHandlerFactories();
|
|
|
|
|
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.
|
2011-05-31 19:12:37 +02:00
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// 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".
|
2011-05-31 19:12:37 +02:00
|
|
|
//
|
2011-05-27 18:20:32 +02:00
|
|
|
// This method 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 access will also be allowed to all
|
|
|
|
// subdomains of the target domain. This function may be called on any thread.
|
|
|
|
// Returns false 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()--*/
|
|
|
|
bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
|
|
|
|
const CefString& target_protocol,
|
|
|
|
const CefString& target_domain,
|
|
|
|
bool 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 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()--*/
|
|
|
|
bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
|
|
|
|
const CefString& target_protocol,
|
|
|
|
const CefString& target_domain,
|
|
|
|
bool 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 if
|
|
|
|
// the whitelist cannot be accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-27 18:20:32 +02:00
|
|
|
bool CefClearCrossOriginWhitelist();
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
typedef cef_thread_id_t CefThreadId;
|
|
|
|
|
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 thread will be the same as the main application thread if CefInitialize()
|
2011-01-29 02:42:59 +01:00
|
|
|
// is called with a CefSettings.multi_threaded_message_loop value of false.) 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 if called on the specified thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefCurrentlyOn(CefThreadId 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()--*/
|
|
|
|
bool CefPostTask(CefThreadId threadId, CefRefPtr<CefTask> 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()--*/
|
|
|
|
bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr<CefTask> 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 if the URL is empty or invalid.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-31 21:47:04 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefParseURL(const CefString& url,
|
|
|
|
CefURLParts& 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-empty
|
|
|
|
// spec or a non-empty host and path (at a minimum), but not both.
|
|
|
|
// Returns false if |parts| isn't initialized as described.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-31 21:47:04 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefCreateURL(const CefURLParts& parts,
|
|
|
|
CefString& url);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
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 if cookies cannot be accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefVisitAllCookies(CefRefPtr<CefCookieVisitor> 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 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 if cookies cannot be
|
|
|
|
// accessed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly,
|
|
|
|
CefRefPtr<CefCookieVisitor> 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 without setting the cookie if such
|
|
|
|
// characters are found. This method must be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefSetCookie(const CefString& url, const CefCookie& 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 empty all cookies
|
|
|
|
// for all hosts and domains will be deleted. Returns false if a non-empty
|
|
|
|
// invalid URL is specified or if cookies cannot be accessed. This method must
|
|
|
|
// be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
bool CefDeleteCookies(const CefString& url, const CefString& cookie_name);
|
|
|
|
|
|
|
|
|
2011-10-06 15:34:47 +02:00
|
|
|
typedef cef_storage_type_t CefStorageType;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Visit storage of the specified type. If |origin| is non-empty only data
|
|
|
|
// matching that origin will be visited. If |key| is non-empty only data
|
|
|
|
// matching that key will be visited. Otherwise, all data for the storage
|
|
|
|
// type will be visited. Returns false if the storage cannot be accessed.
|
|
|
|
// Origin should be of the form scheme://domain.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
bool CefVisitStorage(CefStorageType type, const CefString& origin,
|
|
|
|
const CefString& key,
|
|
|
|
CefRefPtr<CefStorageVisitor> visitor);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Sets storage of the specified type, origin, key and value. Returns false if
|
|
|
|
// storage cannot be accessed. This method must be called on the UI thread.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
bool CefSetStorage(CefStorageType type, const CefString& origin,
|
|
|
|
const CefString& key, const CefString& value);
|
|
|
|
|
|
|
|
///
|
|
|
|
// Deletes all storage of the specified type. If |origin| is non-empty only data
|
|
|
|
// matching that origin will be cleared. If |key| is non-empty only data
|
|
|
|
// matching that key will be cleared. Otherwise, all data for the storage type
|
|
|
|
// will be cleared. Returns false if storage cannot be accessed. This method
|
|
|
|
// must be called on the UI thread.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
bool CefDeleteStorage(CefStorageType type, const CefString& origin,
|
|
|
|
const CefString& key);
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Interface defining the reference count implementation methods. All framework
|
|
|
|
// classes must extend the CefBase class.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
class CefBase
|
|
|
|
{
|
|
|
|
public:
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// The AddRef method increments the reference count for the object. It should
|
|
|
|
// be called for every new copy of a pointer to a given object. The resulting
|
|
|
|
// reference count value is returned and should be used for diagnostic/testing
|
|
|
|
// purposes only.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
virtual int AddRef() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// The Release method decrements the reference count for the object. If the
|
|
|
|
// reference count on the object falls to 0, then the object should free
|
|
|
|
// itself from memory. The resulting reference count value is returned and
|
|
|
|
// should be used for diagnostic/testing purposes only.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
virtual int Release() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Return the current number of references.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual int GetRefCt() =0;
|
2011-08-31 19:54:20 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~CefBase() {}
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Class that implements atomic reference counting.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefRefCount
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-05-20 16:42:25 +02:00
|
|
|
CefRefCount() : refct_(0) {}
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Atomic reference increment.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int AddRef() {
|
|
|
|
return CefAtomicIncrement(&refct_);
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Atomic reference decrement. Delete the object when no references remain.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int Release() {
|
|
|
|
return CefAtomicDecrement(&refct_);
|
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 current number of references.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
int GetRefCt() { return refct_; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
long refct_;
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Macro that provides a reference counting implementation for classes extending
|
|
|
|
// CefBase.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
#define IMPLEMENT_REFCOUNTING(ClassName) \
|
|
|
|
public: \
|
|
|
|
int AddRef() { return refct_.AddRef(); } \
|
|
|
|
int Release() { \
|
|
|
|
int retval = refct_.Release(); \
|
|
|
|
if(retval == 0) \
|
|
|
|
delete this; \
|
|
|
|
return retval; \
|
|
|
|
} \
|
|
|
|
int GetRefCt() { return refct_.GetRefCt(); } \
|
|
|
|
private: \
|
|
|
|
CefRefCount refct_;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Macro that provides a locking implementation. Use the Lock() and Unlock()
|
|
|
|
// methods to protect a section of code from simultaneous access by multiple
|
|
|
|
// threads. The AutoLock class is a helper that will hold the lock while in
|
|
|
|
// scope.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
#define IMPLEMENT_LOCKING(ClassName) \
|
|
|
|
public: \
|
|
|
|
class AutoLock { \
|
|
|
|
public: \
|
|
|
|
AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \
|
|
|
|
~AutoLock() { base_->Unlock(); } \
|
|
|
|
private: \
|
|
|
|
ClassName* base_; \
|
|
|
|
}; \
|
|
|
|
void Lock() { critsec_.Lock(); } \
|
|
|
|
void Unlock() { critsec_.Unlock(); } \
|
|
|
|
private: \
|
|
|
|
CefCriticalSection critsec_;
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Implement this interface for task execution. The methods of this class may
|
|
|
|
// be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefTask : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Execute(CefThreadId threadId) =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
// Interface to implement for visiting cookie values. The methods of this class
|
|
|
|
// will always be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-09 03:05:30 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefCookieVisitor : public virtual CefBase
|
2011-04-09 03:05:30 +02:00
|
|
|
{
|
|
|
|
public:
|
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 to delete the cookie currently being visited.
|
|
|
|
// Return false to stop visiting cookies. This method 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Visit(const CefCookie& cookie, int count, int total,
|
|
|
|
bool& deleteCookie) =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-10-06 15:34:47 +02:00
|
|
|
///
|
|
|
|
// Interface to implement for visiting storage. The methods of this class will
|
|
|
|
// always be called on the UI thread.
|
|
|
|
///
|
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefStorageVisitor : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
// 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 to delete the pair currently
|
|
|
|
// being visited. Return false to stop visiting pairs. This method may never
|
|
|
|
// be called if no data is found.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Visit(CefStorageType type, const CefString& origin,
|
|
|
|
const CefString& key, const CefString& value, int count,
|
|
|
|
int total, bool& deleteData) =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to represent a browser window. The methods of this class 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
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefBrowser : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-03-24 21:36:47 +01:00
|
|
|
typedef cef_key_type_t KeyType;
|
|
|
|
typedef cef_mouse_button_type_t MouseButtonType;
|
|
|
|
typedef cef_paint_element_type_t PaintElementType;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Create a new browser window using the window parameters specified by
|
|
|
|
// |windowInfo|. All values will be copied internally and the actual window
|
2011-05-20 16:42:25 +02:00
|
|
|
// will be created on the UI thread. This method call will not block.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
static bool CreateBrowser(CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient> client,
|
|
|
|
const CefString& url,
|
|
|
|
const CefBrowserSettings& 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
|
|
|
// Create a new browser window using the window parameters specified by
|
2011-05-20 16:42:25 +02:00
|
|
|
// |windowInfo|. This method 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()--*/
|
|
|
|
static CefRefPtr<CefBrowser> CreateBrowserSync(CefWindowInfo& windowInfo,
|
2011-05-20 16:42:25 +02:00
|
|
|
CefRefPtr<CefClient> client,
|
|
|
|
const CefString& url,
|
|
|
|
const CefBrowserSettings& settings);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-08-03 17:35:51 +02:00
|
|
|
///
|
|
|
|
// Call this method before destroying a contained browser window. This method
|
|
|
|
// performs any internal cleanup that may be needed before the browser window
|
|
|
|
// is destroyed.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual void ParentWindowWillClose() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void CloseBrowser() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true if the browser can navigate backwards.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool CanGoBack() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void GoBack() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true if the browser can navigate forwards.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool CanGoForward() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void GoForward() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Reload() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void ReloadIgnoreCache() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void StopLoad() =0;
|
|
|
|
|
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 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetFocus(bool enable) =0;
|
|
|
|
|
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()--*/
|
|
|
|
virtual CefWindowHandle GetWindowHandle() =0;
|
|
|
|
|
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 method can be used in combination
|
|
|
|
// with custom handling of modal windows.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefWindowHandle GetOpenerWindowHandle() =0;
|
|
|
|
|
2011-05-31 19:47:44 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true if the window is a popup window.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsPopup() =0;
|
|
|
|
|
2011-08-30 18:20:27 +02:00
|
|
|
// Returns true if a document has been loaded in the browser.
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasDocument() =0;
|
|
|
|
|
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
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual CefRefPtr<CefClient> GetClient() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefFrame> GetMainFrame() =0;
|
|
|
|
|
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 method 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()--*/
|
|
|
|
virtual CefRefPtr<CefFrame> GetFocusedFrame() =0;
|
|
|
|
|
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
|
|
|
|
// method 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()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefRefPtr<CefFrame> GetFrame(const CefString& name) =0;
|
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 method 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()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void GetFrameNames(std::vector<CefString>& names) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void Find(int identifier, const CefString& searchText,
|
2010-10-03 23:04:50 +02:00
|
|
|
bool forward, bool matchCase, bool findNext) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void StopFinding(bool clearSelection) =0;
|
2011-01-25 16:34:50 +01:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual double GetZoomLevel() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetZoomLevel(double zoomLevel) =0;
|
2011-01-25 19:37:27 +01:00
|
|
|
|
2011-10-04 13:49:36 +02:00
|
|
|
///
|
|
|
|
// Clear the back/forward browsing history.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual void ClearHistory() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void ShowDevTools() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void CloseDevTools() =0;
|
2011-03-24 21:36:47 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Returns true if window rendering is disabled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsWindowRenderingDisabled() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Get the size of the specified element. This method should only be called on
|
|
|
|
// the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool GetSize(PaintElementType type, int& width, int& height) =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Set the size of the specified element. This method is only used when window
|
|
|
|
// rendering is disabled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetSize(PaintElementType type, int width, int height) =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Returns true if a popup is currently visible. This method should only be
|
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsPopupVisible() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void HidePopup() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
// Invalidate the |dirtyRect| region of the view. This method is only used
|
|
|
|
// when window rendering is disabled and will result in a call to
|
|
|
|
// HandlePaint().
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Invalidate(const CefRect& dirtyRect) =0;
|
|
|
|
|
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
|
|
|
|
// method should only be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-03-24 21:36:47 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool GetImage(PaintElementType type, int width, int height,
|
|
|
|
void* buffer) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar,
|
|
|
|
bool imeChar) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SendMouseClickEvent(int x, int y, MouseButtonType type,
|
|
|
|
bool mouseUp, int clickCount) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SendMouseMoveEvent(int x, int y, bool mouseLeave) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SendMouseWheelEvent(int x, int y, int delta) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SendFocusEvent(bool setFocus) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SendCaptureLostEvent() =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to represent a frame in the browser window. The methods of this
|
|
|
|
// class 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
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefFrame : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Undo() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Redo() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Cut() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Copy() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Paste() =0;
|
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
|
|
|
/*--cef(capi_name=del)--*/
|
|
|
|
virtual void Delete() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SelectAll() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Print() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void ViewSource() =0;
|
|
|
|
|
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 method 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()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetSource() =0;
|
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 method 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()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetText() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void LoadRequest(CefRefPtr<CefRequest> request) =0;
|
|
|
|
|
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-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void LoadURL(const CefString& url) =0;
|
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
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void LoadString(const CefString& string,
|
|
|
|
const CefString& url) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void LoadStream(CefRefPtr<CefStreamReader> stream,
|
2010-11-22 18:49:46 +01:00
|
|
|
const CefString& url) =0;
|
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
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void ExecuteJavaScript(const CefString& jsCode,
|
|
|
|
const CefString& scriptUrl,
|
2010-10-03 23:04:50 +02:00
|
|
|
int startLine) =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Returns true if this is the main frame.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsMain() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Returns true if this is the focused frame. This method 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()--*/
|
|
|
|
virtual bool IsFocused() =0;
|
|
|
|
|
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-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetName() =0;
|
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 method should only be
|
2011-01-29 02:42:59 +01:00
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetURL() =0;
|
2011-02-21 23:44:06 +01: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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefBrowser> GetBrowser() =0;
|
2011-02-23 04:45:13 +01:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void VisitDOM(CefRefPtr<CefDOMVisitor> visitor) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to browser life span. The
|
|
|
|
// methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefLifeSpanHandler : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
|
// to have the framework create the new popup window based on the parameters
|
|
|
|
// in |windowInfo|. Return true 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser,
|
|
|
|
const CefPopupFeatures& popupFeatures,
|
|
|
|
CefWindowInfo& windowInfo,
|
|
|
|
const CefString& url,
|
|
|
|
CefRefPtr<CefClient>& client,
|
|
|
|
CefBrowserSettings& settings) { return false; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) {}
|
|
|
|
|
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 to use the default modal loop implementation or
|
|
|
|
// true to use a custom implementation.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
2011-08-03 17:35:51 +02:00
|
|
|
virtual bool RunModal(CefRefPtr<CefBrowser> browser) { return false; }
|
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 to
|
|
|
|
// proceed with the window close or true to cancel the window close. If this
|
|
|
|
// is a modal window and a custom modal loop implementation was provided in
|
|
|
|
// RunModal() this callback should be used to restore the opener window to a
|
|
|
|
// usable state.
|
2011-06-14 17:09:55 +02:00
|
|
|
///
|
|
|
|
/*--cef()--*/
|
2011-08-03 17:35:51 +02:00
|
|
|
virtual bool DoClose(CefRefPtr<CefBrowser> browser) { return false; }
|
2011-06-14 17:09:55 +02:00
|
|
|
|
|
|
|
///
|
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 RunModal() this callback
|
|
|
|
// should be used to exit the custom modal loop.
|
2011-06-14 17:09:55 +02:00
|
|
|
///
|
|
|
|
/*--cef()--*/
|
2011-08-03 17:35:51 +02:00
|
|
|
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) {}
|
2011-05-20 16:42:25 +02:00
|
|
|
};
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to browser load status. The
|
|
|
|
// methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefLoadHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef cef_handler_errorcode_t ErrorCode;
|
|
|
|
|
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 empty -- call the IsMain() method 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 method
|
|
|
|
// 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> 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 empty -- call the IsMain() method 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 method
|
|
|
|
// 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
int httpStatusCode) {}
|
|
|
|
|
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.
|
|
|
|
// Otherwise, return false 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnLoadError(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
ErrorCode errorCode,
|
|
|
|
const CefString& failedUrl,
|
|
|
|
CefString& errorText) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to browser requests. The
|
|
|
|
// methods of this class will be called on the thread indicated.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefRequestHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_handler_navtype_t NavType;
|
|
|
|
|
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 to cancel
|
|
|
|
// the navigation or false to allow the navigation to proceed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
NavType navType,
|
|
|
|
bool isRedirect) { return false; }
|
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. To redirect the resource to a new url
|
|
|
|
// populate the |redirectUrl| value and return false. To specify data for the
|
|
|
|
// resource return a CefStream object in |resourceStream|, use the |response|
|
|
|
|
// object to set mime type, HTTP status code and optional header values, and
|
|
|
|
// return false. To cancel loading of the resource return true. Any
|
|
|
|
// modifications to |request| will be observed. If the URL in |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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefString& redirectUrl,
|
|
|
|
CefRefPtr<CefStreamReader>& resourceStream,
|
|
|
|
CefRefPtr<CefResponse> response,
|
|
|
|
int loadFlags) { return false; }
|
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-05-24 01:39:07 +02:00
|
|
|
/*--cef()--*/
|
2011-07-02 19:57:00 +02:00
|
|
|
virtual void OnResourceResponse(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& url,
|
|
|
|
CefRefPtr<CefResponse> response,
|
|
|
|
CefRefPtr<CefContentFilter>& filter) {}
|
2011-05-24 01:39:07 +02:00
|
|
|
|
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 to indicate that the request should
|
|
|
|
// succeed because it was handled externally. Set |allowOSExecution| to true
|
|
|
|
// and return false to attempt execution via the registered OS protocol
|
|
|
|
// handler, if any. If false is returned and either |allow_os_execution|
|
2011-01-29 02:42:59 +01:00
|
|
|
// is false or OS protocol handler execution fails then the request will fail
|
|
|
|
// with an error condition.
|
2011-01-12 02:33:03 +01:00
|
|
|
// 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-01-12 02:33:03 +01:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual bool OnProtocolExecution(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& url,
|
|
|
|
bool& allowOSExecution) { return false; }
|
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
|
|
|
|
// CefDownloadHandler instance that will recieve the file contents. Return
|
2011-05-20 16:42:25 +02:00
|
|
|
// true to download the file or false to cancel the file download.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual bool GetDownloadHandler(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& mimeType,
|
|
|
|
const CefString& fileName,
|
|
|
|
int64 contentLength,
|
|
|
|
CefRefPtr<CefDownloadHandler>& handler)
|
|
|
|
{ return false; }
|
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
|
|
|
|
// hostname and port number. Set |username| and |password| and return
|
2011-05-20 16:42:25 +02:00
|
|
|
// true to handle the request. Return false to cancel the request.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool GetAuthCredentials(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool isProxy,
|
|
|
|
const CefString& host,
|
2011-09-23 02:16:03 +02:00
|
|
|
int port,
|
2011-05-20 16:42:25 +02:00
|
|
|
const CefString& realm,
|
|
|
|
const CefString& scheme,
|
|
|
|
CefString& username,
|
|
|
|
CefString& password) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to browser display state.
|
|
|
|
// The methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefDisplayHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_handler_statustype_t StatusType;
|
|
|
|
|
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-01-07 02:24:17 +01:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual void OnNavStateChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool canGoBack,
|
|
|
|
bool canGoForward) {}
|
2011-01-07 02:24:17 +01:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnAddressChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefString& url) {}
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& title) {}
|
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 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. Otherwise, you can optionally modify |text|
|
|
|
|
// and then return false to allow the browser to display the tooltip.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnTooltip(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefString& text) { return false; }
|
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
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual void OnStatusMessage(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& value,
|
|
|
|
StatusType 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 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnConsoleMessage(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& message,
|
|
|
|
const CefString& source,
|
|
|
|
int line) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to focus. The methods of
|
|
|
|
// this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefFocusHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
2011-10-07 12:30:10 +02:00
|
|
|
typedef cef_handler_focus_source_t FocusSource;
|
|
|
|
|
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 if the browser is giving focus to the next component and false
|
|
|
|
// 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnTakeFocus(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool 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 to allow the
|
|
|
|
// focus to be set or true to cancel setting the focus.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnSetFocus(CefRefPtr<CefBrowser> browser,
|
2011-10-07 12:30:10 +02:00
|
|
|
FocusSource source) { return false; }
|
2011-05-20 16:42:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to keyboard input. The
|
|
|
|
// methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefKeyboardHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_handler_keyevent_type_t KeyEventType;
|
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 component receives a keyboard 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 if Windows considers this a 'system key' message (see
|
|
|
|
// http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx). Return
|
|
|
|
// true if the keyboard event was handled or false to allow the browser
|
|
|
|
// component to handle the event.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnKeyEvent(CefRefPtr<CefBrowser> browser,
|
|
|
|
KeyEventType type,
|
|
|
|
int code,
|
|
|
|
int modifiers,
|
|
|
|
bool isSystemKey) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to browser context menus.
|
|
|
|
// The methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefMenuHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef cef_handler_menuid_t MenuId;
|
2011-05-20 16:42:25 +02:00
|
|
|
typedef cef_handler_menuinfo_t MenuInfo;
|
|
|
|
|
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 to display the
|
|
|
|
// default context menu or true to cancel the display.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnBeforeMenu(CefRefPtr<CefBrowser> browser,
|
|
|
|
const MenuInfo& menuInfo) { return false; }
|
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 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
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual void GetMenuLabel(CefRefPtr<CefBrowser> browser,
|
|
|
|
MenuId menuId,
|
|
|
|
CefString& label) {}
|
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 an option is selected from the default context menu. Return
|
|
|
|
// false to execute the default action or true to cancel the action.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual bool OnMenuAction(CefRefPtr<CefBrowser> browser,
|
|
|
|
MenuId menuId) { return false; }
|
|
|
|
};
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to printing. The methods of
|
|
|
|
// this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefPrintHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef cef_print_options_t CefPrintOptions;
|
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 to display the default print options or true to
|
|
|
|
// display the modified |printOptions|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool GetPrintOptions(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefPrintOptions& printOptions) { return false; }
|
|
|
|
|
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. Otherwise, populate the approprate variables and return false.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool GetPrintHeaderFooter(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefPrintInfo& printInfo,
|
|
|
|
const CefString& url,
|
|
|
|
const CefString& title,
|
|
|
|
int currentPage,
|
|
|
|
int maxPages,
|
|
|
|
CefString& topLeft,
|
|
|
|
CefString& topCenter,
|
|
|
|
CefString& topRight,
|
|
|
|
CefString& bottomLeft,
|
|
|
|
CefString& bottomCenter,
|
|
|
|
CefString& bottomRight) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to find results. The
|
|
|
|
// methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefFindHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Called to report find results returned by CefBrowser::Find(). |identifer|
|
|
|
|
// is the identifier passed to CefBrowser::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 if this
|
|
|
|
// is the last find notification.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnFindResult(CefRefPtr<CefBrowser> browser,
|
|
|
|
int identifier,
|
|
|
|
int count,
|
|
|
|
const CefRect& selectionRect,
|
|
|
|
int activeMatchOrdinal,
|
|
|
|
bool finalUpdate) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events related to JavaScript dialogs. The
|
|
|
|
// methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefJSDialogHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
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 to display the
|
|
|
|
// default alert or true if you displayed a custom alert.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnJSAlert(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefString& message) { return false; }
|
|
|
|
|
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 to display the
|
|
|
|
// default alert or true if you displayed a custom alert. If you handled the
|
|
|
|
// alert set |retval| to true if the user accepted the confirmation.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnJSConfirm(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefString& message,
|
|
|
|
bool& retval) { return false; }
|
|
|
|
|
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 to display the
|
|
|
|
// default prompt or true if you displayed a custom prompt. If you handled
|
|
|
|
// the prompt set |retval| to true 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnJSPrompt(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefString& message,
|
|
|
|
const CefString& defaultValue,
|
|
|
|
bool& retval,
|
|
|
|
CefString& result) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle JavaScript binding. The methods of this
|
|
|
|
// class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefJSBindingHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnJSBinding(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefV8Value> object) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to handle events when window rendering is disabled.
|
|
|
|
// The methods of this class will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefRenderHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_paint_element_type_t PaintElementType;
|
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 retrieve the view rectangle which is relative to screen
|
|
|
|
// coordinates. Return true if the rectangle was provided.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual bool GetViewRect(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRect& rect) { return false; }
|
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 retrieve the simulated screen rectangle. Return true if the
|
|
|
|
// rectangle was provided.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual bool GetScreenRect(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRect& rect) { return false; }
|
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 retrieve the translation from view coordinates to actual screen
|
|
|
|
// coordinates. Return true if the screen coordinates were provided.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual bool GetScreenPoint(CefRefPtr<CefBrowser> browser,
|
|
|
|
int viewX,
|
|
|
|
int viewY,
|
|
|
|
int& screenX,
|
|
|
|
int& screenY) { return false; }
|
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 wants to show or hide the popup widget. The popup
|
|
|
|
// should be shown if |show| is true and hidden if |show| is false.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual void OnPopupShow(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool show) {}
|
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 wants to move or resize the popup widget. |rect|
|
|
|
|
// contains the new location and size.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual void OnPopupSize(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefRect& rect) {}
|
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 an element should be painted. |type| indicates whether the
|
|
|
|
// 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
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
virtual void OnPaint(CefRefPtr<CefBrowser> browser,
|
|
|
|
PaintElementType type,
|
|
|
|
const CefRect& dirtyRect,
|
|
|
|
const void* buffer) {}
|
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 window's cursor has changed.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefCursorHandle cursor) {}
|
|
|
|
};
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-01-26 16:12:49 +01:00
|
|
|
|
2011-08-22 03:31:55 +02:00
|
|
|
///
|
|
|
|
// Implement this interface to handle events related to dragging. The methods of
|
|
|
|
// this class will be called on the UI thread.
|
|
|
|
///
|
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefDragHandler : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_drag_operations_mask_t DragOperationsMask;
|
|
|
|
|
|
|
|
///
|
|
|
|
// 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 for default drag handling behavior or true to
|
|
|
|
// cancel the drag event.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnDragStart(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefDragData> dragData,
|
|
|
|
DragOperationsMask mask) { return false; }
|
|
|
|
|
|
|
|
///
|
|
|
|
// 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 for default drag handling behavior or true to
|
|
|
|
// cancel the drag event.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool OnDragEnter(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefDragData> dragData,
|
|
|
|
DragOperationsMask mask) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
// Implement this interface to provide handler implementations.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-20 16:42:25 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefClient : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() { return NULL; }
|
2011-03-24 21:36:47 +01:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() { return NULL; }
|
2011-03-24 21:36:47 +01:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefRequestHandler> GetRequestHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefFocusHandler> GetFocusHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefMenuHandler> GetMenuHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefPrintHandler> GetPrintHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefFindHandler> GetFindHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefJSBindingHandler> GetJSBindingHandler() { return NULL; }
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefRenderHandler> GetRenderHandler() { return NULL; }
|
2011-08-22 03:31:55 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Return the handler for drag events.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDragHandler> GetDragHandler() { return NULL; }
|
2011-03-24 21:36:47 +01:00
|
|
|
};
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to represent a web request. The methods of this class may be
|
|
|
|
// called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefRequest : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2010-11-22 18:49:46 +01:00
|
|
|
typedef std::map<CefString,CefString> HeaderMap;
|
2011-02-09 23:04:35 +01:00
|
|
|
typedef cef_weburlrequest_flags_t RequestFlags;
|
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 CefRequest object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefRequest> CreateRequest();
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the fully qualified URL.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetURL() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the fully qualified URL.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void SetURL(const CefString& url) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the request method type. The value will default to POST if post data
|
|
|
|
// is provided and GET otherwise.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetMethod() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the request method type.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void SetMethod(const CefString& method) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefPostData> GetPostData() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the post data.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetPostData(CefRefPtr<CefPostData> postData) =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the header values.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void GetHeaderMap(HeaderMap& headerMap) =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the header values.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetHeaderMap(const HeaderMap& headerMap) =0;
|
|
|
|
|
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-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void Set(const CefString& url,
|
|
|
|
const CefString& method,
|
2010-10-03 23:04:50 +02:00
|
|
|
CefRefPtr<CefPostData> postData,
|
|
|
|
const HeaderMap& headerMap) =0;
|
2011-02-09 23:04:35 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the flags used in combination with CefWebURLRequest.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual RequestFlags GetFlags() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the flags used in combination with CefWebURLRequest.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual void SetFlags(RequestFlags flags) =0;
|
2011-02-09 23:04:35 +01:00
|
|
|
|
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
|
|
|
// CefWebURLRequest.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual CefString GetFirstPartyForCookies() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the URL to the first party for cookies used in combination with
|
|
|
|
// CefWebURLRequest.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual void SetFirstPartyForCookies(const CefString& url) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to represent post data for a web request. The methods of this
|
|
|
|
// class may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefPostData : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2010-10-09 21:21:09 +02:00
|
|
|
typedef std::vector<CefRefPtr<CefPostDataElement> > ElementVector;
|
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 CefPostData object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefPostData> CreatePostData();
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t GetElementCount() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void GetElements(ElementVector& elements) =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Remove the specified post data element. Returns true if the removal
|
|
|
|
// succeeds.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element) =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Add the specified post data element. Returns true if the add succeeds.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool AddElement(CefRefPtr<CefPostDataElement> element) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void RemoveElements() =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to represent a single element in the request post data. The
|
|
|
|
// methods of this class may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefPostDataElement : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Post data elements may represent either bytes or files.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
typedef cef_postdataelement_type_t Type;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
// Create a new CefPostDataElement object.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefPostDataElement> CreatePostDataElement();
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetToEmpty() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void SetToFile(const CefString& fileName) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetToBytes(size_t size, const void* bytes) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual Type GetType() =0;
|
|
|
|
|
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-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetFile() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t GetBytesCount() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t GetBytes(size_t size, void* bytes) =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Class used to represent a web response. The methods of this class may be
|
|
|
|
// called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefResponse : public virtual CefBase
|
2011-02-09 23:04:35 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::map<CefString,CefString> HeaderMap;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the response status code.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual int GetStatus() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the response status code.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetStatus(int status) = 0;
|
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
|
|
|
/*--cef()--*/
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual CefString GetStatusText() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the response status text.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetStatusText(const CefString& statusText) = 0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get the response mime type.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetMimeType() = 0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set the response mime type.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetMimeType(const CefString& mimeType) = 0;
|
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
|
|
|
/*--cef()--*/
|
2011-03-24 21:36:47 +01:00
|
|
|
virtual CefString GetHeader(const CefString& name) =0;
|
2011-02-09 23:04:35 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Get all response header fields.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void GetHeaderMap(HeaderMap& headerMap) =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Set all response header fields.
|
|
|
|
///
|
2011-04-21 18:46:16 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void SetHeaderMap(const HeaderMap& headerMap) =0;
|
2011-02-09 23:04:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Interface the client can implement to provide a custom stream reader. The
|
|
|
|
// methods of this class may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefReadHandler : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t Read(void* ptr, size_t size, size_t n) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Seek(long offset, int whence) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual long Tell() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Eof() =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to read data from a stream. The methods of this class may be
|
|
|
|
// called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefStreamReader : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefStreamReader object from a file.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
static CefRefPtr<CefStreamReader> CreateForFile(const CefString& fileName);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefStreamReader object from data.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefStreamReader> CreateForData(void* data, size_t size);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefStreamReader object from a custom handler.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
2011-01-29 02:42:59 +01:00
|
|
|
static CefRefPtr<CefStreamReader> CreateForHandler(
|
|
|
|
CefRefPtr<CefReadHandler> handler);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t Read(void* ptr, size_t size, size_t n) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Seek(long offset, int whence) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual long Tell() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Eof() =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Interface the client can implement to provide a custom stream writer. The
|
|
|
|
// methods of this class may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefWriteHandler : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Write raw binary data.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t Write(const void* ptr, size_t size, size_t n) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Seek(long offset, int whence) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual long Tell() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Flush() =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to write data to a stream. The methods of this class may be called
|
|
|
|
// on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefStreamWriter : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefStreamWriter object for a file.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
static CefRefPtr<CefStreamWriter> CreateForFile(const CefString& fileName);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefStreamWriter object for a custom handler.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-01-29 02:42:59 +01:00
|
|
|
static CefRefPtr<CefStreamWriter> CreateForHandler(
|
|
|
|
CefRefPtr<CefWriteHandler> handler);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t Write(const void* ptr, size_t size, size_t n) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Seek(long offset, int whence) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual long Tell() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int Flush() =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
// Class that encapsulates a V8 context handle.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-21 23:44:06 +01:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefV8Context : public virtual CefBase
|
2011-02-21 23:44:06 +01:00
|
|
|
{
|
|
|
|
public:
|
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()--*/
|
|
|
|
static CefRefPtr<CefV8Context> GetCurrentContext();
|
|
|
|
|
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()--*/
|
|
|
|
static CefRefPtr<CefV8Context> GetEnteredContext();
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefBrowser> GetBrowser() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefFrame> GetFrame() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefV8Value> GetGlobal() =0;
|
2011-04-07 03:58:49 +02:00
|
|
|
|
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 if the scope was
|
|
|
|
// entered successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Enter() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Exit this context. Call this method only after calling Enter(). Returns
|
|
|
|
// true if the scope was exited successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Exit() =0;
|
2011-02-21 23:44:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-10-09 21:21:09 +02:00
|
|
|
typedef std::vector<CefRefPtr<CefV8Value> > CefV8ValueList;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Interface that should be implemented to handle V8 function calls. The methods
|
|
|
|
// of this class will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefV8Handler : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
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 if
|
|
|
|
// the method was handled. To invoke V8 callback functions outside the scope
|
|
|
|
// of this method you need to keep references to the current V8 context
|
|
|
|
// (CefV8Context) along with any necessary callback objects.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool Execute(const CefString& name,
|
2010-10-03 23:04:50 +02:00
|
|
|
CefRefPtr<CefV8Value> object,
|
|
|
|
const CefV8ValueList& arguments,
|
|
|
|
CefRefPtr<CefV8Value>& retval,
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString& exception) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Interface that should be implemented to handle V8 accessor calls. Accessor
|
|
|
|
// identifiers are registered by calling CefV8Value::SetValue(). The methods
|
|
|
|
// of this class will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefV8Accessor : public virtual CefBase
|
2011-04-07 03:58:49 +02:00
|
|
|
{
|
|
|
|
public:
|
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 if handled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Get(const CefString& name,
|
|
|
|
const CefRefPtr<CefV8Value> object,
|
2011-09-20 22:41:54 +02:00
|
|
|
CefRefPtr<CefV8Value>& retval,
|
|
|
|
CefString& exception) =0;
|
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
|
|
|
|
// if handled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Set(const CefString& name,
|
|
|
|
const CefRefPtr<CefV8Value> object,
|
2011-09-20 22:41:54 +02:00
|
|
|
const CefRefPtr<CefV8Value> value,
|
|
|
|
CefString& exception) =0;
|
2011-04-07 03:58:49 +02:00
|
|
|
};
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class representing a V8 value. The methods of this class 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(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefV8Value : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-04-07 03:58:49 +02:00
|
|
|
typedef cef_v8_accesscontrol_t AccessControl;
|
|
|
|
typedef cef_v8_propertyattribute_t PropertyAttribute;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type undefined.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateUndefined();
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type null.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateNull();
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type bool.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateBool(bool value);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type int.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateInt(int value);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type double.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateDouble(double value);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type Date.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-23 19:43:53 +02:00
|
|
|
static CefRefPtr<CefV8Value> CreateDate(const CefTime& date);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type string.
|
|
|
|
///
|
2011-05-23 19:43:53 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
static CefRefPtr<CefV8Value> CreateString(const CefString& value);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type object.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateObject(CefRefPtr<CefBase> user_data);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type object with accessors.
|
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
/*--cef(capi_name=cef_v8value_create_object_with_accessor)--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateObject(CefRefPtr<CefBase> user_data,
|
|
|
|
CefRefPtr<CefV8Accessor> accessor);
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type array.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefV8Value> CreateArray();
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefV8Value object of type function.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
static CefRefPtr<CefV8Value> CreateFunction(const CefString& name,
|
2010-10-03 23:04:50 +02:00
|
|
|
CefRefPtr<CefV8Handler> handler);
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is undefined.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsUndefined() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is null.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsNull() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is bool.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsBool() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is int.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsInt() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is double.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsDouble() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is Date.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-23 19:43:53 +02:00
|
|
|
virtual bool IsDate() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is string.
|
|
|
|
///
|
2011-05-23 19:43:53 +02:00
|
|
|
/*--cef()--*/
|
2010-10-03 23:04:50 +02:00
|
|
|
virtual bool IsString() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is object.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsObject() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is array.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsArray() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// True if the value type is function.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsFunction() =0;
|
2011-04-07 03:58:49 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
// Returns true 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsSame(CefRefPtr<CefV8Value> that) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool GetBoolValue() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int GetIntValue() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual double GetDoubleValue() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Return a Date value. The underlying data will be converted to if
|
|
|
|
// necessary.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-05-23 19:43:53 +02:00
|
|
|
virtual CefTime GetDateValue() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Return a string value. The underlying data will be converted to if
|
|
|
|
// necessary.
|
|
|
|
///
|
2011-05-23 19:43:53 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetStringValue() =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
// OBJECT METHODS - These methods 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 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
|
|
|
/*--cef(capi_name=has_value_bykey)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool HasValue(const CefString& key) =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Returns true if the object has a value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(capi_name=has_value_byindex)--*/
|
|
|
|
virtual bool HasValue(int index) =0;
|
|
|
|
|
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
|
|
|
/*--cef(capi_name=delete_value_bykey)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool DeleteValue(const CefString& key) =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Delete the value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(capi_name=delete_value_byindex)--*/
|
|
|
|
virtual bool DeleteValue(int index) =0;
|
|
|
|
|
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
|
|
|
/*--cef(capi_name=get_value_bykey)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefRefPtr<CefV8Value> GetValue(const CefString& key) =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Returns the value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(capi_name=get_value_byindex)--*/
|
|
|
|
virtual CefRefPtr<CefV8Value> GetValue(int index) =0;
|
|
|
|
|
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
|
|
|
/*--cef(capi_name=set_value_bykey)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool SetValue(const CefString& key, CefRefPtr<CefV8Value> value) =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Associate a value with the specified identifier.
|
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(capi_name=set_value_byindex)--*/
|
|
|
|
virtual bool SetValue(int index, CefRefPtr<CefV8Value> value) =0;
|
|
|
|
|
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 CefV8Accessor
|
|
|
|
// instance passed to CefV8Value::CreateObject().
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-04-07 03:58:49 +02:00
|
|
|
/*--cef(capi_name=set_value_byaccessor)--*/
|
|
|
|
virtual bool SetValue(const CefString& key, AccessControl settings,
|
|
|
|
PropertyAttribute attribute) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool GetKeys(std::vector<CefString>& keys) =0;
|
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 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefBase> GetUserData() =0;
|
|
|
|
|
|
|
|
|
|
|
|
// ARRAY METHODS - These methods 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int GetArrayLength() =0;
|
|
|
|
|
|
|
|
|
|
|
|
// FUNCTION METHODS - These methods 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-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetFunctionName() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefV8Handler> GetFunctionHandler() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool ExecuteFunction(CefRefPtr<CefV8Value> object,
|
|
|
|
const CefV8ValueList& arguments,
|
|
|
|
CefRefPtr<CefV8Value>& retval,
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString& exception) =0;
|
2011-02-21 23:44:06 +01:00
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool ExecuteFunctionWithContext(CefRefPtr<CefV8Context> context,
|
|
|
|
CefRefPtr<CefV8Value> object,
|
|
|
|
const CefV8ValueList& arguments,
|
|
|
|
CefRefPtr<CefV8Value>& retval,
|
|
|
|
CefString& exception) =0;
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class that creates CefSchemeHandler instances. The methods of this class will
|
|
|
|
// always be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefSchemeHandlerFactory : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
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 CefWebURLRequest API |browser| will be NULL.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-10-07 12:13:04 +02:00
|
|
|
virtual CefRefPtr<CefSchemeHandler> Create(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& scheme_name,
|
2011-05-27 18:20:32 +02:00
|
|
|
CefRefPtr<CefRequest> request) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
2011-08-17 03:55:07 +02:00
|
|
|
///
|
|
|
|
// Class used to facilitate asynchronous responses to custom scheme handler
|
|
|
|
// requests. The methods of this class may be called on any thread.
|
|
|
|
///
|
|
|
|
/*--cef(source=library)--*/
|
|
|
|
class CefSchemeHandlerCallback : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
// Notify that header information is now available for retrieval.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual void HeadersAvailable() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Notify that response data is now available for reading.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual void BytesAvailable() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Cancel processing of the request.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Cancel() =0;
|
|
|
|
};
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-17 03:55:07 +02:00
|
|
|
// Class used to implement a custom scheme handler interface. The methods of
|
2011-01-29 02:42:59 +01:00
|
|
|
// this class will always be called on the IO thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefSchemeHandler : public virtual CefBase
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
public:
|
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 and call
|
|
|
|
// HeadersAvailable() once the response header information is available
|
|
|
|
// (HeadersAvailable() can also be called from inside this method if header
|
|
|
|
// information is available immediately). To redirect the request to a new
|
|
|
|
// URL set |redirectUrl| to the new URL and return true. To cancel the request
|
|
|
|
// return false.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
|
2011-04-21 20:17:46 +02:00
|
|
|
CefString& redirectUrl,
|
2011-08-17 03:55:07 +02:00
|
|
|
CefRefPtr<CefSchemeHandlerCallback> callback) =0;
|
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 ReadResponse() will be called until it
|
|
|
|
// returns false. If the response length is known set |response_length|
|
|
|
|
// to a positive value and ReadResponse() will be called until it returns
|
|
|
|
// false 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
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-08-17 03:55:07 +02:00
|
|
|
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
|
|
|
|
int64& response_length) =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// 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. To read the data at a later time set
|
|
|
|
// |bytes_read| to 0, return true and call BytesAvailable() when the data is
|
|
|
|
// available. To indicate response completion return false.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool ReadResponse(void* data_out,
|
|
|
|
int bytes_to_read,
|
|
|
|
int& bytes_read,
|
|
|
|
CefRefPtr<CefSchemeHandlerCallback> callback) =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-08-17 03:55:07 +02:00
|
|
|
// Request processing has been canceled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-03 23:04:50 +02:00
|
|
|
/*--cef()--*/
|
2011-08-17 03:55:07 +02:00
|
|
|
virtual void Cancel() =0;
|
2010-10-03 23:04:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-01-29 02:42:59 +01:00
|
|
|
// Class used to handle file downloads. The methods of this class will always be
|
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefDownloadHandler : public virtual CefBase
|
2010-10-16 21:10:11 +02:00
|
|
|
{
|
|
|
|
public:
|
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 method will be
|
|
|
|
// called multiple times until the download is complete. Return |true| to
|
|
|
|
// continue receiving data and |false| to cancel.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-16 21:10:11 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool ReceivedData(void* data, int data_size) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Complete() =0;
|
|
|
|
};
|
|
|
|
|
2010-10-20 17:12:46 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Class 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 CefClient callbacks will be executed. The
|
2011-02-09 23:04:35 +01:00
|
|
|
// methods of this class may be called on any thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefWebURLRequest : public virtual CefBase
|
2011-02-09 23:04:35 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_weburlrequest_state_t RequestState;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
|
|
|
// Create a new CefWebUrlRequest object.
|
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
static CefRefPtr<CefWebURLRequest> CreateWebURLRequest(
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefWebURLRequestClient> client);
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Cancel() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual RequestState GetState() =0;
|
|
|
|
};
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
// Interface that should be implemented by the CefWebURLRequest client. The
|
|
|
|
// methods of this class will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefWebURLRequestClient : public virtual CefBase
|
2011-02-09 23:04:35 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_weburlrequest_state_t RequestState;
|
2011-05-31 19:12:37 +02:00
|
|
|
typedef cef_handler_errorcode_t ErrorCode;
|
|
|
|
|
|
|
|
///
|
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 methods
|
|
|
|
// are called.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-09 23:04:35 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnStateChange(CefRefPtr<CefWebURLRequest> requester,
|
|
|
|
RequestState state) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnRedirect(CefRefPtr<CefWebURLRequest> requester,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefResponse> response) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnHeadersReceived(CefRefPtr<CefWebURLRequest> requester,
|
|
|
|
CefRefPtr<CefResponse> response) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnProgress(CefRefPtr<CefWebURLRequest> requester,
|
|
|
|
uint64 bytesSent, uint64 totalBytesToBeSent) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnData(CefRefPtr<CefWebURLRequest> requester,
|
|
|
|
const void* data, int dataLength) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void OnError(CefRefPtr<CefWebURLRequest> requester,
|
|
|
|
ErrorCode errorCode) =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Class that supports the reading of XML data via the libxml streaming API.
|
2011-01-29 02:42:59 +01:00
|
|
|
// The methods of this class 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
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefXmlReader : public virtual CefBase
|
2010-10-20 17:12:46 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_xml_encoding_type_t EncodingType;
|
|
|
|
typedef cef_xml_node_type_t NodeType;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Create a new CefXmlReader object. The returned object's methods 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()--*/
|
|
|
|
static CefRefPtr<CefXmlReader> Create(CefRefPtr<CefStreamReader> stream,
|
|
|
|
EncodingType encodingType,
|
2010-11-22 18:49:46 +01:00
|
|
|
const CefString& URI);
|
2010-10-20 17:12:46 +02:00
|
|
|
|
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 method must be
|
|
|
|
// called at least once to set the current cursor position. Returns true if
|
|
|
|
// the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-10-21 17:19:43 +02:00
|
|
|
virtual bool MoveToNextNode() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Close() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns true 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasError() =0;
|
|
|
|
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetError() =0;
|
2010-10-20 17:12:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
// The below methods 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual NodeType GetType() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int GetDepth() =0;
|
|
|
|
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetLocalName() =0;
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetPrefix() =0;
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetQualifiedName() =0;
|
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 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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetNamespaceURI() =0;
|
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 base URI of the node. See http://www.w3.org/TR/xmlbase/ for
|
|
|
|
// additional details.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetBaseURI() =0;
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetXmlLang() =0;
|
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 if the node represents an empty element. <a/> is considered
|
|
|
|
// empty but <a></a> is not.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsEmptyElement() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
// Returns true if the node has a text value.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasValue() =0;
|
|
|
|
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetValue() =0;
|
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 if the node has attributes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasAttributes() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual size_t GetAttributeCount() =0;
|
|
|
|
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef(capi_name=get_attribute_byindex)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetAttribute(int index) =0;
|
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 qualified name.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef(capi_name=get_attribute_byqname)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetAttribute(const CefString& qualifiedName) =0;
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef(capi_name=get_attribute_bylname)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetAttribute(const CefString& localName,
|
2011-02-23 04:45:13 +01:00
|
|
|
const CefString& namespaceURI) =0;
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetInnerXml() =0;
|
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-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetOuterXml() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int GetLineNumber() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
|
2010-10-20 17:12:46 +02:00
|
|
|
// Attribute nodes are not traversed by default. The below methods can be
|
|
|
|
// used to move the cursor to an attribute node. MoveToCarryingElement() 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 if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef(capi_name=move_to_attribute_byindex)--*/
|
|
|
|
virtual bool MoveToAttribute(int index) =0;
|
|
|
|
|
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 if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef(capi_name=move_to_attribute_byqname)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool MoveToAttribute(const CefString& qualifiedName) =0;
|
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 if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef(capi_name=move_to_attribute_bylname)--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool MoveToAttribute(const CefString& localName,
|
|
|
|
const CefString& namespaceURI) =0;
|
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 if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool MoveToFirstAttribute() =0;
|
|
|
|
|
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 if the cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool MoveToNextAttribute() =0;
|
|
|
|
|
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 if the cursor
|
|
|
|
// position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-20 17:12:46 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool MoveToCarryingElement() =0;
|
|
|
|
};
|
|
|
|
|
2010-10-24 18:41:21 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Class that supports the reading of zip archives via the zlib unzip API.
|
2011-01-29 02:42:59 +01:00
|
|
|
// The methods of this class 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
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefZipReader : public virtual CefBase
|
2010-10-24 18:41:21 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Create a new CefZipReader object. The returned object's methods 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()--*/
|
|
|
|
static CefRefPtr<CefZipReader> Create(CefRefPtr<CefStreamReader> stream);
|
|
|
|
|
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 if the
|
|
|
|
// cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool MoveToFirstFile() =0;
|
|
|
|
|
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 if the
|
|
|
|
// cursor position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool MoveToNextFile() =0;
|
|
|
|
|
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 then the search will be case sensitive. Returns true if the cursor
|
|
|
|
// position was set successfully.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Close() =0;
|
|
|
|
|
|
|
|
|
|
|
|
// The below methods 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-10-24 18:41:21 +02:00
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual CefString GetFileName() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual long GetFileSize() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual time_t GetFileLastModified() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual bool OpenFile(const CefString& password) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool CloseFile() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int ReadFile(void* buffer, size_t bufferSize) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual long Tell() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
// Returns true if at end of the file contents.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2010-10-24 18:41:21 +02:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool Eof() =0;
|
|
|
|
};
|
|
|
|
|
2010-11-16 17:45:49 +01:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Interface to implement for visiting the DOM. The methods of this class will
|
|
|
|
// be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefDOMVisitor : public virtual CefBase
|
2011-02-23 04:45:13 +01:00
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
|
// method represents a snapshot of the DOM at the time this method is
|
|
|
|
// executed. DOM objects are only valid for the scope of this method. Do not
|
|
|
|
// keep references to or attempt to access any DOM objects outside the scope
|
|
|
|
// of this method.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Visit(CefRefPtr<CefDOMDocument> document) =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Class used to represent a DOM document. The methods of this class should only
|
|
|
|
// be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefDOMDocument : public virtual CefBase
|
2011-02-23 04:45:13 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_dom_document_type_t Type;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual Type GetType() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetDocument() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetBody() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetHead() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetTitle() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetElementById(const CefString& id) =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetFocusedNode() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if a portion of the document is selected.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasSelection() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetSelectionStartNode() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int GetSelectionStartOffset() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetSelectionEndNode() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual int GetSelectionEndOffset() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetSelectionAsMarkup() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetSelectionAsText() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetBaseURL() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetCompleteURL(const CefString& partialURL) =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Class used to represent a DOM node. The methods of this class should only be
|
|
|
|
// called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefDOMNode : public virtual CefBase
|
2011-02-23 04:45:13 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::map<CefString,CefString> AttributeMap;
|
|
|
|
typedef cef_dom_node_type_t Type;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual Type GetType() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if this is a text node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsText() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if this is an element node.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsElement() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-10 16:17:32 +02:00
|
|
|
// Returns true 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsSame(CefRefPtr<CefDOMNode> that) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetName() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetValue() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Set the value of this node. Returns true on success.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool SetValue(const CefString& value) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetAsMarkup() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMDocument> GetDocument() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetParent() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetPreviousSibling() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetNextSibling() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if this node has child nodes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasChildren() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetFirstChild() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetLastChild() =0;
|
|
|
|
|
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 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
|
|
|
|
// method 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void AddEventListener(const CefString& eventType,
|
|
|
|
CefRefPtr<CefDOMEventListener> listener,
|
|
|
|
bool useCapture) =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
|
2011-02-23 04:45:13 +01:00
|
|
|
// The following methods 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetElementTagName() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if this element has attributes.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasElementAttributes() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if this element has an attribute named |attrName|.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool HasElementAttribute(const CefString& attrName) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetElementAttribute(const CefString& attrName) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void GetElementAttributes(AttributeMap& attrMap) =0;
|
|
|
|
|
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 on
|
|
|
|
// success.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool SetElementAttribute(const CefString& attrName,
|
|
|
|
const CefString& value) =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetElementInnerText() =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Class used to represent a DOM event. The methods of this class should only
|
|
|
|
// be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef(source=library)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefDOMEvent : public virtual CefBase
|
2011-02-23 04:45:13 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef cef_dom_event_category_t Category;
|
|
|
|
typedef cef_dom_event_phase_t Phase;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetType() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual Category GetCategory() =0;
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual Phase GetPhase() =0;
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if the event can bubble up the tree.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool CanBubble() =0;
|
2011-05-31 19:12:37 +02:00
|
|
|
|
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Returns true if the event can be canceled.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool CanCancel() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMDocument> GetDocument() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetTarget() =0;
|
|
|
|
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefRefPtr<CefDOMNode> GetCurrentTarget() =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
// Interface to implement for handling DOM events. The methods of this class
|
|
|
|
// will be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef(source=client)--*/
|
2011-05-20 16:42:25 +02:00
|
|
|
class CefDOMEventListener : public virtual CefBase
|
2011-02-23 04:45:13 +01:00
|
|
|
{
|
|
|
|
public:
|
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 method
|
|
|
|
// contains a snapshot of the DOM at the time this method is executed. DOM
|
|
|
|
// objects are only valid for the scope of this method. Do not keep references
|
|
|
|
// to or attempt to access any DOM objects outside the scope of this method.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-02-23 04:45:13 +01:00
|
|
|
/*--cef()--*/
|
|
|
|
virtual void HandleEvent(CefRefPtr<CefDOMEvent> event) =0;
|
|
|
|
};
|
|
|
|
|
2011-05-24 01:39:07 +02:00
|
|
|
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
// Interface to implement for filtering response content. The methods of this
|
|
|
|
// class will always be called on the UI thread.
|
2011-05-31 19:12:37 +02:00
|
|
|
///
|
2011-05-24 01:39:07 +02:00
|
|
|
/*--cef(source=client)--*/
|
|
|
|
class CefContentFilter : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void ProcessData(const void* data, int data_size,
|
|
|
|
CefRefPtr<CefStreamReader>& 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 ProcessData() 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
|
|
|
/*--cef()--*/
|
|
|
|
virtual void Drain(CefRefPtr<CefStreamReader>& remainder) {}
|
|
|
|
};
|
|
|
|
|
2011-08-22 03:31:55 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
// Class used to represent drag data. The methods of this class may be called
|
|
|
|
// on any thread.
|
|
|
|
///
|
|
|
|
/*--cef(source=library)--*/
|
|
|
|
class CefDragData : public virtual CefBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
// Returns true if the drag data is a link.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsLink() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Returns true if the drag data is a text or html fragment.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsFragment() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Returns true if the drag data is a file.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool IsFile() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the link URL that is being dragged.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetLinkURL() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the title associated with the link being dragged.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetLinkTitle() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the metadata, if any, associated with the link being dragged.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetLinkMetadata() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the plain text fragment that is being dragged.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetFragmentText() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the text/html fragment that is being dragged.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetFragmentHtml() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the base URL that the fragment came from. This value is used for
|
|
|
|
// resolving relative URLs and may be empty.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetFragmentBaseURL() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the extension of the file being dragged out of the browser window.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetFileExtension() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Return the name of the file being dragged out of the browser window.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual CefString GetFileName() =0;
|
|
|
|
|
|
|
|
///
|
|
|
|
// Retrieve the list of file names that are being dragged into the browser
|
|
|
|
// window.
|
|
|
|
///
|
|
|
|
/*--cef()--*/
|
|
|
|
virtual bool GetFileNames(std::vector<CefString>& names) =0;
|
|
|
|
};
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
#endif // _CEF_H
|