From 2779179489e6366847589d823982570769584f25 Mon Sep 17 00:00:00 2001
From: Marshall Greenblatt
Date: Tue, 31 May 2011 17:12:37 +0000
Subject: [PATCH] Change comment format to support automatic document
generation using the CppDoc application.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@249 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
---
include/cef.h | 985 +++++++++++++++++++++++--
include/cef_capi.h | 930 ++++++++++++++++++++++-
include/cef_nplugin.h | 6 +-
include/cef_nplugin_capi.h | 2 +
include/cef_wrapper.h | 69 +-
include/internal/cef_ptr.h | 25 +-
include/internal/cef_string.h | 6 +-
include/internal/cef_string_list.h | 16 +
include/internal/cef_string_map.h | 18 +
include/internal/cef_string_types.h | 18 +
include/internal/cef_string_wrappers.h | 124 +++-
include/internal/cef_time.h | 6 +
include/internal/cef_types.h | 214 ++++++
include/internal/cef_types_linux.h | 4 +
include/internal/cef_types_mac.h | 4 +
include/internal/cef_types_win.h | 4 +
include/internal/cef_types_wrappers.h | 24 +
include/internal/cef_win.h | 10 +
tools/cef_parser.py | 20 +-
19 files changed, 2336 insertions(+), 149 deletions(-)
diff --git a/include/cef.h b/include/cef.h
index 1210e0d60..0fa3ec926 100644
--- a/include/cef.h
+++ b/include/cef.h
@@ -45,6 +45,7 @@
#include "internal/cef_ptr.h"
#include "internal/cef_types_wrappers.h"
+///
// Bring in platform-specific definitions.
#if defined(OS_WIN)
#include "internal/cef_win.h"
@@ -80,44 +81,52 @@ class CefV8Value;
class CefWebURLRequest;
class CefWebURLRequestClient;
-
+///
// 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.
+///
/*--cef()--*/
bool CefInitialize(const CefSettings& settings);
+///
// This function should be called on the main application thread to shut down
// CEF before the application exits.
+///
/*--cef()--*/
void CefShutdown();
+///
// 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.
+///
/*--cef()--*/
void CefDoMessageLoopWork();
+///
// 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.
+///
/*--cef()--*/
void CefRunMessageLoop();
+///
// 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
// in which the prototype of the native function is defined. This function may
// be called on any thread.
-//
+//
// Example JavaScript extension code:
-//
+//
// // create the 'example' global object if it doesn't already exist.
// if (!example)
// example = {};
@@ -155,9 +164,9 @@ void CefRunMessageLoop();
// return myint;
// };
// })();
-//
+//
// Example usage in the page:
-//
+//
// // Call the function.
// example.test.myfunction();
// // Set the parameter.
@@ -166,54 +175,58 @@ void CefRunMessageLoop();
// value = example.test.myparam;
// // Call another function.
// example.test.increment();
-//
+//
+///
/*--cef()--*/
bool CefRegisterExtension(const CefString& extension_name,
const CefString& javascript_code,
CefRefPtr handler);
+///
// Register a custom scheme. This method should not be called for the built-in
// HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
-//
+//
// If |is_standard| is true the scheme will be treated as a standard scheme.
// 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
-//
+//
// In particular, the syntax for standard scheme URLs must be of the form:
-//
-// ://:@:/
-//
+//
+// [scheme]://[username]:[password]@[host]:[port]/[url-path]
+//
// Standard scheme URLs must have a host component that is a fully qualified
// domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC
// 1123. These URLs will be canonicalized to "scheme://host/path" in the
// simplest case and "scheme://username:password@host:port/path" in the most
// explicit case. For example, "scheme:host/path" and "scheme:///host/path" will
// both be canonicalized to "scheme://host/path".
-//
+//
// For non-standard scheme URLs only the "scheme:" component is parsed and
// canonicalized. The remainder of the URL will be passed to the handler as-is.
// For example, "scheme:///some%20text" will remain the same. Non-standard
// scheme URLs cannot be used as a target for form submission.
-//
+//
// If |is_local| is true the scheme will be treated as local (i.e., with the
// same security rules as those applied to "file" URLs). This means that normal
// pages cannot link to or access URLs of this scheme.
-//
+//
// If |is_display_isolated| is true the scheme will be treated as display-
// isolated. This means that pages cannot display these URLs unless they are
// from the same scheme. For example, pages in another origin cannot create
// iframes or hyperlinks to URLs with this scheme.
-//
+//
// This function may be called on any thread. It should only be called once
// per unique |scheme_name| value. If |scheme_name| is already registered or if
// an error occurs this method will return false.
+///
/*--cef()--*/
bool CefRegisterCustomScheme(const CefString& scheme_name,
bool is_standard,
bool is_local,
bool is_display_isolated);
+///
// 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
@@ -224,16 +237,20 @@ bool CefRegisterCustomScheme(const CefString& scheme_name,
// 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.
+///
/*--cef()--*/
bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name,
const CefString& domain_name,
CefRefPtr factory);
+///
// Clear all registered scheme handler factories. Returns false on error. This
// function may be called on any thread.
+///
/*--cef()--*/
bool CefClearSchemeHandlerFactories();
+///
// Add an entry to the cross-origin access whitelist.
//
// The same-origin policy restricts how scripts hosted from different origins
@@ -244,13 +261,13 @@ bool CefClearSchemeHandlerFactories();
// XMLHttpRequest requests on http://target.example.com if the
// http://target.example.com request returns an "Access-Control-Allow-Origin:
// https://source.example.com" response header.
-//
+//
// Scripts in separate frames or iframes and hosted from the same protocol and
// domain suffix can execute cross-origin JavaScript if both pages set the
// document.domain value to the same domain suffix. For example,
// scheme://foo.example.com and scheme://bar.example.com can communicate using
// JavaScript if both domains set document.domain="example.com".
-//
+//
// This 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
@@ -259,27 +276,33 @@ bool CefClearSchemeHandlerFactories();
// 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.
+///
/*--cef()--*/
bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
const CefString& target_protocol,
const CefString& target_domain,
bool allow_target_subdomains);
+///
// Remove an entry from the cross-origin access whitelist. Returns false if
// |source_origin| is invalid or the whitelist cannot be accessed.
+///
/*--cef()--*/
bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
const CefString& target_protocol,
const CefString& target_domain,
bool allow_target_subdomains);
+///
// Remove all entries from the cross-origin access whitelist. Returns false if
// the whitelist cannot be accessed.
+///
/*--cef()--*/
bool CefClearCrossOriginWhitelist();
typedef cef_thread_id_t CefThreadId;
+///
// 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
@@ -288,55 +311,71 @@ typedef cef_thread_id_t CefThreadId;
// 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.
+///
/*--cef()--*/
bool CefCurrentlyOn(CefThreadId threadId);
+///
// Post a task for execution on the specified thread. This function may be
// called on any thread.
+///
/*--cef()--*/
bool CefPostTask(CefThreadId threadId, CefRefPtr task);
+///
// Post a task for delayed execution on the specified thread. This function may
// be called on any thread.
+///
/*--cef()--*/
bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task,
long delay_ms);
+///
// Parse the specified |url| into its component parts.
// Returns false if the URL is empty or invalid.
+///
/*--cef()--*/
bool CefParseURL(const CefString& url,
CefURLParts& parts);
+///
// 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.
+///
/*--cef()--*/
bool CefCreateURL(const CefURLParts& parts,
CefString& url);
+///
// Visit all cookies. The returned cookies are ordered by longest path, then by
// earliest creation date. Returns false if cookies cannot be accessed.
+///
/*--cef()--*/
bool CefVisitAllCookies(CefRefPtr visitor);
+///
// 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.
+///
/*--cef()--*/
bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly,
CefRefPtr visitor);
+///
// 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.
+///
/*--cef()--*/
bool CefSetCookie(const CefString& url, const CefCookie& cookie);
+///
// 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
@@ -344,57 +383,76 @@ bool CefSetCookie(const CefString& url, const CefCookie& cookie);
// 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.
+///
/*--cef()--*/
bool CefDeleteCookies(const CefString& url, const CefString& cookie_name);
+///
// Interface defining the reference count implementation methods. All framework
// classes must extend the CefBase class.
+///
class CefBase
{
public:
+ ///
// 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.
+ ///
virtual int AddRef() =0;
+ ///
// 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.
+ ///
virtual int Release() =0;
+ ///
// Return the current number of references.
+ ///
virtual int GetRefCt() =0;
};
+///
// Class that implements atomic reference counting.
+///
class CefRefCount
{
public:
CefRefCount() : refct_(0) {}
+ ///
// Atomic reference increment.
+ ///
int AddRef() {
return CefAtomicIncrement(&refct_);
}
+ ///
// Atomic reference decrement. Delete the object when no references remain.
+ ///
int Release() {
return CefAtomicDecrement(&refct_);
}
+ ///
// Return the current number of references.
+ ///
int GetRefCt() { return refct_; }
private:
long refct_;
};
+///
// Macro that provides a reference counting implementation for classes extending
// CefBase.
+///
#define IMPLEMENT_REFCOUNTING(ClassName) \
public: \
int AddRef() { return refct_.AddRef(); } \
@@ -408,10 +466,12 @@ private:
private: \
CefRefCount refct_;
+///
// 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.
+///
#define IMPLEMENT_LOCKING(ClassName) \
public: \
class AutoLock { \
@@ -427,37 +487,47 @@ private:
CefCriticalSection critsec_;
+///
// Implement this interface for task execution. The methods of this class may
// be called on any thread.
+///
/*--cef(source=client)--*/
class CefTask : public virtual CefBase
{
public:
+ ///
// Method that will be executed. |threadId| is the thread executing the call.
+ ///
/*--cef()--*/
virtual void Execute(CefThreadId threadId) =0;
};
+///
// Interface to implement for visiting cookie values. The methods of this class
// will always be called on the IO thread.
+///
/*--cef(source=client)--*/
class CefCookieVisitor : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool Visit(const CefCookie& cookie, int count, int total,
bool& deleteCookie) =0;
};
+///
// Class used to represent a browser window. The methods of this class may be
// called on any thread unless otherwise indicated in the comments.
+///
/*--cef(source=library)--*/
class CefBrowser : public virtual CefBase
{
@@ -466,294 +536,415 @@ public:
typedef cef_mouse_button_type_t MouseButtonType;
typedef cef_paint_element_type_t PaintElementType;
+ ///
// Create a new browser window using the window parameters specified by
// |windowInfo|. All values will be copied internally and the actual window
// will be created on the UI thread. This method call will not block.
+ ///
/*--cef()--*/
static bool CreateBrowser(CefWindowInfo& windowInfo,
CefRefPtr client,
const CefString& url,
const CefBrowserSettings& settings);
+ ///
// Create a new browser window using the window parameters specified by
// |windowInfo|. This method should only be called on the UI thread.
+ ///
/*--cef()--*/
static CefRefPtr CreateBrowserSync(CefWindowInfo& windowInfo,
CefRefPtr client,
const CefString& url,
const CefBrowserSettings& settings);
+ ///
// Closes this browser window.
+ ///
/*--cef()--*/
virtual void CloseBrowser() =0;
+ ///
// Returns true if the browser can navigate backwards.
+ ///
/*--cef()--*/
virtual bool CanGoBack() =0;
// Navigate backwards.
+ ///
/*--cef()--*/
virtual void GoBack() =0;
+ ///
// Returns true if the browser can navigate forwards.
+ ///
/*--cef()--*/
virtual bool CanGoForward() =0;
+ ///
// Navigate backwards.
+ ///
/*--cef()--*/
virtual void GoForward() =0;
+ ///
// Reload the current page.
+ ///
/*--cef()--*/
virtual void Reload() =0;
+ ///
// Reload the current page ignoring any cached data.
+ ///
/*--cef()--*/
virtual void ReloadIgnoreCache() =0;
+ ///
// Stop loading the page.
+ ///
/*--cef()--*/
virtual void StopLoad() =0;
+ ///
// Set focus for the browser window. If |enable| is true focus will be set to
// the window. Otherwise, focus will be removed.
+ ///
/*--cef()--*/
virtual void SetFocus(bool enable) =0;
+ ///
// Retrieve the window handle for this browser.
+ ///
/*--cef()--*/
virtual CefWindowHandle GetWindowHandle() =0;
// Returns true if the window is a popup window.
+ ///
/*--cef()--*/
virtual bool IsPopup() =0;
+ ///
// Returns the client for this browser.
+ ///
/*--cef()--*/
virtual CefRefPtr GetClient() =0;
+ ///
// Returns the main (top-level) frame for the browser window.
+ ///
/*--cef()--*/
virtual CefRefPtr GetMainFrame() =0;
+ ///
// Returns the focused frame for the browser window. This method should only
// be called on the UI thread.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFocusedFrame() =0;
+ ///
// Returns the frame with the specified name, or NULL if not found. This
// method should only be called on the UI thread.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFrame(const CefString& name) =0;
+ ///
// Returns the names of all existing frames. This method should only be called
// on the UI thread.
+ ///
/*--cef()--*/
virtual void GetFrameNames(std::vector& names) =0;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void Find(int identifier, const CefString& searchText,
bool forward, bool matchCase, bool findNext) =0;
+ ///
// Cancel all searches that are currently going on.
+ ///
/*--cef()--*/
virtual void StopFinding(bool clearSelection) =0;
+ ///
// Get the zoom level.
+ ///
/*--cef()--*/
virtual double GetZoomLevel() =0;
+ ///
// Change the zoom level to the specified value.
+ ///
/*--cef()--*/
virtual void SetZoomLevel(double zoomLevel) =0;
+ ///
// Open developer tools in its own window.
+ ///
/*--cef()--*/
virtual void ShowDevTools() =0;
+ ///
// Explicitly close the developer tools window if one exists for this browser
// instance.
+ ///
/*--cef()--*/
virtual void CloseDevTools() =0;
+ ///
// Returns true if window rendering is disabled.
+ ///
/*--cef()--*/
virtual bool IsWindowRenderingDisabled() =0;
+ ///
// Get the size of the specified element. This method should only be called on
// the UI thread.
+ ///
/*--cef()--*/
virtual bool GetSize(PaintElementType type, int& width, int& height) =0;
+ ///
// Set the size of the specified element. This method is only used when window
// rendering is disabled.
+ ///
/*--cef()--*/
virtual void SetSize(PaintElementType type, int width, int height) =0;
+ ///
// Returns true if a popup is currently visible. This method should only be
// called on the UI thread.
+ ///
/*--cef()--*/
virtual bool IsPopupVisible() =0;
+ ///
// Hide the currently visible popup, if any.
+ ///
/*--cef()--*/
virtual void HidePopup() =0;
+ ///
// 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().
+ ///
/*--cef()--*/
virtual void Invalidate(const CefRect& dirtyRect) =0;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool GetImage(PaintElementType type, int width, int height,
void* buffer) =0;
+ ///
// Send a key event to the browser.
+ ///
/*--cef()--*/
virtual void SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar,
bool imeChar) =0;
+ ///
// Send a mouse click event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
+ ///
/*--cef()--*/
virtual void SendMouseClickEvent(int x, int y, MouseButtonType type,
bool mouseUp, int clickCount) =0;
+ ///
// Send a mouse move event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
+ ///
/*--cef()--*/
virtual void SendMouseMoveEvent(int x, int y, bool mouseLeave) =0;
+ ///
// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
+ ///
/*--cef()--*/
virtual void SendMouseWheelEvent(int x, int y, int delta) =0;
+ ///
// Send a focus event to the browser.
+ ///
/*--cef()--*/
virtual void SendFocusEvent(bool setFocus) =0;
+ ///
// Send a capture lost event to the browser.
+ ///
/*--cef()--*/
virtual void SendCaptureLostEvent() =0;
};
+///
// 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.
+///
/*--cef(source=library)--*/
class CefFrame : public virtual CefBase
{
public:
+ ///
// Execute undo in this frame.
+ ///
/*--cef()--*/
virtual void Undo() =0;
+ ///
// Execute redo in this frame.
+ ///
/*--cef()--*/
virtual void Redo() =0;
+ ///
// Execute cut in this frame.
+ ///
/*--cef()--*/
virtual void Cut() =0;
+ ///
// Execute copy in this frame.
+ ///
/*--cef()--*/
virtual void Copy() =0;
+ ///
// Execute paste in this frame.
+ ///
/*--cef()--*/
virtual void Paste() =0;
+ ///
// Execute delete in this frame.
+ ///
/*--cef(capi_name=del)--*/
virtual void Delete() =0;
+ ///
// Execute select all in this frame.
+ ///
/*--cef()--*/
virtual void SelectAll() =0;
+ ///
// Execute printing in the this frame. The user will be prompted with the
// print dialog appropriate to the operating system.
+ ///
/*--cef()--*/
virtual void Print() =0;
+ ///
// Save this frame's HTML source to a temporary file and open it in the
// default text viewing application.
+ ///
/*--cef()--*/
virtual void ViewSource() =0;
+ ///
// Returns this frame's HTML source as a string. This method should only be
// called on the UI thread.
+ ///
/*--cef()--*/
virtual CefString GetSource() =0;
+ ///
// Returns this frame's display text as a string. This method should only be
// called on the UI thread.
+ ///
/*--cef()--*/
virtual CefString GetText() =0;
+ ///
// Load the request represented by the |request| object.
+ ///
/*--cef()--*/
virtual void LoadRequest(CefRefPtr request) =0;
+ ///
// Load the specified |url|.
+ ///
/*--cef()--*/
virtual void LoadURL(const CefString& url) =0;
-
+
+ ///
// Load the contents of |string| with the optional dummy target |url|.
+ ///
/*--cef()--*/
virtual void LoadString(const CefString& string,
const CefString& url) =0;
+ ///
// Load the contents of |stream| with the optional dummy target |url|.
+ ///
/*--cef()--*/
virtual void LoadStream(CefRefPtr stream,
const CefString& url) =0;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void ExecuteJavaScript(const CefString& jsCode,
const CefString& scriptUrl,
int startLine) =0;
+ ///
// Returns true if this is the main frame.
+ ///
/*--cef()--*/
virtual bool IsMain() =0;
+ ///
// Returns true if this is the focused frame. This method should only be
// called on the UI thread.
+ ///
/*--cef()--*/
virtual bool IsFocused() =0;
+ ///
// Returns this frame's name.
+ ///
/*--cef()--*/
virtual CefString GetName() =0;
+ ///
// Returns the URL currently loaded in this frame. This method should only be
// called on the UI thread.
+ ///
/*--cef()--*/
virtual CefString GetURL() =0;
+ ///
// Returns the browser that this frame belongs to.
+ ///
/*--cef()--*/
virtual CefRefPtr GetBrowser() =0;
+ ///
// Visit the DOM document.
+ ///
/*--cef()--*/
virtual void VisitDOM(CefRefPtr visitor) =0;
};
+///
// Implement this interface to handle events related to browser life span. The
// methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefLifeSpanHandler : public virtual CefBase
{
public:
+ ///
// 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
@@ -763,6 +954,7 @@ public:
// 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.
+ ///
/*--cef()--*/
virtual bool OnBeforePopup(CefRefPtr parentBrowser,
const CefPopupFeatures& popupFeatures,
@@ -771,50 +963,62 @@ public:
CefRefPtr& client,
CefBrowserSettings& settings) { return false; }
+ ///
// Called after a new window is created.
+ ///
/*--cef()--*/
virtual void OnAfterCreated(CefRefPtr browser) {}
+ ///
// Called just before a window is closed.
+ ///
/*--cef()--*/
virtual void OnBeforeClose(CefRefPtr browser) {}
};
+///
// Implement this interface to handle events related to browser load status. The
// methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefLoadHandler : public virtual CefBase
{
public:
typedef cef_handler_errorcode_t ErrorCode;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnLoadStart(CefRefPtr browser,
CefRefPtr frame) {}
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnLoadEnd(CefRefPtr browser,
CefRefPtr frame,
int httpStatusCode) {}
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool OnLoadError(CefRefPtr browser,
CefRefPtr frame,
@@ -824,17 +1028,21 @@ public:
};
+///
// Implement this interface to handle events related to browser requests. The
// methods of this class will be called on the thread indicated.
+///
/*--cef(source=client)--*/
class CefRequestHandler : public virtual CefBase
{
public:
typedef cef_handler_navtype_t NavType;
+ ///
// Called on the UI thread before browser navigation. The client has an
// opportunity to modify the |request| object if desired. Return true to
// cancel the navigation or false to allow the navigation to proceed.
+ ///
/*--cef()--*/
virtual bool OnBeforeBrowse(CefRefPtr browser,
CefRefPtr frame,
@@ -842,6 +1050,7 @@ public:
NavType navType,
bool isRedirect) { return false; }
+ ///
// Called on the IO thread before a resource is loaded. To allow the resource
// 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
@@ -850,6 +1059,7 @@ public:
// 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.
+ ///
/*--cef()--*/
virtual bool OnBeforeResourceLoad(CefRefPtr browser,
CefRefPtr request,
@@ -858,15 +1068,18 @@ public:
CefRefPtr response,
int loadFlags) { return false; }
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnResourceReponse(CefRefPtr browser,
const CefString& url,
CefRefPtr response,
CefRefPtr& filter) {}
+ ///
// Called on the IO thread to handle requests for URLs with an unknown
// protocol component. Return true to indicate that the request should
// succeed because it was handled externally. Set |allowOSExecution| to true
@@ -876,11 +1089,13 @@ public:
// with an error condition.
// SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED
// ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
+ ///
/*--cef()--*/
virtual bool OnProtocolExecution(CefRefPtr browser,
const CefString& url,
bool& allowOSExecution) { return false; }
+ ///
// 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
@@ -888,6 +1103,7 @@ public:
// 'Content-Size' header or -1 if no size was provided. Set |handler| to the
// CefDownloadHandler instance that will recieve the file contents. Return
// true to download the file or false to cancel the file download.
+ ///
/*--cef()--*/
virtual bool GetDownloadHandler(CefRefPtr browser,
const CefString& mimeType,
@@ -896,10 +1112,12 @@ public:
CefRefPtr& handler)
{ return false; }
+ ///
// 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
// true to handle the request. Return false to cancel the request.
+ ///
/*--cef()--*/
virtual bool GetAuthCredentials(CefRefPtr browser,
bool isProxy,
@@ -911,49 +1129,63 @@ public:
};
+///
// Implement this interface to handle events related to browser display state.
// The methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefDisplayHandler : public virtual CefBase
{
public:
typedef cef_handler_statustype_t StatusType;
+ ///
// Called when the navigation state has changed.
+ ///
/*--cef()--*/
virtual void OnNavStateChange(CefRefPtr browser,
bool canGoBack,
bool canGoForward) {}
+ ///
// Called when a frame's address has changed.
+ ///
/*--cef()--*/
virtual void OnAddressChange(CefRefPtr browser,
CefRefPtr frame,
const CefString& url) {}
+ ///
// Called when the page title changes.
+ ///
/*--cef()--*/
virtual void OnTitleChange(CefRefPtr browser,
const CefString& title) {}
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool OnTooltip(CefRefPtr browser,
CefString& text) { return false; }
-
+
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnStatusMessage(CefRefPtr browser,
const CefString& value,
StatusType type) {}
+ ///
// Called to display a console message. Return true to stop the message from
// being output to the console.
+ ///
/*--cef()--*/
virtual bool OnConsoleMessage(CefRefPtr browser,
const CefString& message,
@@ -962,38 +1194,47 @@ public:
};
+///
// Implement this interface to handle events related to focus. The methods of
// this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefFocusHandler : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnTakeFocus(CefRefPtr browser,
bool next) {}
+ ///
// Called when the browser component is requesting focus. |isWidget| will be
// true if the focus is requested for a child widget of the browser window.
// Return false to allow the focus to be set or true to cancel setting the
// focus.
+ ///
/*--cef()--*/
virtual bool OnSetFocus(CefRefPtr browser,
bool isWidget) { return false; }
};
+///
// Implement this interface to handle events related to keyboard input. The
// methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefKeyboardHandler : public virtual CefBase
{
public:
typedef cef_handler_keyevent_type_t KeyEventType;
+ ///
// 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
@@ -1001,6 +1242,7 @@ public:
// 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.
+ ///
/*--cef()--*/
virtual bool OnKeyEvent(CefRefPtr browser,
KeyEventType type,
@@ -1010,8 +1252,10 @@ public:
};
+///
// Implement this interface to handle events related to browser context menus.
// The methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefMenuHandler : public virtual CefBase
{
@@ -1019,46 +1263,57 @@ public:
typedef cef_handler_menuid_t MenuId;
typedef cef_handler_menuinfo_t MenuInfo;
+ ///
// Called before a context menu is displayed. Return false to display the
// default context menu or true to cancel the display.
+ ///
/*--cef()--*/
virtual bool OnBeforeMenu(CefRefPtr browser,
const MenuInfo& menuInfo) { return false; }
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void GetMenuLabel(CefRefPtr browser,
MenuId menuId,
CefString& label) {}
+ ///
// Called when an option is selected from the default context menu. Return
// false to execute the default action or true to cancel the action.
+ ///
/*--cef()--*/
virtual bool OnMenuAction(CefRefPtr browser,
MenuId menuId) { return false; }
};
+///
// Implement this interface to handle events related to printing. The methods of
// this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefPrintHandler : public virtual CefBase
{
public:
typedef cef_print_options_t CefPrintOptions;
-
+
+ ///
// 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|.
+ ///
/*--cef()--*/
virtual bool GetPrintOptions(CefRefPtr browser,
CefPrintOptions& printOptions) { return false; }
+ ///
// 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
@@ -1068,6 +1323,7 @@ public:
// 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.
+ ///
/*--cef()--*/
virtual bool GetPrintHeaderFooter(CefRefPtr browser,
CefRefPtr frame,
@@ -1085,18 +1341,22 @@ public:
};
+///
// Implement this interface to handle events related to find results. The
// methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefFindHandler : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnFindResult(CefRefPtr browser,
int identifier,
@@ -1107,32 +1367,40 @@ public:
};
+///
// Implement this interface to handle events related to JavaScript dialogs. The
// methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefJSDialogHandler : public virtual CefBase
{
public:
+ ///
// Called to run a JavaScript alert message. Return false to display the
// default alert or true if you displayed a custom alert.
+ ///
/*--cef()--*/
virtual bool OnJSAlert(CefRefPtr browser,
CefRefPtr frame,
const CefString& message) { return false; }
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool OnJSConfirm(CefRefPtr browser,
CefRefPtr frame,
const CefString& message,
bool& retval) { return false; }
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool OnJSPrompt(CefRefPtr browser,
CefRefPtr frame,
@@ -1143,13 +1411,17 @@ public:
};
+///
// Implement this interface to handle JavaScript binding. The methods of this
// class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefJSBindingHandler : public virtual CefBase
{
public:
+ ///
// Called for adding values to a frame's JavaScript 'window' object.
+ ///
/*--cef()--*/
virtual void OnJSBinding(CefRefPtr browser,
CefRefPtr frame,
@@ -1157,28 +1429,36 @@ public:
};
+///
// Implement this interface to handle events when window rendering is disabled.
// The methods of this class will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefRenderHandler : public virtual CefBase
{
public:
typedef cef_paint_element_type_t PaintElementType;
+ ///
// Called to retrieve the view rectangle which is relative to screen
// coordinates. Return true if the rectangle was provided.
+ ///
/*--cef()--*/
virtual bool GetViewRect(CefRefPtr browser,
CefRect& rect) { return false; }
+ ///
// Called to retrieve the simulated screen rectangle. Return true if the
// rectangle was provided.
+ ///
/*--cef()--*/
virtual bool GetScreenRect(CefRefPtr browser,
CefRect& rect) { return false; }
+ ///
// Called to retrieve the translation from view coordinates to actual screen
// coordinates. Return true if the screen coordinates were provided.
+ ///
/*--cef()--*/
virtual bool GetScreenPoint(CefRefPtr browser,
int viewX,
@@ -1186,93 +1466,129 @@ public:
int& screenX,
int& screenY) { return false; }
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnPopupShow(CefRefPtr browser,
bool show) {}
+ ///
// Called when the browser wants to move or resize the popup widget. |rect|
// contains the new location and size.
+ ///
/*--cef()--*/
virtual void OnPopupSize(CefRefPtr browser,
const CefRect& rect) {}
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void OnPaint(CefRefPtr browser,
PaintElementType type,
const CefRect& dirtyRect,
const void* buffer) {}
+ ///
// Called when the browser window's cursor has changed.
+ ///
/*--cef()--*/
virtual void OnCursorChange(CefRefPtr browser,
CefCursorHandle cursor) {}
};
+///
// Implement this interface to provide handler implementations.
+///
/*--cef(source=client)--*/
class CefClient : public virtual CefBase
{
public:
+ ///
// Return the handler for browser life span events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetLifeSpanHandler() { return NULL; }
+ ///
// Return the handler for browser load status events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetLoadHandler() { return NULL; }
+ ///
// Return the handler for browser request events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetRequestHandler() { return NULL; }
+ ///
// Return the handler for browser display state events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetDisplayHandler() { return NULL; }
+ ///
// Return the handler for focus events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFocusHandler() { return NULL; }
+ ///
// Return the handler for keyboard events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetKeyboardHandler() { return NULL; }
+ ///
// Return the handler for context menu events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetMenuHandler() { return NULL; }
+ ///
// Return the handler for printing events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetPrintHandler() { return NULL; }
+ ///
// Return the handler for find result events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFindHandler() { return NULL; }
+ ///
// Return the handler for JavaScript dialog events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetJSDialogHandler() { return NULL; }
+ ///
// Return the handler for JavaScript binding events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetJSBindingHandler() { return NULL; }
+ ///
// Return the handler for off-screen rendering events.
+ ///
/*--cef()--*/
virtual CefRefPtr GetRenderHandler() { return NULL; }
};
+///
// Class used to represent a web request. The methods of this class may be
// called on any thread.
+///
/*--cef(source=library)--*/
class CefRequest : public virtual CefBase
{
@@ -1280,327 +1596,489 @@ public:
typedef std::map HeaderMap;
typedef cef_weburlrequest_flags_t RequestFlags;
+ ///
// Create a new CefRequest object.
+ ///
/*--cef()--*/
static CefRefPtr CreateRequest();
- // Fully qualified URL to load.
+ ///
+ // Get the fully qualified URL.
+ ///
/*--cef()--*/
virtual CefString GetURL() =0;
+ ///
+ // Set the fully qualified URL.
+ ///
/*--cef()--*/
virtual void SetURL(const CefString& url) =0;
- // Optional request method type, defaulting to POST if post data is provided
- // and GET otherwise.
+ ///
+ // Get the request method type. The value will default to POST if post data
+ // is provided and GET otherwise.
+ ///
/*--cef()--*/
virtual CefString GetMethod() =0;
+ ///
+ // Set the request method type.
+ ///
/*--cef()--*/
virtual void SetMethod(const CefString& method) =0;
- // Optional post data.
+ ///
+ // Get the post data.
+ ///
/*--cef()--*/
virtual CefRefPtr GetPostData() =0;
+ ///
+ // Set the post data.
+ ///
/*--cef()--*/
virtual void SetPostData(CefRefPtr postData) =0;
- // Optional header values.
+ ///
+ // Get the header values.
+ ///
/*--cef()--*/
virtual void GetHeaderMap(HeaderMap& headerMap) =0;
+ ///
+ // Set the header values.
+ ///
/*--cef()--*/
virtual void SetHeaderMap(const HeaderMap& headerMap) =0;
+ ///
// Set all values at one time.
+ ///
/*--cef()--*/
virtual void Set(const CefString& url,
const CefString& method,
CefRefPtr postData,
const HeaderMap& headerMap) =0;
- // Optional flags. Used in combination with CefWebURLRequest.
+ ///
+ // Get the flags used in combination with CefWebURLRequest.
+ ///
/*--cef()--*/
virtual RequestFlags GetFlags() =0;
+ ///
+ // Set the flags used in combination with CefWebURLRequest.
+ ///
/*--cef()--*/
virtual void SetFlags(RequestFlags flags) =0;
- // Optional URL to the first party for cookies. Used in combination with
+ ///
+ // Set the URL to the first party for cookies used in combination with
// CefWebURLRequest.
+ ///
/*--cef()--*/
virtual CefString GetFirstPartyForCookies() =0;
+ ///
+ // Get the URL to the first party for cookies used in combination with
+ // CefWebURLRequest.
+ ///
/*--cef()--*/
virtual void SetFirstPartyForCookies(const CefString& url) =0;
};
+///
// Class used to represent post data for a web request. The methods of this
// class may be called on any thread.
+///
/*--cef(source=library)--*/
class CefPostData : public virtual CefBase
{
public:
typedef std::vector > ElementVector;
+ ///
// Create a new CefPostData object.
+ ///
/*--cef()--*/
static CefRefPtr CreatePostData();
+ ///
// Returns the number of existing post data elements.
+ ///
/*--cef()--*/
virtual size_t GetElementCount() =0;
+ ///
// Retrieve the post data elements.
+ ///
/*--cef()--*/
virtual void GetElements(ElementVector& elements) =0;
+ ///
// Remove the specified post data element. Returns true if the removal
// succeeds.
+ ///
/*--cef()--*/
virtual bool RemoveElement(CefRefPtr element) =0;
+ ///
// Add the specified post data element. Returns true if the add succeeds.
+ ///
/*--cef()--*/
virtual bool AddElement(CefRefPtr element) =0;
+ ///
// Remove all existing post data elements.
+ ///
/*--cef()--*/
virtual void RemoveElements() =0;
};
+///
// Class used to represent a single element in the request post data. The
// methods of this class may be called on any thread.
+///
/*--cef(source=library)--*/
class CefPostDataElement : public virtual CefBase
{
public:
+ ///
// Post data elements may represent either bytes or files.
+ ///
typedef cef_postdataelement_type_t Type;
+ ///
// Create a new CefPostDataElement object.
+ ///
/*--cef()--*/
static CefRefPtr CreatePostDataElement();
+ ///
// Remove all contents from the post data element.
+ ///
/*--cef()--*/
virtual void SetToEmpty() =0;
+ ///
// The post data element will represent a file.
+ ///
/*--cef()--*/
virtual void SetToFile(const CefString& fileName) =0;
+ ///
// The post data element will represent bytes. The bytes passed
// in will be copied.
+ ///
/*--cef()--*/
virtual void SetToBytes(size_t size, const void* bytes) =0;
+ ///
// Return the type of this post data element.
+ ///
/*--cef()--*/
virtual Type GetType() =0;
+ ///
// Return the file name.
+ ///
/*--cef()--*/
virtual CefString GetFile() =0;
+ ///
// Return the number of bytes.
+ ///
/*--cef()--*/
virtual size_t GetBytesCount() =0;
+ ///
// Read up to |size| bytes into |bytes| and return the number of bytes
// actually read.
+ ///
/*--cef()--*/
virtual size_t GetBytes(size_t size, void* bytes) =0;
};
+///
// Class used to represent a web response. The methods of this class may be
// called on any thread.
+///
/*--cef(source=library)--*/
class CefResponse : public virtual CefBase
{
public:
typedef std::map HeaderMap;
- // Returns/sets the response status code.
+ ///
+ // Get the response status code.
+ ///
/*--cef()--*/
virtual int GetStatus() =0;
+ ///
+ // Set the response status code.
+ ///
/*--cef()--*/
virtual void SetStatus(int status) = 0;
- // Returns/sets the response status text.
+ ///
+ // Get the response status text.
+ ///
/*--cef()--*/
virtual CefString GetStatusText() =0;
+ ///
+ // Set the response status text.
+ ///
/*--cef()--*/
virtual void SetStatusText(const CefString& statusText) = 0;
- // Returns/sets the response mime type.
+ ///
+ // Get the response mime type.
+ ///
/*--cef()--*/
virtual CefString GetMimeType() = 0;
+ ///
+ // Set the response mime type.
+ ///
/*--cef()--*/
virtual void SetMimeType(const CefString& mimeType) = 0;
- // Returns the value for the specified response header field.
+ ///
+ // Get the value for the specified response header field.
+ ///
/*--cef()--*/
virtual CefString GetHeader(const CefString& name) =0;
- // Retrieves/sets a map of all response header fields.
+ ///
+ // Get all response header fields.
+ ///
/*--cef()--*/
virtual void GetHeaderMap(HeaderMap& headerMap) =0;
+ ///
+ // Set all response header fields.
+ ///
/*--cef()--*/
virtual void SetHeaderMap(const HeaderMap& headerMap) =0;
};
+///
// Interface the client can implement to provide a custom stream reader. The
// methods of this class may be called on any thread.
+///
/*--cef(source=client)--*/
class CefReadHandler : public virtual CefBase
{
public:
+ ///
// Read raw binary data.
+ ///
/*--cef()--*/
virtual size_t Read(void* ptr, size_t size, size_t n) =0;
-
+
+ ///
// Seek to the specified offset position. |whence| may be any one of
// SEEK_CUR, SEEK_END or SEEK_SET.
+ ///
/*--cef()--*/
virtual int Seek(long offset, int whence) =0;
-
+
+ ///
// Return the current offset position.
+ ///
/*--cef()--*/
virtual long Tell() =0;
+ ///
// Return non-zero if at end of file.
+ ///
/*--cef()--*/
virtual int Eof() =0;
};
+///
// Class used to read data from a stream. The methods of this class may be
// called on any thread.
+///
/*--cef(source=library)--*/
class CefStreamReader : public virtual CefBase
{
public:
- // Create a new CefStreamReader object.
+ ///
+ // Create a new CefStreamReader object from a file.
+ ///
/*--cef()--*/
static CefRefPtr CreateForFile(const CefString& fileName);
+ ///
+ // Create a new CefStreamReader object from data.
+ ///
/*--cef()--*/
static CefRefPtr CreateForData(void* data, size_t size);
- /*--cef()--*/
+ ///
+ // Create a new CefStreamReader object from a custom handler.
+ ///
+ /*--cef()--*/
static CefRefPtr CreateForHandler(
CefRefPtr handler);
+ ///
// Read raw binary data.
+ ///
/*--cef()--*/
virtual size_t Read(void* ptr, size_t size, size_t n) =0;
-
+
+ ///
// 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.
+ ///
/*--cef()--*/
virtual int Seek(long offset, int whence) =0;
-
+
+ ///
// Return the current offset position.
+ ///
/*--cef()--*/
virtual long Tell() =0;
+ ///
// Return non-zero if at end of file.
+ ///
/*--cef()--*/
virtual int Eof() =0;
};
+///
// Interface the client can implement to provide a custom stream writer. The
// methods of this class may be called on any thread.
+///
/*--cef(source=client)--*/
class CefWriteHandler : public virtual CefBase
{
public:
- // Write raw binary data.
+ ///
+ // Write raw binary data.
+ ///
/*--cef()--*/
virtual size_t Write(const void* ptr, size_t size, size_t n) =0;
-
+
+ ///
// Seek to the specified offset position. |whence| may be any one of
// SEEK_CUR, SEEK_END or SEEK_SET.
+ ///
/*--cef()--*/
virtual int Seek(long offset, int whence) =0;
-
+
+ ///
// Return the current offset position.
+ ///
/*--cef()--*/
virtual long Tell() =0;
+ ///
// Flush the stream.
+ ///
/*--cef()--*/
virtual int Flush() =0;
};
+///
// Class used to write data to a stream. The methods of this class may be called
// on any thread.
+///
/*--cef(source=library)--*/
class CefStreamWriter : public virtual CefBase
{
public:
- // Create a new CefStreamWriter object.
+ ///
+ // Create a new CefStreamWriter object for a file.
+ ///
/*--cef()--*/
static CefRefPtr CreateForFile(const CefString& fileName);
+ ///
+ // Create a new CefStreamWriter object for a custom handler.
+ ///
/*--cef()--*/
static CefRefPtr CreateForHandler(
CefRefPtr handler);
+ ///
// Write raw binary data.
+ ///
/*--cef()--*/
virtual size_t Write(const void* ptr, size_t size, size_t n) =0;
+ ///
// Seek to the specified offset position. |whence| may be any one of
// SEEK_CUR, SEEK_END or SEEK_SET.
+ ///
/*--cef()--*/
virtual int Seek(long offset, int whence) =0;
+ ///
// Return the current offset position.
+ ///
/*--cef()--*/
virtual long Tell() =0;
+ ///
// Flush the stream.
+ ///
/*--cef()--*/
virtual int Flush() =0;
};
+///
// Class that encapsulates a V8 context handle.
+///
/*--cef(source=library)--*/
class CefV8Context : public virtual CefBase
{
public:
+ ///
// Returns the current (top) context object in the V8 context stack.
+ ///
/*--cef()--*/
static CefRefPtr GetCurrentContext();
+ ///
// Returns the entered (bottom) context object in the V8 context stack.
+ ///
/*--cef()--*/
static CefRefPtr GetEnteredContext();
+ ///
// Returns the browser for this context.
+ ///
/*--cef()--*/
virtual CefRefPtr GetBrowser() =0;
+ ///
// Returns the frame for this context.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFrame() =0;
+ ///
// Returns the global object for this context.
+ ///
/*--cef()--*/
virtual CefRefPtr GetGlobal() =0;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool Enter() =0;
+ ///
// Exit this context. Call this method only after calling Enter(). Returns
// true if the scope was exited successfully.
+ ///
/*--cef()--*/
virtual bool Exit() =0;
};
@@ -1608,16 +2086,20 @@ public:
typedef std::vector > CefV8ValueList;
+///
// Interface that should be implemented to handle V8 function calls. The methods
// of this class will always be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefV8Handler : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool Execute(const CefString& name,
CefRefPtr object,
@@ -1626,25 +2108,31 @@ public:
CefString& exception) =0;
};
+///
// 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.
+///
/*--cef(source=client)--*/
class CefV8Accessor : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool Get(const CefString& name,
const CefRefPtr object,
CefRefPtr& retval) =0;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool Set(const CefString& name,
const CefRefPtr object,
@@ -1652,8 +2140,10 @@ public:
};
+///
// Class representing a V8 value. The methods of this class should only be
// called on the UI thread.
+///
/*--cef(source=library)--*/
class CefV8Value : public virtual CefBase
{
@@ -1661,69 +2151,150 @@ public:
typedef cef_v8_accesscontrol_t AccessControl;
typedef cef_v8_propertyattribute_t PropertyAttribute;
- // Create a new CefV8Value object of the specified type.
+ ///
+ // Create a new CefV8Value object of type undefined.
+ ///
/*--cef()--*/
static CefRefPtr CreateUndefined();
+ ///
+ // Create a new CefV8Value object of type null.
+ ///
/*--cef()--*/
static CefRefPtr CreateNull();
+ ///
+ // Create a new CefV8Value object of type bool.
+ ///
/*--cef()--*/
static CefRefPtr CreateBool(bool value);
+ ///
+ // Create a new CefV8Value object of type int.
+ ///
/*--cef()--*/
static CefRefPtr CreateInt(int value);
+ ///
+ // Create a new CefV8Value object of type double.
+ ///
/*--cef()--*/
static CefRefPtr CreateDouble(double value);
+ ///
+ // Create a new CefV8Value object of type Date.
+ ///
/*--cef()--*/
static CefRefPtr CreateDate(const CefTime& date);
+ ///
+ // Create a new CefV8Value object of type string.
+ ///
/*--cef()--*/
static CefRefPtr CreateString(const CefString& value);
+ ///
+ // Create a new CefV8Value object of type object.
+ ///
/*--cef()--*/
static CefRefPtr CreateObject(CefRefPtr user_data);
+ ///
+ // Create a new CefV8Value object of type object with accessors.
+ ///
/*--cef(capi_name=cef_v8value_create_object_with_accessor)--*/
static CefRefPtr CreateObject(CefRefPtr user_data,
CefRefPtr accessor);
+ ///
+ // Create a new CefV8Value object of type array.
+ ///
/*--cef()--*/
static CefRefPtr CreateArray();
+ ///
+ // Create a new CefV8Value object of type function.
+ ///
/*--cef()--*/
static CefRefPtr CreateFunction(const CefString& name,
CefRefPtr handler);
- // Check the value type.
+ ///
+ // True if the value type is undefined.
+ ///
/*--cef()--*/
virtual bool IsUndefined() =0;
+ ///
+ // True if the value type is null.
+ ///
/*--cef()--*/
virtual bool IsNull() =0;
+ ///
+ // True if the value type is bool.
+ ///
/*--cef()--*/
virtual bool IsBool() =0;
+ ///
+ // True if the value type is int.
+ ///
/*--cef()--*/
virtual bool IsInt() =0;
+ ///
+ // True if the value type is double.
+ ///
/*--cef()--*/
virtual bool IsDouble() =0;
+ ///
+ // True if the value type is Date.
+ ///
/*--cef()--*/
virtual bool IsDate() =0;
+ ///
+ // True if the value type is string.
+ ///
/*--cef()--*/
virtual bool IsString() =0;
+ ///
+ // True if the value type is object.
+ ///
/*--cef()--*/
virtual bool IsObject() =0;
+ ///
+ // True if the value type is array.
+ ///
/*--cef()--*/
virtual bool IsArray() =0;
+ ///
+ // True if the value type is function.
+ ///
/*--cef()--*/
virtual bool IsFunction() =0;
+ ///
// Returns true if this object is pointing to the same handle as |that|
// object.
+ ///
/*--cef()--*/
virtual bool IsSame(CefRefPtr that) =0;
- // Return a primitive value type. The underlying data will be converted to
- // the requested type if necessary.
+ ///
+ // Return a bool value. The underlying data will be converted to if
+ // necessary.
+ ///
/*--cef()--*/
virtual bool GetBoolValue() =0;
+ ///
+ // Return an int value. The underlying data will be converted to if
+ // necessary.
+ ///
/*--cef()--*/
virtual int GetIntValue() =0;
+ ///
+ // Return a double value. The underlying data will be converted to if
+ // necessary.
+ ///
/*--cef()--*/
virtual double GetDoubleValue() =0;
+ ///
+ // Return a Date value. The underlying data will be converted to if
+ // necessary.
+ ///
/*--cef()--*/
virtual CefTime GetDateValue() =0;
+ ///
+ // Return a string value. The underlying data will be converted to if
+ // necessary.
+ ///
/*--cef()--*/
virtual CefString GetStringValue() =0;
@@ -1733,71 +2304,107 @@ public:
// interchangably with the framework converting between them as necessary.
// Keys beginning with "Cef::" and "v8::" are reserved by the system.
+ ///
// Returns true if the object has a value with the specified identifier.
+ ///
/*--cef(capi_name=has_value_bykey)--*/
virtual bool HasValue(const CefString& key) =0;
+ ///
+ // Returns true if the object has a value with the specified identifier.
+ ///
/*--cef(capi_name=has_value_byindex)--*/
virtual bool HasValue(int index) =0;
+ ///
// Delete the value with the specified identifier.
+ ///
/*--cef(capi_name=delete_value_bykey)--*/
virtual bool DeleteValue(const CefString& key) =0;
+ ///
+ // Delete the value with the specified identifier.
+ ///
/*--cef(capi_name=delete_value_byindex)--*/
virtual bool DeleteValue(int index) =0;
+ ///
// Returns the value with the specified identifier.
+ ///
/*--cef(capi_name=get_value_bykey)--*/
virtual CefRefPtr GetValue(const CefString& key) =0;
+ ///
+ // Returns the value with the specified identifier.
+ ///
/*--cef(capi_name=get_value_byindex)--*/
virtual CefRefPtr GetValue(int index) =0;
+ ///
// Associate a value with the specified identifier.
+ ///
/*--cef(capi_name=set_value_bykey)--*/
virtual bool SetValue(const CefString& key, CefRefPtr value) =0;
+ ///
+ // Associate a value with the specified identifier.
+ ///
/*--cef(capi_name=set_value_byindex)--*/
virtual bool SetValue(int index, CefRefPtr value) =0;
+ ///
// Register an identifier whose access will be forwarded to the CefV8Accessor
// instance passed to CefV8Value::CreateObject().
+ ///
/*--cef(capi_name=set_value_byaccessor)--*/
virtual bool SetValue(const CefString& key, AccessControl settings,
PropertyAttribute attribute) =0;
+ ///
// Read the keys for the object's values into the specified vector. Integer-
// based keys will also be returned as strings.
+ ///
/*--cef()--*/
virtual bool GetKeys(std::vector& keys) =0;
+ ///
// Returns the user data, if any, specified when the object was created.
+ ///
/*--cef()--*/
virtual CefRefPtr GetUserData() =0;
// ARRAY METHODS - These methods are only available on arrays.
+ ///
// Returns the number of elements in the array.
+ ///
/*--cef()--*/
virtual int GetArrayLength() =0;
// FUNCTION METHODS - These methods are only available on functions.
+ ///
// Returns the function name.
+ ///
/*--cef()--*/
virtual CefString GetFunctionName() =0;
+ ///
// Returns the function handler or NULL if not a CEF-created function.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFunctionHandler() =0;
-
+
+ ///
// Execute the function using the current V8 context.
+ ///
/*--cef()--*/
virtual bool ExecuteFunction(CefRefPtr object,
const CefV8ValueList& arguments,
CefRefPtr& retval,
CefString& exception) =0;
+ ///
// Execute the function using the specified V8 context.
+ ///
/*--cef()--*/
virtual bool ExecuteFunctionWithContext(CefRefPtr context,
CefRefPtr object,
@@ -1808,25 +2415,32 @@ public:
};
+///
// Class that creates CefSchemeHandler instances. The methods of this class will
// always be called on the IO thread.
+///
/*--cef(source=client)--*/
class CefSchemeHandlerFactory : public virtual CefBase
{
public:
+ ///
// Return a new scheme handler instance to handle the request.
+ ///
/*--cef()--*/
virtual CefRefPtr Create(const CefString& scheme_name,
CefRefPtr request) =0;
};
+///
// Class used to represent a custom scheme handler interface. The methods of
// this class will always be called on the IO thread.
+///
/*--cef(source=client)--*/
class CefSchemeHandler : public virtual CefBase
{
public:
+ ///
// Process the request. All response generation should take place in this
// method. If there is no response set |response_length| to zero or return
// false and ReadResponse() will not be called. If the response length is not
@@ -1838,118 +2452,150 @@ public:
// Use the |response| object to set the mime type, http status code and
// optional header values for the response and return true. To redirect the
// request to a new URL set |redirectUrl| to the new URL and return true.
+ ///
/*--cef()--*/
virtual bool ProcessRequest(CefRefPtr request,
CefString& redirectUrl,
CefRefPtr response,
int* response_length) =0;
+ ///
// Cancel processing of the request.
+ ///
/*--cef()--*/
virtual void Cancel() =0;
+ ///
// Copy up to |bytes_to_read| bytes into |data_out|. If the copy succeeds
// set |bytes_read| to the number of bytes copied and return true. If the
// copy fails return false and ReadResponse() will not be called again.
+ ///
/*--cef()--*/
virtual bool ReadResponse(void* data_out, int bytes_to_read,
int* bytes_read) =0;
};
+///
// Class used to handle file downloads. The methods of this class will always be
// called on the UI thread.
+///
/*--cef(source=client)--*/
class CefDownloadHandler : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool ReceivedData(void* data, int data_size) =0;
+ ///
// The download is complete.
+ ///
/*--cef()--*/
virtual void Complete() =0;
};
+///
// Class used to make a Web URL request. Web URL requests are not associated
// with a browser instance so no CefClient callbacks will be executed. The
// methods of this class may be called on any thread.
+///
/*--cef(source=library)--*/
class CefWebURLRequest : public virtual CefBase
{
public:
typedef cef_weburlrequest_state_t RequestState;
- // Create a new CefWebUrlReqeust object.
+ ///
+ // Create a new CefWebUrlRequest object.
+ ///
/*--cef()--*/
static CefRefPtr CreateWebURLRequest(
CefRefPtr request,
CefRefPtr client);
+ ///
// Cancels the request.
+ ///
/*--cef()--*/
virtual void Cancel() =0;
+ ///
// Returns the current ready state of the request.
+ ///
/*--cef()--*/
virtual RequestState GetState() =0;
};
+///
// Interface that should be implemented by the CefWebURLRequest client. The
// methods of this class will always be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefWebURLRequestClient : public virtual CefBase
{
public:
typedef cef_weburlrequest_state_t RequestState;
-
+ typedef cef_handler_errorcode_t ErrorCode;
+
+ ///
// Notifies the client that the request state has changed. State change
// notifications will always be sent before the below notification methods
// are called.
+ ///
/*--cef()--*/
virtual void OnStateChange(CefRefPtr requester,
RequestState state) =0;
+ ///
// Notifies the client that the request has been redirected and provides a
// chance to change the request parameters.
+ ///
/*--cef()--*/
virtual void OnRedirect(CefRefPtr requester,
CefRefPtr request,
CefRefPtr response) =0;
+ ///
// Notifies the client of the response data.
+ ///
/*--cef()--*/
virtual void OnHeadersReceived(CefRefPtr requester,
CefRefPtr response) =0;
+ ///
// Notifies the client of the upload progress.
+ ///
/*--cef()--*/
virtual void OnProgress(CefRefPtr requester,
uint64 bytesSent, uint64 totalBytesToBeSent) =0;
+ ///
// Notifies the client that content has been received.
+ ///
/*--cef()--*/
virtual void OnData(CefRefPtr requester,
const void* data, int dataLength) =0;
- // Supported error code values. See net\base\net_error_list.h for complete
- // descriptions of the error codes.
- typedef cef_handler_errorcode_t ErrorCode;
-
+ ///
// Notifies the client that the request ended with an error.
+ ///
/*--cef()--*/
virtual void OnError(CefRefPtr requester,
ErrorCode errorCode) =0;
};
+///
// Class that supports the reading of XML data via the libxml streaming API.
// The methods of this class should only be called on the thread that creates
// the object.
+///
/*--cef(source=library)--*/
class CefXmlReader : public virtual CefBase
{
@@ -1957,29 +2603,39 @@ public:
typedef cef_xml_encoding_type_t EncodingType;
typedef cef_xml_node_type_t NodeType;
+ ///
// Create a new CefXmlReader object. The returned object's methods can only
// be called from the thread that created the object.
+ ///
/*--cef()--*/
static CefRefPtr Create(CefRefPtr stream,
EncodingType encodingType,
const CefString& URI);
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool MoveToNextNode() =0;
+ ///
// Close the document. This should be called directly to ensure that cleanup
// occurs on the correct thread.
+ ///
/*--cef()--*/
virtual bool Close() =0;
+ ///
// Returns true if an error has been reported by the XML parser.
+ ///
/*--cef()--*/
virtual bool HasError() =0;
+ ///
// Returns the error string.
+ ///
/*--cef()--*/
virtual CefString GetError() =0;
@@ -1987,295 +2643,413 @@ public:
// The below methods retrieve data for the node at the current cursor
// position.
+ ///
// Returns the node type.
+ ///
/*--cef()--*/
virtual NodeType GetType() =0;
+ ///
// Returns the node depth. Depth starts at 0 for the root node.
+ ///
/*--cef()--*/
virtual int GetDepth() =0;
+ ///
// Returns the local name. See
// http://www.w3.org/TR/REC-xml-names/#NT-LocalPart for additional details.
+ ///
/*--cef()--*/
virtual CefString GetLocalName() =0;
+ ///
// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for
// additional details.
+ ///
/*--cef()--*/
virtual CefString GetPrefix() =0;
+ ///
// Returns the qualified name, equal to (Prefix:)LocalName. See
// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details.
+ ///
/*--cef()--*/
virtual CefString GetQualifiedName() =0;
+ ///
// Returns the URI defining the namespace associated with the node. See
// http://www.w3.org/TR/REC-xml-names/ for additional details.
+ ///
/*--cef()--*/
virtual CefString GetNamespaceURI() =0;
+ ///
// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for
// additional details.
+ ///
/*--cef()--*/
virtual CefString GetBaseURI() =0;
+ ///
// Returns the xml:lang scope within which the node resides. See
// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details.
+ ///
/*--cef()--*/
virtual CefString GetXmlLang() =0;
+ ///
// Returns true if the node represents an empty element. is considered
// empty but is not.
+ ///
/*--cef()--*/
virtual bool IsEmptyElement() =0;
+ ///
// Returns true if the node has a text value.
+ ///
/*--cef()--*/
virtual bool HasValue() =0;
+ ///
// Returns the text value.
+ ///
/*--cef()--*/
virtual CefString GetValue() =0;
+ ///
// Returns true if the node has attributes.
+ ///
/*--cef()--*/
virtual bool HasAttributes() =0;
+ ///
// Returns the number of attributes.
+ ///
/*--cef()--*/
virtual size_t GetAttributeCount() =0;
+ ///
// Returns the value of the attribute at the specified 0-based index.
+ ///
/*--cef(capi_name=get_attribute_byindex)--*/
virtual CefString GetAttribute(int index) =0;
+ ///
// Returns the value of the attribute with the specified qualified name.
+ ///
/*--cef(capi_name=get_attribute_byqname)--*/
virtual CefString GetAttribute(const CefString& qualifiedName) =0;
+ ///
// Returns the value of the attribute with the specified local name and
// namespace URI.
+ ///
/*--cef(capi_name=get_attribute_bylname)--*/
virtual CefString GetAttribute(const CefString& localName,
const CefString& namespaceURI) =0;
+ ///
// Returns an XML representation of the current node's children.
+ ///
/*--cef()--*/
virtual CefString GetInnerXml() =0;
+ ///
// Returns an XML representation of the current node including its children.
+ ///
/*--cef()--*/
virtual CefString GetOuterXml() =0;
+ ///
// Returns the line number for the current node.
+ ///
/*--cef()--*/
virtual int GetLineNumber() =0;
-
+
// 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.
+ ///
// Moves the cursor to the attribute at the specified 0-based index. Returns
// true if the cursor position was set successfully.
+ ///
/*--cef(capi_name=move_to_attribute_byindex)--*/
virtual bool MoveToAttribute(int index) =0;
+ ///
// Moves the cursor to the attribute with the specified qualified name.
// Returns true if the cursor position was set successfully.
+ ///
/*--cef(capi_name=move_to_attribute_byqname)--*/
virtual bool MoveToAttribute(const CefString& qualifiedName) =0;
+ ///
// Moves the cursor to the attribute with the specified local name and
// namespace URI. Returns true if the cursor position was set successfully.
+ ///
/*--cef(capi_name=move_to_attribute_bylname)--*/
virtual bool MoveToAttribute(const CefString& localName,
const CefString& namespaceURI) =0;
+ ///
// Moves the cursor to the first attribute in the current element. Returns
// true if the cursor position was set successfully.
+ ///
/*--cef()--*/
virtual bool MoveToFirstAttribute() =0;
+ ///
// Moves the cursor to the next attribute in the current element. Returns
// true if the cursor position was set successfully.
+ ///
/*--cef()--*/
virtual bool MoveToNextAttribute() =0;
+ ///
// Moves the cursor back to the carrying element. Returns true if the cursor
// position was set successfully.
+ ///
/*--cef()--*/
virtual bool MoveToCarryingElement() =0;
};
+///
// Class that supports the reading of zip archives via the zlib unzip API.
// The methods of this class should only be called on the thread that creates
// the object.
+///
/*--cef(source=library)--*/
class CefZipReader : public virtual CefBase
{
public:
+ ///
// Create a new CefZipReader object. The returned object's methods can only
// be called from the thread that created the object.
+ ///
/*--cef()--*/
static CefRefPtr Create(CefRefPtr stream);
+ ///
// Moves the cursor to the first file in the archive. Returns true if the
// cursor position was set successfully.
+ ///
/*--cef()--*/
virtual bool MoveToFirstFile() =0;
+ ///
// Moves the cursor to the next file in the archive. Returns true if the
// cursor position was set successfully.
+ ///
/*--cef()--*/
virtual bool MoveToNextFile() =0;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) =0;
+ ///
// Closes the archive. This should be called directly to ensure that cleanup
// occurs on the correct thread.
+ ///
/*--cef()--*/
virtual bool Close() =0;
// The below methods act on the file at the current cursor position.
+ ///
// Returns the name of the file.
+ ///
/*--cef()--*/
virtual CefString GetFileName() =0;
+ ///
// Returns the uncompressed size of the file.
+ ///
/*--cef()--*/
virtual long GetFileSize() =0;
+ ///
// Returns the last modified timestamp for the file.
+ ///
/*--cef()--*/
virtual time_t GetFileLastModified() =0;
+ ///
// Opens the file for reading of uncompressed data. A read password may
// optionally be specified.
+ ///
/*--cef()--*/
virtual bool OpenFile(const CefString& password) =0;
+ ///
// Closes the file.
+ ///
/*--cef()--*/
virtual bool CloseFile() =0;
+ ///
// 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.
+ ///
/*--cef()--*/
virtual int ReadFile(void* buffer, size_t bufferSize) =0;
+ ///
// Returns the current offset in the uncompressed file contents.
+ ///
/*--cef()--*/
virtual long Tell() =0;
+ ///
// Returns true if at end of the file contents.
+ ///
/*--cef()--*/
virtual bool Eof() =0;
};
+///
// Interface to implement for visiting the DOM. The methods of this class will
// be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefDOMVisitor : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void Visit(CefRefPtr document) =0;
};
+///
// Class used to represent a DOM document. The methods of this class should only
// be called on the UI thread.
+///
/*--cef(source=library)--*/
class CefDOMDocument : public virtual CefBase
{
public:
typedef cef_dom_document_type_t Type;
+ ///
// Returns the document type.
+ ///
/*--cef()--*/
virtual Type GetType() =0;
+ ///
// Returns the root document node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetDocument() =0;
+ ///
// Returns the BODY node of an HTML document.
+ ///
/*--cef()--*/
virtual CefRefPtr GetBody() =0;
+ ///
// Returns the HEAD node of an HTML document.
+ ///
/*--cef()--*/
virtual CefRefPtr GetHead() =0;
-
+
+ ///
// Returns the title of an HTML document.
+ ///
/*--cef()--*/
virtual CefString GetTitle() =0;
-
+
+ ///
// Returns the document element with the specified ID value.
+ ///
/*--cef()--*/
virtual CefRefPtr GetElementById(const CefString& id) =0;
-
+
+ ///
// Returns the node that currently has keyboard focus.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFocusedNode() =0;
-
+
+ ///
// Returns true if a portion of the document is selected.
+ ///
/*--cef()--*/
virtual bool HasSelection() =0;
-
+
+ ///
// Returns the selection start node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetSelectionStartNode() =0;
-
+
+ ///
// Returns the selection offset within the start node.
+ ///
/*--cef()--*/
virtual int GetSelectionStartOffset() =0;
-
+
+ ///
// Returns the selection end node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetSelectionEndNode() =0;
-
+
+ ///
// Returns the selection offset within the end node.
+ ///
/*--cef()--*/
virtual int GetSelectionEndOffset() =0;
-
+
+ ///
// Returns the contents of this selection as markup.
+ ///
/*--cef()--*/
virtual CefString GetSelectionAsMarkup() =0;
+ ///
// Returns the contents of this selection as text.
+ ///
/*--cef()--*/
virtual CefString GetSelectionAsText() =0;
-
+
+ ///
// Returns the base URL for the document.
+ ///
/*--cef()--*/
virtual CefString GetBaseURL() =0;
+ ///
// Returns a complete URL based on the document base URL and the specified
// partial URL.
+ ///
/*--cef()--*/
virtual CefString GetCompleteURL(const CefString& partialURL) =0;
};
+///
// Class used to represent a DOM node. The methods of this class should only be
// called on the UI thread.
+///
/*--cef(source=library)--*/
class CefDOMNode : public virtual CefBase
{
@@ -2283,67 +3057,98 @@ public:
typedef std::map AttributeMap;
typedef cef_dom_node_type_t Type;
+ ///
// Returns the type for this node.
+ ///
/*--cef()--*/
virtual Type GetType() =0;
+ ///
// Returns true if this is a text node.
+ ///
/*--cef()--*/
virtual bool IsText() =0;
+ ///
// Returns true if this is an element node.
+ ///
/*--cef()--*/
virtual bool IsElement() =0;
+ ///
// Returns true if this object is pointing to the same handle as |that|
// object.
+ ///
/*--cef()--*/
virtual bool IsSame(CefRefPtr that) =0;
+ ///
// Returns the name of this node.
+ ///
/*--cef()--*/
virtual CefString GetName() =0;
+ ///
// Returns the value of this node.
+ ///
/*--cef()--*/
virtual CefString GetValue() =0;
+ ///
// Set the value of this node. Returns true on success.
+ ///
/*--cef()--*/
virtual bool SetValue(const CefString& value) =0;
+ ///
// Returns the contents of this node as markup.
+ ///
/*--cef()--*/
virtual CefString GetAsMarkup() =0;
+ ///
// Returns the document associated with this node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetDocument() =0;
+ ///
// Returns the parent node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetParent() =0;
+ ///
// Returns the previous sibling node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetPreviousSibling() =0;
+ ///
// Returns the next sibling node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetNextSibling() =0;
+ ///
// Returns true if this node has child nodes.
+ ///
/*--cef()--*/
virtual bool HasChildren() =0;
+ ///
// Return the first child node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetFirstChild() =0;
+ ///
// Returns the last child node.
+ ///
/*--cef()--*/
virtual CefRefPtr GetLastChild() =0;
+ ///
// 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
@@ -2352,118 +3157,162 @@ public:
// 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.
+ ///
/*--cef()--*/
virtual void AddEventListener(const CefString& eventType,
CefRefPtr listener,
bool useCapture) =0;
+
// The following methods are valid only for element nodes.
+ ///
// Returns the tag name of this element.
+ ///
/*--cef()--*/
virtual CefString GetElementTagName() =0;
+ ///
// Returns true if this element has attributes.
+ ///
/*--cef()--*/
virtual bool HasElementAttributes() =0;
+ ///
// Returns true if this element has an attribute named |attrName|.
+ ///
/*--cef()--*/
virtual bool HasElementAttribute(const CefString& attrName) =0;
+ ///
// Returns the element attribute named |attrName|.
+ ///
/*--cef()--*/
virtual CefString GetElementAttribute(const CefString& attrName) =0;
+ ///
// Returns a map of all element attributes.
+ ///
/*--cef()--*/
virtual void GetElementAttributes(AttributeMap& attrMap) =0;
+ ///
// Set the value for the element attribute named |attrName|. Returns true on
// success.
+ ///
/*--cef()--*/
virtual bool SetElementAttribute(const CefString& attrName,
const CefString& value) =0;
+ ///
// Returns the inner text of the element.
+ ///
/*--cef()--*/
virtual CefString GetElementInnerText() =0;
};
+///
// Class used to represent a DOM event. The methods of this class should only
// be called on the UI thread.
+///
/*--cef(source=library)--*/
class CefDOMEvent : public virtual CefBase
{
public:
typedef cef_dom_event_category_t Category;
typedef cef_dom_event_phase_t Phase;
-
+
+ ///
// Returns the event type.
+ ///
/*--cef()--*/
virtual CefString GetType() =0;
-
+
+ ///
// Returns the event category.
+ ///
/*--cef()--*/
virtual Category GetCategory() =0;
-
+
+ ///
// Returns the event processing phase.
+ ///
/*--cef()--*/
virtual Phase GetPhase() =0;
+ ///
// Returns true if the event can bubble up the tree.
+ ///
/*--cef()--*/
virtual bool CanBubble() =0;
-
+
+ ///
// Returns true if the event can be canceled.
+ ///
/*--cef()--*/
virtual bool CanCancel() =0;
+ ///
// Returns the document associated with this event.
+ ///
/*--cef()--*/
virtual CefRefPtr GetDocument() =0;
+ ///
// Returns the target of the event.
+ ///
/*--cef()--*/
virtual CefRefPtr GetTarget() =0;
+ ///
// Returns the current target of the event.
+ ///
/*--cef()--*/
virtual CefRefPtr GetCurrentTarget() =0;
};
+///
// Interface to implement for handling DOM events. The methods of this class
// will be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefDOMEventListener : public virtual CefBase
{
public:
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void HandleEvent(CefRefPtr event) =0;
};
+///
// Interface to implement for filtering response content. The methods of this
// class will always be called on the UI thread.
+///
/*--cef(source=client)--*/
class CefContentFilter : public virtual CefBase
{
public:
+ ///
// Set |substitute_data| to the replacement for the data in |data| if data
// should be modified.
+ ///
/*--cef()--*/
virtual void ProcessData(const void* data, int data_size,
CefRefPtr& substitute_data) {}
+ ///
// 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.
+ ///
/*--cef()--*/
virtual void Drain(CefRefPtr& remainder) {}
};
diff --git a/include/cef_capi.h b/include/cef_capi.h
index d2d0bb69d..84a7f2fb0 100644
--- a/include/cef_capi.h
+++ b/include/cef_capi.h
@@ -48,39 +48,47 @@ extern "C" {
#include "internal/cef_types.h"
+///
// This function should be called on the main application thread to initialize
// CEF when the application is started. A return value of true (1) indicates
// that it succeeded and false (0) indicates that it failed.
+///
CEF_EXPORT int cef_initialize(const struct _cef_settings_t* settings);
+///
// This function should be called on the main application thread to shut down
// CEF before the application exits.
+///
CEF_EXPORT void cef_shutdown();
+///
// Perform a single iteration of CEF message loop processing. This function is
// used to integrate the CEF message loop into an existing application message
// loop. Care must be taken to balance performance against excessive CPU usage.
// This function should only be called on the main application thread and only
// if cef_initialize() is called with a CefSettings.multi_threaded_message_loop
// value of false (0). This function will not block.
+///
CEF_EXPORT void cef_do_message_loop_work();
+///
// Run the CEF message loop. Use this function instead of an application-
// provided message loop to get the best balance between performance and CPU
// usage. This function should only be called on the main application thread and
// only if cef_initialize() is called with a
// CefSettings.multi_threaded_message_loop value of false (0). This function
// will block until a quit message is received by the system.
+///
CEF_EXPORT void cef_run_message_loop();
+///
// 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
// in which the prototype of the native function is defined. This function may
// be called on any thread.
//
-// Example JavaScript extension code:
-//
+// Example JavaScript extension code:
// // create the 'example' global object if it doesn't already exist.
// if (!example)
// example = {};
@@ -118,9 +126,7 @@ CEF_EXPORT void cef_run_message_loop();
// return myint;
// };
// })();
-//
-// Example usage in the page:
-//
+//
Example usage in the page:
// // Call the function.
// example.test.myfunction();
// // Set the parameter.
@@ -129,10 +135,12 @@ CEF_EXPORT void cef_run_message_loop();
// value = example.test.myparam;
// // Call another function.
// example.test.increment();
-//
+//
+///
CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
const cef_string_t* javascript_code, struct _cef_v8handler_t* handler);
+///
// Register a custom scheme. This function should not be called for the built-in
// HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
//
@@ -141,14 +149,12 @@ CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
// defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available
// at http://www.ietf.org/rfc/rfc1738.txt
//
-// In particular, the syntax for standard scheme URLs must be of the form:
-//
-// ://:@:/
-//
-// 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
+// In particular, the syntax for standard scheme URLs must be of the form:
+// [scheme]://[username]:[password]@[host]:[port]/[url-path]
+//
Standard scheme URLs must have a host component that is a fully
+// qualified domain name as defined in Section 3.5 of RFC 1034 [13] and Section
+// 2.1 of RFC 1123. These URLs will be canonicalized to "scheme://host/path" in
+// the simplest case and "scheme://username:password@host:port/path" in the most
// explicit case. For example, "scheme:host/path" and "scheme:///host/path" will
// both be canonicalized to "scheme://host/path".
//
@@ -169,9 +175,11 @@ CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
// This function may be called on any thread. It should only be called once per
// unique |scheme_name| value. If |scheme_name| is already registered or if an
// error occurs this function will return false (0).
+///
CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name,
int is_standard, int is_local, int is_display_isolated);
+///
// Register a scheme handler factory for the specified |scheme_name| and
// optional |domain_name|. An NULL |domain_name| value for a standard scheme
// will cause the factory to match all domain names. The |domain_name| value
@@ -182,14 +190,18 @@ CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name,
// function may be called multiple times to change or remove the factory that
// matches the specified |scheme_name| and optional |domain_name|. Returns false
// (0) if an error occurs. This function may be called on any thread.
+///
CEF_EXPORT int cef_register_scheme_handler_factory(
const cef_string_t* scheme_name, const cef_string_t* domain_name,
struct _cef_scheme_handler_factory_t* factory);
+///
// Clear all registered scheme handler factories. Returns false (0) on error.
// This function may be called on any thread.
+///
CEF_EXPORT int cef_clear_scheme_handler_factories();
+///
// Add an entry to the cross-origin access whitelist.
//
// The same-origin policy restricts how scripts hosted from different origins
@@ -215,20 +227,26 @@ CEF_EXPORT int cef_clear_scheme_handler_factories();
// subdomains of the target domain. This function may be called on any thread.
// Returns false (0) if |source_origin| is invalid or the whitelist cannot be
// accessed.
+///
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
const cef_string_t* source_origin, const cef_string_t* target_protocol,
const cef_string_t* target_domain, int allow_target_subdomains);
+///
// Remove an entry from the cross-origin access whitelist. Returns false (0) if
// |source_origin| is invalid or the whitelist cannot be accessed.
+///
CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
const cef_string_t* source_origin, const cef_string_t* target_protocol,
const cef_string_t* target_domain, int allow_target_subdomains);
+///
// Remove all entries from the cross-origin access whitelist. Returns false (0)
// if the whitelist cannot be accessed.
+///
CEF_EXPORT int cef_clear_cross_origin_whitelist();
+///
// 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
@@ -237,49 +255,65 @@ CEF_EXPORT int cef_clear_cross_origin_whitelist();
// The IO thread is used for handling schema and network requests. The FILE
// thread is used for the application cache and other miscellaneous activities.
// This function will return true (1) if called on the specified thread.
+///
CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId);
+///
// Post a task for execution on the specified thread. This function may be
// called on any thread.
+///
CEF_EXPORT int cef_post_task(cef_thread_id_t threadId,
struct _cef_task_t* task);
+///
// Post a task for delayed execution on the specified thread. This function may
// be called on any thread.
+///
CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId,
struct _cef_task_t* task, long delay_ms);
+///
// Parse the specified |url| into its component parts. Returns false (0) if the
// URL is NULL or invalid.
+///
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
struct _cef_urlparts_t* parts);
+///
// Creates a URL from the specified |parts|, which must contain a non-NULL spec
// or a non-NULL host and path (at a minimum), but not both. Returns false (0)
// if |parts| isn't initialized as described.
+///
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
cef_string_t* url);
+///
// Visit all cookies. The returned cookies are ordered by longest path, then by
// earliest creation date. Returns false (0) if cookies cannot be accessed.
+///
CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor);
+///
// Visit a subset of cookies. The results are filtered by the given url scheme,
// host, domain and path. If |includeHttpOnly| is true (1) HTTP-only cookies
// will also be included in the results. The returned cookies are ordered by
// longest path, then by earliest creation date. Returns false (0) if cookies
// cannot be accessed.
+///
CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url,
int includeHttpOnly, struct _cef_cookie_visitor_t* visitor);
+///
// Sets a cookie given a valid URL and explicit user-provided cookie attributes.
// This function expects each attribute to be well-formed. It will check for
// disallowed characters (e.g. the ';' character is disallowed within the cookie
// value attribute) and will return false (0) without setting the cookie if such
// characters are found. This function must be called on the IO thread.
+///
CEF_EXPORT int cef_set_cookie(const cef_string_t* url,
const struct _cef_cookie_t* cookie);
+///
// 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
@@ -287,6 +321,7 @@ CEF_EXPORT int cef_set_cookie(const cef_string_t* url,
// for all hosts and domains will be deleted. Returns false (0) if a non-NULL
// invalid URL is specified or if cookies cannot be accessed. This function must
// be called on the IO thread.
+///
CEF_EXPORT int cef_delete_cookies(const cef_string_t* url,
const cef_string_t* cookie_name);
@@ -314,32 +349,40 @@ typedef struct _cef_base_t
#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))
+///
// Implement this structure for task execution. The functions of this structure
// may be called on any thread.
+///
typedef struct _cef_task_t
{
// Base structure.
cef_base_t base;
+ ///
// Method that will be executed. |threadId| is the thread executing the call.
+ ///
void (CEF_CALLBACK *execute)(struct _cef_task_t* self,
cef_thread_id_t threadId);
} cef_task_t;
+///
// Structure to implement for visiting cookie values. The functions of this
// structure will always be called on the IO thread.
+///
typedef struct _cef_cookie_visitor_t
{
// Base structure.
cef_base_t base;
+ ///
// Method that will be called once for each cookie. |count| is the 0-based
// index for the current cookie. |total| is the total number of cookies. Set
// |deleteCookie| to true (1) to delete the cookie currently being visited.
// Return false (0) to stop visiting cookies. This function may never be
// called if no cookies are found.
+ ///
int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self,
const struct _cef_cookie_t* cookie, int count, int total,
int* deleteCookie);
@@ -347,282 +390,405 @@ typedef struct _cef_cookie_visitor_t
} cef_cookie_visitor_t;
+///
// Structure used to represent a browser window. The functions of this structure
// may be called on any thread unless otherwise indicated in the comments.
+///
typedef struct _cef_browser_t
{
// Base structure.
cef_base_t base;
+ ///
// Closes this browser window.
+ ///
void (CEF_CALLBACK *close_browser)(struct _cef_browser_t* self);
+ ///
// Returns true (1) if the browser can navigate backwards.
+ ///
int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self);
// Navigate backwards.
+ ///
void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self);
+ ///
// Returns true (1) if the browser can navigate forwards.
+ ///
int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self);
+ ///
// Navigate backwards.
+ ///
void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self);
+ ///
// Reload the current page.
+ ///
void (CEF_CALLBACK *reload)(struct _cef_browser_t* self);
+ ///
// Reload the current page ignoring any cached data.
+ ///
void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self);
+ ///
// Stop loading the page.
+ ///
void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self);
+ ///
// Set focus for the browser window. If |enable| is true (1) focus will be set
// to the window. Otherwise, focus will be removed.
+ ///
void (CEF_CALLBACK *set_focus)(struct _cef_browser_t* self, int enable);
+ ///
// Retrieve the window handle for this browser.
+ ///
cef_window_handle_t (CEF_CALLBACK *get_window_handle)(
struct _cef_browser_t* self);
// Returns true (1) if the window is a popup window.
+ ///
int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self);
+ ///
// Returns the client for this browser.
+ ///
struct _cef_client_t* (CEF_CALLBACK *get_client)(struct _cef_browser_t* self);
+ ///
// Returns the main (top-level) frame for the browser window.
+ ///
struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)(
struct _cef_browser_t* self);
+ ///
// Returns the focused frame for the browser window. This function should only
// be called on the UI thread.
+ ///
struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)(
struct _cef_browser_t* self);
+ ///
// Returns the frame with the specified name, or NULL if not found. This
// function should only be called on the UI thread.
+ ///
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self,
const cef_string_t* name);
+ ///
// Returns the names of all existing frames. This function should only be
// called on the UI thread.
+ ///
void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self,
cef_string_list_t names);
+ ///
// 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.
+ ///
void (CEF_CALLBACK *find)(struct _cef_browser_t* self, int identifier,
const cef_string_t* searchText, int forward, int matchCase,
int findNext);
+ ///
// Cancel all searches that are currently going on.
+ ///
void (CEF_CALLBACK *stop_finding)(struct _cef_browser_t* self,
int clearSelection);
+ ///
// Get the zoom level.
+ ///
double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_t* self);
+ ///
// Change the zoom level to the specified value.
+ ///
void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_t* self,
double zoomLevel);
+ ///
// Open developer tools in its own window.
+ ///
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_t* self);
+ ///
// Explicitly close the developer tools window if one exists for this browser
// instance.
+ ///
void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_t* self);
+ ///
// Returns true (1) if window rendering is disabled.
+ ///
int (CEF_CALLBACK *is_window_rendering_disabled)(struct _cef_browser_t* self);
+ ///
// Get the size of the specified element. This function should only be called
// on the UI thread.
+ ///
int (CEF_CALLBACK *get_size)(struct _cef_browser_t* self,
enum cef_paint_element_type_t type, int* width, int* height);
+ ///
// Set the size of the specified element. This function is only used when
// window rendering is disabled.
+ ///
void (CEF_CALLBACK *set_size)(struct _cef_browser_t* self,
enum cef_paint_element_type_t type, int width, int height);
+ ///
// Returns true (1) if a popup is currently visible. This function should only
// be called on the UI thread.
+ ///
int (CEF_CALLBACK *is_popup_visible)(struct _cef_browser_t* self);
+ ///
// Hide the currently visible popup, if any.
+ ///
void (CEF_CALLBACK *hide_popup)(struct _cef_browser_t* self);
+ ///
// Invalidate the |dirtyRect| region of the view. This function is only used
// when window rendering is disabled and will result in a call to
// HandlePaint().
+ ///
void (CEF_CALLBACK *invalidate)(struct _cef_browser_t* self,
const cef_rect_t* dirtyRect);
+ ///
// Get the raw image data contained in the specified element without
// performing validation. The specified |width| and |height| dimensions must
// match the current element size. On Windows |buffer| must be width*height*4
// bytes in size and represents a BGRA image with an upper-left origin. This
// function should only be called on the UI thread.
+ ///
int (CEF_CALLBACK *get_image)(struct _cef_browser_t* self,
enum cef_paint_element_type_t type, int width, int height,
void* buffer);
+ ///
// Send a key event to the browser.
+ ///
void (CEF_CALLBACK *send_key_event)(struct _cef_browser_t* self,
enum cef_key_type_t type, int key, int modifiers, int sysChar,
int imeChar);
+ ///
// Send a mouse click event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
+ ///
void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_t* self,
int x, int y, enum cef_mouse_button_type_t type, int mouseUp,
int clickCount);
+ ///
// Send a mouse move event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
+ ///
void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_t* self, int x,
int y, int mouseLeave);
+ ///
// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
// relative to the upper-left corner of the view.
+ ///
void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_t* self,
int x, int y, int delta);
+ ///
// Send a focus event to the browser.
+ ///
void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_t* self,
int setFocus);
+ ///
// Send a capture lost event to the browser.
+ ///
void (CEF_CALLBACK *send_capture_lost_event)(struct _cef_browser_t* self);
} cef_browser_t;
+///
// Create a new browser window using the window parameters specified by
// |windowInfo|. All values will be copied internally and the actual window will
// be created on the UI thread. This function call will not block.
+///
CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo,
struct _cef_client_t* client, const cef_string_t* url,
const struct _cef_browser_settings_t* settings);
+///
// Create a new browser window using the window parameters specified by
// |windowInfo|. This function should only be called on the UI thread.
+///
CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo,
struct _cef_client_t* client, const cef_string_t* url,
const struct _cef_browser_settings_t* settings);
+///
// Structure used to represent a frame in the browser window. The functions of
// this structure may be called on any thread unless otherwise indicated in the
// comments.
+///
typedef struct _cef_frame_t
{
// Base structure.
cef_base_t base;
+ ///
// Execute undo in this frame.
+ ///
void (CEF_CALLBACK *undo)(struct _cef_frame_t* self);
+ ///
// Execute redo in this frame.
+ ///
void (CEF_CALLBACK *redo)(struct _cef_frame_t* self);
+ ///
// Execute cut in this frame.
+ ///
void (CEF_CALLBACK *cut)(struct _cef_frame_t* self);
+ ///
// Execute copy in this frame.
+ ///
void (CEF_CALLBACK *copy)(struct _cef_frame_t* self);
+ ///
// Execute paste in this frame.
+ ///
void (CEF_CALLBACK *paste)(struct _cef_frame_t* self);
+ ///
// Execute delete in this frame.
+ ///
void (CEF_CALLBACK *del)(struct _cef_frame_t* self);
+ ///
// Execute select all in this frame.
+ ///
void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self);
+ ///
// Execute printing in the this frame. The user will be prompted with the
// print dialog appropriate to the operating system.
+ ///
void (CEF_CALLBACK *print)(struct _cef_frame_t* self);
+ ///
// Save this frame's HTML source to a temporary file and open it in the
// default text viewing application.
+ ///
void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self);
+ ///
// Returns this frame's HTML source as a string. This function should only be
// called on the UI thread.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_source)(struct _cef_frame_t* self);
+ ///
// Returns this frame's display text as a string. This function should only be
// called on the UI thread.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_text)(struct _cef_frame_t* self);
+ ///
// Load the request represented by the |request| object.
+ ///
void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self,
struct _cef_request_t* request);
+ ///
// Load the specified |url|.
+ ///
void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self,
const cef_string_t* url);
+ ///
// Load the contents of |string| with the optional dummy target |url|.
+ ///
void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self,
const cef_string_t* string, const cef_string_t* url);
+ ///
// Load the contents of |stream| with the optional dummy target |url|.
+ ///
void (CEF_CALLBACK *load_stream)(struct _cef_frame_t* self,
struct _cef_stream_reader_t* stream, const cef_string_t* url);
+ ///
// 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.
+ ///
void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self,
const cef_string_t* jsCode, const cef_string_t* scriptUrl,
int startLine);
+ ///
// Returns true (1) if this is the main frame.
+ ///
int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self);
+ ///
// Returns true (1) if this is the focused frame. This function should only be
// called on the UI thread.
+ ///
int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self);
+ ///
// Returns this frame's name.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);
+ ///
// Returns the URL currently loaded in this frame. This function should only
// be called on the UI thread.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self);
+ ///
// Returns the browser that this frame belongs to.
+ ///
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self);
+ ///
// Visit the DOM document.
+ ///
void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self,
struct _cef_domvisitor_t* visitor);
} cef_frame_t;
+///
// Implement this structure to handle events related to browser life span. The
// functions of this structure will be called on the UI thread.
+///
typedef struct _cef_life_span_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// 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
@@ -632,6 +798,7 @@ typedef struct _cef_life_span_handler_t
// 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.
+ ///
int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* parentBrowser,
const struct _cef_popup_features_t* popupFeatures,
@@ -639,48 +806,60 @@ typedef struct _cef_life_span_handler_t
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings);
+ ///
// Called after a new window is created.
+ ///
void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
+ ///
// Called just before a window is closed.
+ ///
void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser);
} cef_life_span_handler_t;
+///
// Implement this structure to handle events related to browser load status. The
// functions of this structure will be called on the UI thread.
+///
typedef struct _cef_load_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called when the browser begins loading a frame. The |frame| value will
// never be NULL -- call the is_main() function to check if this frame is the
// main frame. Multiple frames may be loading at the same time. Sub-frames may
// start or continue loading after the main frame load has ended. This
// function may not be called for a particular frame if the load request for
// that frame fails.
+ ///
void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame);
+ ///
// Called when the browser is done loading a frame. The |frame| value will
// never be NULL -- call the is_main() function to check if this frame is the
// main frame. Multiple frames may be loading at the same time. Sub-frames may
// start or continue loading after the main frame load has ended. This
// function will always be called for all frames irrespective of whether the
// request completes successfully.
+ ///
void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
int httpStatusCode);
+ ///
// Called when the browser fails to load a resource. |errorCode| is the error
// code number and |failedUrl| is the URL that failed to load. To provide
// custom error text assign the text to |errorText| and return true (1).
// Otherwise, return false (0) for the default error text. See
// net\base\net_error_list.h for complete descriptions of the error codes.
+ ///
int (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl,
@@ -689,21 +868,26 @@ typedef struct _cef_load_handler_t
} cef_load_handler_t;
+///
// Implement this structure to handle events related to browser requests. The
// functions of this structure will be called on the thread indicated.
+///
typedef struct _cef_request_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called on the UI thread before browser navigation. The client has an
// opportunity to modify the |request| object if desired. Return true (1) to
// cancel the navigation or false (0) to allow the navigation to proceed.
+ ///
int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_request_t* request, enum cef_handler_navtype_t navType,
int isRedirect);
+ ///
// Called on the IO thread before a resource is loaded. To allow the resource
// to load normally return false (0). To redirect the resource to a new url
// populate the |redirectUrl| value and return false (0). To specify data for
@@ -713,20 +897,24 @@ typedef struct _cef_request_handler_t
// (1). 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.
+ ///
int (CEF_CALLBACK *on_before_resource_load)(
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
struct _cef_request_t* request, cef_string_t* redirectUrl,
struct _cef_stream_reader_t** resourceStream,
struct _cef_response_t* response, int loadFlags);
+ ///
// 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.
+ ///
void (CEF_CALLBACK *on_resource_reponse)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* url,
struct _cef_response_t* response,
struct _cef_content_filter_t** filter);
+ ///
// Called on the IO thread to handle requests for URLs with an unknown
// protocol component. Return true (1) to indicate that the request should
// succeed because it was handled externally. Set |allowOSExecution| to true
@@ -736,10 +924,12 @@ typedef struct _cef_request_handler_t
// then the request will fail with an error condition. SECURITY WARNING: YOU
// SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR
// OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
+ ///
int (CEF_CALLBACK *on_protocol_execution)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* url,
int* allowOSExecution);
+ ///
// 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
@@ -747,15 +937,18 @@ typedef struct _cef_request_handler_t
// Size' header or -1 if no size was provided. Set |handler| to the
// cef_download_handler_t instance that will recieve the file contents. Return
// true (1) to download the file or false (0) to cancel the file download.
+ ///
int (CEF_CALLBACK *get_download_handler)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* mimeType,
const cef_string_t* fileName, int64 contentLength,
struct _cef_download_handler_t** handler);
+ ///
// 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 true (1)
// to handle the request. Return false (0) to cancel the request.
+ ///
int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser, int isProxy, const cef_string_t* host,
const cef_string_t* realm, const cef_string_t* scheme,
@@ -764,43 +957,57 @@ typedef struct _cef_request_handler_t
} cef_request_handler_t;
+///
// Implement this structure to handle events related to browser display state.
// The functions of this structure will be called on the UI thread.
+///
typedef struct _cef_display_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called when the navigation state has changed.
+ ///
void (CEF_CALLBACK *on_nav_state_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, int canGoBack, int canGoForward);
+ ///
// Called when a frame's address has changed.
+ ///
void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
const cef_string_t* url);
+ ///
// Called when the page title changes.
+ ///
void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* title);
+ ///
// Called when the browser is about to display a tooltip. |text| contains the
// text that will be displayed in the tooltip. To handle the display of the
// tooltip yourself return true (1). Otherwise, you can optionally modify
// |text| and then return false (0) to allow the browser to display the
// tooltip.
+ ///
int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, cef_string_t* text);
+ ///
// 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.
+ ///
void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* value,
enum cef_handler_statustype_t type);
+ ///
// Called to display a console message. Return true (1) to stop the message
// from being output to the console.
+ ///
int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* message,
const cef_string_t* source, int line);
@@ -808,37 +1015,46 @@ typedef struct _cef_display_handler_t
} cef_display_handler_t;
+///
// Implement this structure to handle events related to focus. The functions of
// this structure will be called on the UI thread.
+///
typedef struct _cef_focus_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called when the browser component is about to loose focus. For instance, if
// focus was on the last HTML element and the user pressed the TAB key. |next|
// will be true (1) if the browser is giving focus to the next component and
// false (0) if the browser is giving focus to the previous component.
+ ///
void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser, int next);
+ ///
// Called when the browser component is requesting focus. |isWidget| will be
// true (1) if the focus is requested for a child widget of the browser
// window. Return false (0) to allow the focus to be set or true (1) to cancel
// setting the focus.
+ ///
int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self,
struct _cef_browser_t* browser, int isWidget);
} cef_focus_handler_t;
+///
// Implement this structure to handle events related to keyboard input. The
// functions of this structure will be called on the UI thread.
+///
typedef struct _cef_keyboard_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// 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
@@ -846,6 +1062,7 @@ typedef struct _cef_keyboard_handler_t
// (see http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx). Return
// true (1) if the keyboard event was handled or false (0) to allow the
// browser component to handle the event.
+ ///
int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self,
struct _cef_browser_t* browser, enum cef_handler_keyevent_type_t type,
int code, int modifiers, int isSystemKey);
@@ -853,51 +1070,64 @@ typedef struct _cef_keyboard_handler_t
} cef_keyboard_handler_t;
+///
// Implement this structure to handle events related to browser context menus.
// The functions of this structure will be called on the UI thread.
+///
typedef struct _cef_menu_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called before a context menu is displayed. Return false (0) to display the
// default context menu or true (1) to cancel the display.
+ ///
int (CEF_CALLBACK *on_before_menu)(struct _cef_menu_handler_t* self,
struct _cef_browser_t* browser,
const struct _cef_handler_menuinfo_t* menuInfo);
+ ///
// 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.
+ ///
void (CEF_CALLBACK *get_menu_label)(struct _cef_menu_handler_t* self,
struct _cef_browser_t* browser, enum cef_handler_menuid_t menuId,
cef_string_t* label);
+ ///
// Called when an option is selected from the default context menu. Return
// false (0) to execute the default action or true (1) to cancel the action.
+ ///
int (CEF_CALLBACK *on_menu_action)(struct _cef_menu_handler_t* self,
struct _cef_browser_t* browser, enum cef_handler_menuid_t menuId);
} cef_menu_handler_t;
+///
// Implement this structure to handle events related to printing. The functions
// of this structure will be called on the UI thread.
+///
typedef struct _cef_print_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called to allow customization of standard print options before the print
// dialog is displayed. |printOptions| allows specification of paper size,
// orientation and margins. Note that the specified margins may be adjusted if
// they are outside the range supported by the printer. All units are in
// inches. Return false (0) to display the default print options or true (1)
// to display the modified |printOptions|.
+ ///
int (CEF_CALLBACK *get_print_options)(struct _cef_print_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_print_options_t* printOptions);
+ ///
// 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
@@ -908,6 +1138,7 @@ typedef struct _cef_print_handler_t
// string to the appropriate variable. To draw the header and footer yourself
// return true (1). Otherwise, populate the approprate variables and return
// false (0).
+ ///
int (CEF_CALLBACK *get_print_header_footer)(struct _cef_print_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
const struct _cef_print_info_t* printInfo, const cef_string_t* url,
@@ -919,19 +1150,23 @@ typedef struct _cef_print_handler_t
} cef_print_handler_t;
+///
// Implement this structure to handle events related to find results. The
// functions of this structure will be called on the UI thread.
+///
typedef struct _cef_find_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called to report find results returned by cef_browser_t::find().
// |identifer| is the identifier passed to cef_browser_t::find(), |count| is
// the number of matches currently identified, |selectionRect| is the location
// of where the match was found (in window coordinates), |activeMatchOrdinal|
// is the current position in the search results, and |finalUpdate| is true
// (1) if this is the last find notification.
+ ///
void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self,
struct _cef_browser_t* browser, int identifier, int count,
const cef_rect_t* selectionRect, int activeMatchOrdinal,
@@ -940,30 +1175,38 @@ typedef struct _cef_find_handler_t
} cef_find_handler_t;
+///
// Implement this structure to handle events related to JavaScript dialogs. The
// functions of this structure will be called on the UI thread.
+///
typedef struct _cef_jsdialog_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called to run a JavaScript alert message. Return false (0) to display the
// default alert or true (1) if you displayed a custom alert.
+ ///
int (CEF_CALLBACK *on_jsalert)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
const cef_string_t* message);
+ ///
// Called to run a JavaScript confirm request. Return false (0) to display the
// default alert or true (1) if you displayed a custom alert. If you handled
// the alert set |retval| to true (1) if the user accepted the confirmation.
+ ///
int (CEF_CALLBACK *on_jsconfirm)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
const cef_string_t* message, int* retval);
+ ///
// Called to run a JavaScript prompt request. Return false (0) to display the
// default prompt or true (1) if you displayed a custom prompt. If you handled
// the prompt set |retval| to true (1) if the user accepted the prompt and
// request and |result| to the resulting value.
+ ///
int (CEF_CALLBACK *on_jsprompt)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
const cef_string_t* message, const cef_string_t* defaultValue,
@@ -972,14 +1215,18 @@ typedef struct _cef_jsdialog_handler_t
} cef_jsdialog_handler_t;
+///
// Implement this structure to handle JavaScript binding. The functions of this
// structure will be called on the UI thread.
+///
typedef struct _cef_jsbinding_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called for adding values to a frame's JavaScript 'window' object.
+ ///
void (CEF_CALLBACK *on_jsbinding)(struct _cef_jsbinding_handler_t* self,
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
struct _cef_v8value_t* object);
@@ -987,450 +1234,671 @@ typedef struct _cef_jsbinding_handler_t
} cef_jsbinding_handler_t;
+///
// Implement this structure to handle events when window rendering is disabled.
// The functions of this structure will be called on the UI thread.
+///
typedef struct _cef_render_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Called to retrieve the view rectangle which is relative to screen
// coordinates. Return true (1) if the rectangle was provided.
+ ///
int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_rect_t* rect);
+ ///
// Called to retrieve the simulated screen rectangle. Return true (1) if the
// rectangle was provided.
+ ///
int (CEF_CALLBACK *get_screen_rect)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_rect_t* rect);
+ ///
// Called to retrieve the translation from view coordinates to actual screen
// coordinates. Return true (1) if the screen coordinates were provided.
+ ///
int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, int viewX, int viewY, int* screenX,
int* screenY);
+ ///
// Called when the browser wants to show or hide the popup widget. The popup
// should be shown if |show| is true (1) and hidden if |show| is false (0).
+ ///
void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, int show);
+ ///
// Called when the browser wants to move or resize the popup widget. |rect|
// contains the new location and size.
+ ///
void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, const cef_rect_t* rect);
+ ///
// 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.
+ ///
void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, enum cef_paint_element_type_t type,
const cef_rect_t* dirtyRect, const void* buffer);
+ ///
// Called when the browser window's cursor has changed.
+ ///
void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_cursor_handle_t cursor);
} cef_render_handler_t;
+///
// Implement this structure to provide handler implementations.
+///
typedef struct _cef_client_t
{
// Base structure.
cef_base_t base;
+ ///
// Return the handler for browser life span events.
+ ///
struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for browser load status events.
+ ///
struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for browser request events.
+ ///
struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for browser display state events.
+ ///
struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for focus events.
+ ///
struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for keyboard events.
+ ///
struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for context menu events.
+ ///
struct _cef_menu_handler_t* (CEF_CALLBACK *get_menu_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for printing events.
+ ///
struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for find result events.
+ ///
struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for JavaScript dialog events.
+ ///
struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for JavaScript binding events.
+ ///
struct _cef_jsbinding_handler_t* (CEF_CALLBACK *get_jsbinding_handler)(
struct _cef_client_t* self);
+ ///
// Return the handler for off-screen rendering events.
+ ///
struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)(
struct _cef_client_t* self);
} cef_client_t;
+///
// Structure used to represent a web request. The functions of this structure
// may be called on any thread.
+///
typedef struct _cef_request_t
{
// Base structure.
cef_base_t base;
- // Fully qualified URL to load.
+ ///
+ // Get the fully qualified URL.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self);
+
+ ///
+ // Set the fully qualified URL.
+ ///
void (CEF_CALLBACK *set_url)(struct _cef_request_t* self,
const cef_string_t* url);
- // Optional request function type, defaulting to POST if post data is provided
- // and GET otherwise.
+ ///
+ // Get the request function type. The value will default to POST if post data
+ // is provided and GET otherwise.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self);
+
+ ///
+ // Set the request function type.
+ ///
void (CEF_CALLBACK *set_method)(struct _cef_request_t* self,
const cef_string_t* method);
- // Optional post data.
+ ///
+ // Get the post data.
+ ///
struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)(
struct _cef_request_t* self);
+
+ ///
+ // Set the post data.
+ ///
void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self,
struct _cef_post_data_t* postData);
- // Optional header values.
+ ///
+ // Get the header values.
+ ///
void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self,
cef_string_map_t headerMap);
+
+ ///
+ // Set the header values.
+ ///
void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self,
cef_string_map_t headerMap);
+ ///
// Set all values at one time.
+ ///
void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url,
const cef_string_t* method, struct _cef_post_data_t* postData,
cef_string_map_t headerMap);
- // Optional flags. Used in combination with cef_web_urlrequest_t.
+ ///
+ // Get the flags used in combination with cef_web_urlrequest_t.
+ ///
enum cef_weburlrequest_flags_t (CEF_CALLBACK *get_flags)(
struct _cef_request_t* self);
+
+ ///
+ // Set the flags used in combination with cef_web_urlrequest_t.
+ ///
void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self,
enum cef_weburlrequest_flags_t flags);
- // Optional URL to the first party for cookies. Used in combination with
+ ///
+ // Set the URL to the first party for cookies used in combination with
// cef_web_urlrequest_t.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)(
struct _cef_request_t* self);
+
+ ///
+ // Get the URL to the first party for cookies used in combination with
+ // cef_web_urlrequest_t.
+ ///
void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self,
const cef_string_t* url);
} cef_request_t;
+///
// Create a new cef_request_t object.
+///
CEF_EXPORT cef_request_t* cef_request_create();
+///
// Structure used to represent post data for a web request. The functions of
// this structure may be called on any thread.
+///
typedef struct _cef_post_data_t
{
// Base structure.
cef_base_t base;
+ ///
// Returns the number of existing post data elements.
+ ///
size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self);
+ ///
// Retrieve the post data elements.
+ ///
struct _cef_post_data_element_t* (CEF_CALLBACK *get_elements)(
struct _cef_post_data_t* self, int elementIndex);
+ ///
// Remove the specified post data element. Returns true (1) if the removal
// succeeds.
+ ///
int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
+ ///
// Add the specified post data element. Returns true (1) if the add succeeds.
+ ///
int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self,
struct _cef_post_data_element_t* element);
+ ///
// Remove all existing post data elements.
+ ///
void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self);
} cef_post_data_t;
+///
// Create a new cef_post_data_t object.
+///
CEF_EXPORT cef_post_data_t* cef_post_data_create();
+///
// Structure used to represent a single element in the request post data. The
// functions of this structure may be called on any thread.
+///
typedef struct _cef_post_data_element_t
{
// Base structure.
cef_base_t base;
+ ///
// Remove all contents from the post data element.
+ ///
void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self);
+ ///
// The post data element will represent a file.
+ ///
void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self,
const cef_string_t* fileName);
+ ///
// The post data element will represent bytes. The bytes passed in will be
// copied.
+ ///
void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self,
size_t size, const void* bytes);
+ ///
// Return the type of this post data element.
+ ///
enum cef_postdataelement_type_t (CEF_CALLBACK *get_type)(
struct _cef_post_data_element_t* self);
+ ///
// Return the file name.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_file)(
struct _cef_post_data_element_t* self);
+ ///
// Return the number of bytes.
+ ///
size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self);
+ ///
// Read up to |size| bytes into |bytes| and return the number of bytes
// actually read.
+ ///
size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self,
size_t size, void* bytes);
} cef_post_data_element_t;
+///
// Create a new cef_post_data_element_t object.
+///
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
+///
// Structure used to represent a web response. The functions of this structure
// may be called on any thread.
+///
typedef struct _cef_response_t
{
// Base structure.
cef_base_t base;
- // Returns/sets the response status code.
+ ///
+ // Get the response status code.
+ ///
int (CEF_CALLBACK *get_status)(struct _cef_response_t* self);
+
+ ///
+ // Set the response status code.
+ ///
void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status);
- // Returns/sets the response status text.
+ ///
+ // Get the response status text.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_status_text)(
struct _cef_response_t* self);
+
+ ///
+ // Set the response status text.
+ ///
void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self,
const cef_string_t* statusText);
- // Returns/sets the response mime type.
+ ///
+ // Get the response mime type.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_mime_type)(
struct _cef_response_t* self);
+
+ ///
+ // Set the response mime type.
+ ///
void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self,
const cef_string_t* mimeType);
- // Returns the value for the specified response header field.
+ ///
+ // Get the value for the specified response header field.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self,
const cef_string_t* name);
- // Retrieves/sets a map of all response header fields.
+ ///
+ // Get all response header fields.
+ ///
void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self,
cef_string_map_t headerMap);
+
+ ///
+ // Set all response header fields.
+ ///
void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self,
cef_string_map_t headerMap);
} cef_response_t;
+///
// Structure the client can implement to provide a custom stream reader. The
// functions of this structure may be called on any thread.
+///
typedef struct _cef_read_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Read raw binary data.
+ ///
size_t (CEF_CALLBACK *read)(struct _cef_read_handler_t* self, void* ptr,
size_t size, size_t n);
+ ///
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
// SEEK_END or SEEK_SET.
+ ///
int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, long offset,
int whence);
+ ///
// Return the current offset position.
+ ///
long (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self);
+ ///
// Return non-zero if at end of file.
+ ///
int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self);
} cef_read_handler_t;
+///
// Structure used to read data from a stream. The functions of this structure
// may be called on any thread.
+///
typedef struct _cef_stream_reader_t
{
// Base structure.
cef_base_t base;
+ ///
// Read raw binary data.
+ ///
size_t (CEF_CALLBACK *read)(struct _cef_stream_reader_t* self, void* ptr,
size_t size, size_t n);
+ ///
// 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.
+ ///
int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, long offset,
int whence);
+ ///
// Return the current offset position.
+ ///
long (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self);
+ ///
// Return non-zero if at end of file.
+ ///
int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self);
} cef_stream_reader_t;
-// Create a new cef_stream_reader_t object.
+///
+// Create a new cef_stream_reader_t object from a file.
+///
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file(
const cef_string_t* fileName);
+
+///
+// Create a new cef_stream_reader_t object from data.
+///
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data,
size_t size);
+
+///
+// Create a new cef_stream_reader_t object from a custom handler.
+///
CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler(
cef_read_handler_t* handler);
+///
// Structure the client can implement to provide a custom stream writer. The
// functions of this structure may be called on any thread.
+///
typedef struct _cef_write_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Write raw binary data.
+ ///
size_t (CEF_CALLBACK *write)(struct _cef_write_handler_t* self,
const void* ptr, size_t size, size_t n);
+ ///
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
// SEEK_END or SEEK_SET.
+ ///
int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, long offset,
int whence);
+ ///
// Return the current offset position.
+ ///
long (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self);
+ ///
// Flush the stream.
+ ///
int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self);
} cef_write_handler_t;
+///
// Structure used to write data to a stream. The functions of this structure may
// be called on any thread.
+///
typedef struct _cef_stream_writer_t
{
// Base structure.
cef_base_t base;
+ ///
// Write raw binary data.
+ ///
size_t (CEF_CALLBACK *write)(struct _cef_stream_writer_t* self,
const void* ptr, size_t size, size_t n);
+ ///
// Seek to the specified offset position. |whence| may be any one of SEEK_CUR,
// SEEK_END or SEEK_SET.
+ ///
int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, long offset,
int whence);
+ ///
// Return the current offset position.
+ ///
long (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self);
+ ///
// Flush the stream.
+ ///
int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self);
} cef_stream_writer_t;
-// Create a new cef_stream_writer_t object.
+///
+// Create a new cef_stream_writer_t object for a file.
+///
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file(
const cef_string_t* fileName);
+
+///
+// Create a new cef_stream_writer_t object for a custom handler.
+///
CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler(
cef_write_handler_t* handler);
+///
// Structure that encapsulates a V8 context handle.
+///
typedef struct _cef_v8context_t
{
// Base structure.
cef_base_t base;
+ ///
// Returns the browser for this context.
+ ///
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
struct _cef_v8context_t* self);
+ ///
// Returns the frame for this context.
+ ///
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_v8context_t* self);
+ ///
// Returns the global object for this context.
+ ///
struct _cef_v8value_t* (CEF_CALLBACK *get_global)(
struct _cef_v8context_t* self);
+ ///
// Enter this context. A context must be explicitly entered before creating a
// V8 Object, Array or Function asynchronously. exit() must be called the same
// number of times as enter() before releasing this context. V8 objects belong
// to the context in which they are created. Returns true (1) if the scope was
// entered successfully.
+ ///
int (CEF_CALLBACK *enter)(struct _cef_v8context_t* self);
+ ///
// Exit this context. Call this function only after calling enter(). Returns
// true (1) if the scope was exited successfully.
+ ///
int (CEF_CALLBACK *exit)(struct _cef_v8context_t* self);
} cef_v8context_t;
+///
// Returns the current (top) context object in the V8 context stack.
+///
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context();
+///
// Returns the entered (bottom) context object in the V8 context stack.
+///
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context();
+///
// Structure that should be implemented to handle V8 function calls. The
// functions of this structure will always be called on the UI thread.
+///
typedef struct _cef_v8handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Execute with the specified argument list and return value. Return true (1)
// if the function was handled. To invoke V8 callback functions outside the
// scope of this function you need to keep references to the current V8
// context (cef_v8context_t) along with any necessary callback objects.
+ ///
int (CEF_CALLBACK *execute)(struct _cef_v8handler_t* self,
const cef_string_t* name, struct _cef_v8value_t* object,
size_t argumentCount, struct _cef_v8value_t* const* arguments,
@@ -1439,26 +1907,32 @@ typedef struct _cef_v8handler_t
} cef_v8handler_t;
+///
// Structure that should be implemented to handle V8 accessor calls. Accessor
// identifiers are registered by calling cef_v8value_t::set_value(). The
// functions of this structure will always be called on the UI thread.
+///
typedef struct _cef_v8accessor_t
{
// Base structure.
cef_base_t base;
+ ///
// Called to get an accessor value. |name| is the name of the property being
// accessed. |object| is the This() object from V8's AccessorInfo structure.
// |retval| is the value to return for this property. Return true (1) if
// handled.
+ ///
int (CEF_CALLBACK *get)(struct _cef_v8accessor_t* self,
const cef_string_t* name, struct _cef_v8value_t* object,
struct _cef_v8value_t** retval);
+ ///
// Called to set an accessor value. |name| is the name of the property being
// accessed. |value| is the new value being assigned to this property.
// |object| is the This() object from V8's AccessorInfo structure. Return true
// (1) if handled.
+ ///
int (CEF_CALLBACK *set)(struct _cef_v8accessor_t* self,
const cef_string_t* name, struct _cef_v8value_t* object,
struct _cef_v8value_t* value);
@@ -1466,36 +1940,100 @@ typedef struct _cef_v8accessor_t
} cef_v8accessor_t;
+///
// Structure representing a V8 value. The functions of this structure should
// only be called on the UI thread.
+///
typedef struct _cef_v8value_t
{
// Base structure.
cef_base_t base;
- // Check the value type.
+ ///
+ // True if the value type is undefined.
+ ///
int (CEF_CALLBACK *is_undefined)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is null.
+ ///
int (CEF_CALLBACK *is_null)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is bool.
+ ///
int (CEF_CALLBACK *is_bool)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is int.
+ ///
int (CEF_CALLBACK *is_int)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is double.
+ ///
int (CEF_CALLBACK *is_double)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is Date.
+ ///
int (CEF_CALLBACK *is_date)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is string.
+ ///
int (CEF_CALLBACK *is_string)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is object.
+ ///
int (CEF_CALLBACK *is_object)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is array.
+ ///
int (CEF_CALLBACK *is_array)(struct _cef_v8value_t* self);
+
+ ///
+ // True if the value type is function.
+ ///
int (CEF_CALLBACK *is_function)(struct _cef_v8value_t* self);
+ ///
// Returns true (1) if this object is pointing to the same handle as |that|
// object.
+ ///
int (CEF_CALLBACK *is_same)(struct _cef_v8value_t* self,
struct _cef_v8value_t* that);
- // Return a primitive value type. The underlying data will be converted to
- // the requested type if necessary.
+ ///
+ // Return a bool value. The underlying data will be converted to if
+ // necessary.
+ ///
int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self);
+
+ ///
+ // Return an int value. The underlying data will be converted to if
+ // necessary.
+ ///
int (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self);
+
+ ///
+ // Return a double value. The underlying data will be converted to if
+ // necessary.
+ ///
double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self);
+
+ ///
+ // Return a Date value. The underlying data will be converted to if
+ // necessary.
+ ///
cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self);
+
+ ///
+ // Return a string value. The underlying data will be converted to if
+ // necessary.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_string_value)(
struct _cef_v8value_t* self);
@@ -1506,70 +2044,110 @@ typedef struct _cef_v8value_t
// interchangably with the framework converting between them as necessary.
// Keys beginning with "Cef::" and "v8::" are reserved by the system.
+ ///
// Returns true (1) if the object has a value with the specified identifier.
+ ///
int (CEF_CALLBACK *has_value_bykey)(struct _cef_v8value_t* self,
const cef_string_t* key);
+
+ ///
+ // Returns true (1) if the object has a value with the specified identifier.
+ ///
int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, int index);
+ ///
// Delete the value with the specified identifier.
+ ///
int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self,
const cef_string_t* key);
+
+ ///
+ // Delete the value with the specified identifier.
+ ///
int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self,
int index);
+ ///
// Returns the value with the specified identifier.
+ ///
struct _cef_v8value_t* (CEF_CALLBACK *get_value_bykey)(
struct _cef_v8value_t* self, const cef_string_t* key);
+
+ ///
+ // Returns the value with the specified identifier.
+ ///
struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)(
struct _cef_v8value_t* self, int index);
+ ///
// Associate a value with the specified identifier.
+ ///
int (CEF_CALLBACK *set_value_bykey)(struct _cef_v8value_t* self,
const cef_string_t* key, struct _cef_v8value_t* value);
+
+ ///
+ // Associate a value with the specified identifier.
+ ///
int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index,
struct _cef_v8value_t* value);
+ ///
// Register an identifier whose access will be forwarded to the
// cef_v8accessor_t instance passed to
// cef_v8value_t::cef_v8value_create_object_with_accessor().
+ ///
int (CEF_CALLBACK *set_value_byaccessor)(struct _cef_v8value_t* self,
const cef_string_t* key, enum cef_v8_accesscontrol_t settings,
enum cef_v8_propertyattribute_t attribute);
+ ///
// Read the keys for the object's values into the specified vector. Integer-
// based keys will also be returned as strings.
+ ///
int (CEF_CALLBACK *get_keys)(struct _cef_v8value_t* self,
cef_string_list_t keys);
+ ///
// Returns the user data, if any, specified when the object was created.
+ ///
struct _cef_base_t* (CEF_CALLBACK *get_user_data)(
struct _cef_v8value_t* self);
// ARRAY METHODS - These functions are only available on arrays.
+ ///
// Returns the number of elements in the array.
+ ///
int (CEF_CALLBACK *get_array_length)(struct _cef_v8value_t* self);
// FUNCTION METHODS - These functions are only available on functions.
+ ///
// Returns the function name.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_function_name)(
struct _cef_v8value_t* self);
+ ///
// Returns the function handler or NULL if not a CEF-created function.
+ ///
struct _cef_v8handler_t* (CEF_CALLBACK *get_function_handler)(
struct _cef_v8value_t* self);
+ ///
// Execute the function using the current V8 context.
+ ///
int (CEF_CALLBACK *execute_function)(struct _cef_v8value_t* self,
struct _cef_v8value_t* object, size_t argumentCount,
struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval,
cef_string_t* exception);
+ ///
// Execute the function using the specified V8 context.
+ ///
int (CEF_CALLBACK *execute_function_with_context)(struct _cef_v8value_t* self,
struct _cef_v8context_t* context, struct _cef_v8value_t* object,
size_t argumentCount, struct _cef_v8value_t* const* arguments,
@@ -1578,30 +2156,76 @@ typedef struct _cef_v8value_t
} cef_v8value_t;
-// Create a new cef_v8value_t object of the specified type.
+///
+// Create a new cef_v8value_t object of type undefined.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined();
+
+///
+// Create a new cef_v8value_t object of type null.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_null();
+
+///
+// Create a new cef_v8value_t object of type bool.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value);
+
+///
+// Create a new cef_v8value_t object of type int.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value);
+
+///
+// Create a new cef_v8value_t object of type double.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value);
+
+///
+// Create a new cef_v8value_t object of type Date.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date);
+
+///
+// Create a new cef_v8value_t object of type string.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value);
+
+///
+// Create a new cef_v8value_t object of type object.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_base_t* user_data);
+
+///
+// Create a new cef_v8value_t object of type object with accessors.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_object_with_accessor(
cef_base_t* user_data, cef_v8accessor_t* accessor);
+
+///
+// Create a new cef_v8value_t object of type array.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_array();
+
+///
+// Create a new cef_v8value_t object of type function.
+///
CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name,
cef_v8handler_t* handler);
+///
// Structure that creates cef_scheme_handler_t instances. The functions of this
// structure will always be called on the IO thread.
+///
typedef struct _cef_scheme_handler_factory_t
{
// Base structure.
cef_base_t base;
+ ///
// Return a new scheme handler instance to handle the request.
+ ///
struct _cef_scheme_handler_t* (CEF_CALLBACK *create)(
struct _cef_scheme_handler_factory_t* self,
const cef_string_t* scheme_name, struct _cef_request_t* request);
@@ -1609,13 +2233,16 @@ typedef struct _cef_scheme_handler_factory_t
} cef_scheme_handler_factory_t;
+///
// Structure used to represent a custom scheme handler structure. The functions
// of this structure will always be called on the IO thread.
+///
typedef struct _cef_scheme_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// Process the request. All response generation should take place in this
// function. If there is no response set |response_length| to zero or return
// false (0) and read_response() will not be called. If the response length is
@@ -1628,102 +2255,135 @@ typedef struct _cef_scheme_handler_t
// optional header values for the response and return true (1). To redirect
// the request to a new URL set |redirectUrl| to the new URL and return true
// (1).
+ ///
int (CEF_CALLBACK *process_request)(struct _cef_scheme_handler_t* self,
struct _cef_request_t* request, cef_string_t* redirectUrl,
struct _cef_response_t* response, int* response_length);
+ ///
// Cancel processing of the request.
+ ///
void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_t* self);
+ ///
// Copy up to |bytes_to_read| bytes into |data_out|. If the copy succeeds set
// |bytes_read| to the number of bytes copied and return true (1). If the copy
// fails return false (0) and read_response() will not be called again.
+ ///
int (CEF_CALLBACK *read_response)(struct _cef_scheme_handler_t* self,
void* data_out, int bytes_to_read, int* bytes_read);
} cef_scheme_handler_t;
+///
// Structure used to handle file downloads. The functions of this structure will
// always be called on the UI thread.
+///
typedef struct _cef_download_handler_t
{
// Base structure.
cef_base_t base;
+ ///
// A portion of the file contents have been received. This function will be
// called multiple times until the download is complete. Return |true (1)| to
// continue receiving data and |false (0)| to cancel.
+ ///
int (CEF_CALLBACK *received_data)(struct _cef_download_handler_t* self,
void* data, int data_size);
+ ///
// The download is complete.
+ ///
void (CEF_CALLBACK *complete)(struct _cef_download_handler_t* self);
} cef_download_handler_t;
+///
// Structure used to make a Web URL request. Web URL requests are not associated
// with a browser instance so no cef_client_t callbacks will be executed. The
// functions of this structure may be called on any thread.
+///
typedef struct _cef_web_urlrequest_t
{
// Base structure.
cef_base_t base;
+ ///
// Cancels the request.
+ ///
void (CEF_CALLBACK *cancel)(struct _cef_web_urlrequest_t* self);
+ ///
// Returns the current ready state of the request.
+ ///
enum cef_weburlrequest_state_t (CEF_CALLBACK *get_state)(
struct _cef_web_urlrequest_t* self);
} cef_web_urlrequest_t;
-// Create a new CefWebUrlReqeust object.
+///
+// Create a new CefWebUrlRequest object.
+///
CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create(
cef_request_t* request, struct _cef_web_urlrequest_client_t* client);
+///
// Structure that should be implemented by the cef_web_urlrequest_t client. The
// functions of this structure will always be called on the UI thread.
+///
typedef struct _cef_web_urlrequest_client_t
{
// Base structure.
cef_base_t base;
+ ///
// Notifies the client that the request state has changed. State change
// notifications will always be sent before the below notification functions
// are called.
+ ///
void (CEF_CALLBACK *on_state_change)(
struct _cef_web_urlrequest_client_t* self,
struct _cef_web_urlrequest_t* requester,
enum cef_weburlrequest_state_t state);
+ ///
// Notifies the client that the request has been redirected and provides a
// chance to change the request parameters.
+ ///
void (CEF_CALLBACK *on_redirect)(struct _cef_web_urlrequest_client_t* self,
struct _cef_web_urlrequest_t* requester, struct _cef_request_t* request,
struct _cef_response_t* response);
+ ///
// Notifies the client of the response data.
+ ///
void (CEF_CALLBACK *on_headers_received)(
struct _cef_web_urlrequest_client_t* self,
struct _cef_web_urlrequest_t* requester,
struct _cef_response_t* response);
+ ///
// Notifies the client of the upload progress.
+ ///
void (CEF_CALLBACK *on_progress)(struct _cef_web_urlrequest_client_t* self,
struct _cef_web_urlrequest_t* requester, uint64 bytesSent,
uint64 totalBytesToBeSent);
+ ///
// Notifies the client that content has been received.
+ ///
void (CEF_CALLBACK *on_data)(struct _cef_web_urlrequest_client_t* self,
struct _cef_web_urlrequest_t* requester, const void* data,
int dataLength);
+ ///
// Notifies the client that the request ended with an error.
+ ///
void (CEF_CALLBACK *on_error)(struct _cef_web_urlrequest_client_t* self,
struct _cef_web_urlrequest_t* requester,
enum cef_handler_errorcode_t errorCode);
@@ -1731,27 +2391,37 @@ typedef struct _cef_web_urlrequest_client_t
} cef_web_urlrequest_client_t;
+///
// Structure that supports the reading of XML data via the libxml streaming API.
// The functions of this structure should only be called on the thread that
// creates the object.
+///
typedef struct _cef_xml_reader_t
{
// Base structure.
cef_base_t base;
+ ///
// Moves the cursor to the next node in the document. This function must be
// called at least once to set the current cursor position. Returns true (1)
// if the cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_next_node)(struct _cef_xml_reader_t* self);
+ ///
// Close the document. This should be called directly to ensure that cleanup
// occurs on the correct thread.
+ ///
int (CEF_CALLBACK *close)(struct _cef_xml_reader_t* self);
+ ///
// Returns true (1) if an error has been reported by the XML parser.
+ ///
int (CEF_CALLBACK *has_error)(struct _cef_xml_reader_t* self);
+ ///
// Returns the error string.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_error)(
struct _cef_xml_reader_t* self);
@@ -1760,95 +2430,133 @@ typedef struct _cef_xml_reader_t
// The below functions retrieve data for the node at the current cursor
// position.
+ ///
// Returns the node type.
+ ///
enum cef_xml_node_type_t (CEF_CALLBACK *get_type)(
struct _cef_xml_reader_t* self);
+ ///
// Returns the node depth. Depth starts at 0 for the root node.
+ ///
int (CEF_CALLBACK *get_depth)(struct _cef_xml_reader_t* self);
+ ///
// Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT-
// LocalPart for additional details.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_local_name)(
struct _cef_xml_reader_t* self);
+ ///
// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for
// additional details.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_prefix)(
struct _cef_xml_reader_t* self);
+ ///
// Returns the qualified name, equal to (Prefix:)LocalName. See
// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_qualified_name)(
struct _cef_xml_reader_t* self);
+ ///
// Returns the URI defining the namespace associated with the node. See
// http://www.w3.org/TR/REC-xml-names/ for additional details.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_namespace_uri)(
struct _cef_xml_reader_t* self);
+ ///
// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for
// additional details.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_base_uri)(
struct _cef_xml_reader_t* self);
+ ///
// Returns the xml:lang scope within which the node resides. See
// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_xml_lang)(
struct _cef_xml_reader_t* self);
+ ///
// Returns true (1) if the node represents an NULL element. is considered
// NULL but is not.
+ ///
int (CEF_CALLBACK *is_empty_element)(struct _cef_xml_reader_t* self);
+ ///
// Returns true (1) if the node has a text value.
+ ///
int (CEF_CALLBACK *has_value)(struct _cef_xml_reader_t* self);
+ ///
// Returns the text value.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_value)(
struct _cef_xml_reader_t* self);
+ ///
// Returns true (1) if the node has attributes.
+ ///
int (CEF_CALLBACK *has_attributes)(struct _cef_xml_reader_t* self);
+ ///
// Returns the number of attributes.
+ ///
size_t (CEF_CALLBACK *get_attribute_count)(struct _cef_xml_reader_t* self);
+ ///
// Returns the value of the attribute at the specified 0-based index.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_attribute_byindex)(
struct _cef_xml_reader_t* self, int index);
+ ///
// Returns the value of the attribute with the specified qualified name.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_attribute_byqname)(
struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName);
+ ///
// Returns the value of the attribute with the specified local name and
// namespace URI.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_attribute_bylname)(
struct _cef_xml_reader_t* self, const cef_string_t* localName,
const cef_string_t* namespaceURI);
+ ///
// Returns an XML representation of the current node's children.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_inner_xml)(
struct _cef_xml_reader_t* self);
+ ///
// Returns an XML representation of the current node including its children.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_outer_xml)(
struct _cef_xml_reader_t* self);
+ ///
// Returns the line number for the current node.
+ ///
int (CEF_CALLBACK *get_line_number)(struct _cef_xml_reader_t* self);
@@ -1857,199 +2565,279 @@ typedef struct _cef_xml_reader_t
// 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.
+ ///
// Moves the cursor to the attribute at the specified 0-based index. Returns
// true (1) if the cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_attribute_byindex)(struct _cef_xml_reader_t* self,
int index);
+ ///
// Moves the cursor to the attribute with the specified qualified name.
// Returns true (1) if the cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_attribute_byqname)(struct _cef_xml_reader_t* self,
const cef_string_t* qualifiedName);
+ ///
// Moves the cursor to the attribute with the specified local name and
// namespace URI. Returns true (1) if the cursor position was set
// successfully.
+ ///
int (CEF_CALLBACK *move_to_attribute_bylname)(struct _cef_xml_reader_t* self,
const cef_string_t* localName, const cef_string_t* namespaceURI);
+ ///
// Moves the cursor to the first attribute in the current element. Returns
// true (1) if the cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_first_attribute)(struct _cef_xml_reader_t* self);
+ ///
// Moves the cursor to the next attribute in the current element. Returns true
// (1) if the cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_next_attribute)(struct _cef_xml_reader_t* self);
+ ///
// Moves the cursor back to the carrying element. Returns true (1) if the
// cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_carrying_element)(struct _cef_xml_reader_t* self);
} cef_xml_reader_t;
+///
// Create a new cef_xml_reader_t object. The returned object's functions can
// only be called from the thread that created the object.
+///
CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream,
enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI);
+///
// Structure that supports the reading of zip archives via the zlib unzip API.
// The functions of this structure should only be called on the thread that
// creates the object.
+///
typedef struct _cef_zip_reader_t
{
// Base structure.
cef_base_t base;
+ ///
// Moves the cursor to the first file in the archive. Returns true (1) if the
// cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_first_file)(struct _cef_zip_reader_t* self);
+ ///
// Moves the cursor to the next file in the archive. Returns true (1) if the
// cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_next_file)(struct _cef_zip_reader_t* self);
+ ///
// Moves the cursor to the specified file in the archive. If |caseSensitive|
// is true (1) then the search will be case sensitive. Returns true (1) if the
// cursor position was set successfully.
+ ///
int (CEF_CALLBACK *move_to_file)(struct _cef_zip_reader_t* self,
const cef_string_t* fileName, int caseSensitive);
+ ///
// Closes the archive. This should be called directly to ensure that cleanup
// occurs on the correct thread.
+ ///
int (CEF_CALLBACK *close)(struct _cef_zip_reader_t* self);
// The below functions act on the file at the current cursor position.
+ ///
// Returns the name of the file.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_file_name)(
struct _cef_zip_reader_t* self);
+ ///
// Returns the uncompressed size of the file.
+ ///
long (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self);
+ ///
// Returns the last modified timestamp for the file.
+ ///
time_t (CEF_CALLBACK *get_file_last_modified)(struct _cef_zip_reader_t* self);
+ ///
// Opens the file for reading of uncompressed data. A read password may
// optionally be specified.
+ ///
int (CEF_CALLBACK *open_file)(struct _cef_zip_reader_t* self,
const cef_string_t* password);
+ ///
// Closes the file.
+ ///
int (CEF_CALLBACK *close_file)(struct _cef_zip_reader_t* self);
+ ///
// 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.
+ ///
int (CEF_CALLBACK *read_file)(struct _cef_zip_reader_t* self, void* buffer,
size_t bufferSize);
+ ///
// Returns the current offset in the uncompressed file contents.
+ ///
long (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self);
+ ///
// Returns true (1) if at end of the file contents.
+ ///
int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self);
} cef_zip_reader_t;
+///
// Create a new cef_zip_reader_t object. The returned object's functions can
// only be called from the thread that created the object.
+///
CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create(cef_stream_reader_t* stream);
+///
// Structure to implement for visiting the DOM. The functions of this structure
// will be called on the UI thread.
+///
typedef struct _cef_domvisitor_t
{
// Base structure.
cef_base_t base;
+ ///
// Method executed for visiting the DOM. The document object passed to this
// function represents a snapshot of the DOM at the time this function is
// executed. DOM objects are only valid for the scope of this function. Do not
// keep references to or attempt to access any DOM objects outside the scope
// of this function.
+ ///
void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self,
struct _cef_domdocument_t* document);
} cef_domvisitor_t;
+///
// Structure used to represent a DOM document. The functions of this structure
// should only be called on the UI thread.
+///
typedef struct _cef_domdocument_t
{
// Base structure.
cef_base_t base;
+ ///
// Returns the document type.
+ ///
enum cef_dom_document_type_t (CEF_CALLBACK *get_type)(
struct _cef_domdocument_t* self);
+ ///
// Returns the root document node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_document)(
struct _cef_domdocument_t* self);
+ ///
// Returns the BODY node of an HTML document.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_body)(
struct _cef_domdocument_t* self);
+ ///
// Returns the HEAD node of an HTML document.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_head)(
struct _cef_domdocument_t* self);
+ ///
// Returns the title of an HTML document.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_title)(
struct _cef_domdocument_t* self);
+ ///
// Returns the document element with the specified ID value.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)(
struct _cef_domdocument_t* self, const cef_string_t* id);
+ ///
// Returns the node that currently has keyboard focus.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)(
struct _cef_domdocument_t* self);
+ ///
// Returns true (1) if a portion of the document is selected.
+ ///
int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self);
+ ///
// Returns the selection start node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_selection_start_node)(
struct _cef_domdocument_t* self);
+ ///
// Returns the selection offset within the start node.
+ ///
int (CEF_CALLBACK *get_selection_start_offset)(
struct _cef_domdocument_t* self);
+ ///
// Returns the selection end node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_selection_end_node)(
struct _cef_domdocument_t* self);
+ ///
// Returns the selection offset within the end node.
+ ///
int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self);
+ ///
// Returns the contents of this selection as markup.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)(
struct _cef_domdocument_t* self);
+ ///
// Returns the contents of this selection as text.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)(
struct _cef_domdocument_t* self);
+ ///
// Returns the base URL for the document.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_base_url)(
struct _cef_domdocument_t* self);
+ ///
// Returns a complete URL based on the document base URL and the specified
// partial URL.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_complete_url)(
struct _cef_domdocument_t* self, const cef_string_t* partialURL);
@@ -2057,72 +2845,105 @@ typedef struct _cef_domdocument_t
} cef_domdocument_t;
+///
// Structure used to represent a DOM node. The functions of this structure
// should only be called on the UI thread.
+///
typedef struct _cef_domnode_t
{
// Base structure.
cef_base_t base;
+ ///
// Returns the type for this node.
+ ///
enum cef_dom_node_type_t (CEF_CALLBACK *get_type)(
struct _cef_domnode_t* self);
+ ///
// Returns true (1) if this is a text node.
+ ///
int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self);
+ ///
// Returns true (1) if this is an element node.
+ ///
int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self);
+ ///
// Returns true (1) if this object is pointing to the same handle as |that|
// object.
+ ///
int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self,
struct _cef_domnode_t* that);
+ ///
// Returns the name of this node.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self);
+ ///
// Returns the value of this node.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self);
+ ///
// Set the value of this node. Returns true (1) on success.
+ ///
int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self,
const cef_string_t* value);
+ ///
// Returns the contents of this node as markup.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_as_markup)(
struct _cef_domnode_t* self);
+ ///
// Returns the document associated with this node.
+ ///
struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
struct _cef_domnode_t* self);
+ ///
// Returns the parent node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_parent)(
struct _cef_domnode_t* self);
+ ///
// Returns the previous sibling node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)(
struct _cef_domnode_t* self);
+ ///
// Returns the next sibling node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)(
struct _cef_domnode_t* self);
+ ///
// Returns true (1) if this node has child nodes.
+ ///
int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self);
+ ///
// Return the first child node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)(
struct _cef_domnode_t* self);
+ ///
// Returns the last child node.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)(
struct _cef_domnode_t* self);
+ ///
// Add an event listener to this node for the specified event type. If
// |useCapture| is true (1) then this listener will be considered a capturing
// listener. Capturing listeners will recieve all events of the specified type
@@ -2131,6 +2952,7 @@ typedef struct _cef_domnode_t
// tree will not trigger a capturing listener. Separate calls to this function
// can be used to register the same listener with and without capture. See
// WebCore/dom/EventNames.h for the list of supported event types.
+ ///
void (CEF_CALLBACK *add_event_listener)(struct _cef_domnode_t* self,
const cef_string_t* eventType, struct _cef_domevent_listener_t* listener,
int useCapture);
@@ -2138,33 +2960,47 @@ typedef struct _cef_domnode_t
// The following functions are valid only for element nodes.
+ ///
// Returns the tag name of this element.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)(
struct _cef_domnode_t* self);
+ ///
// Returns true (1) if this element has attributes.
+ ///
int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self);
+ ///
// Returns true (1) if this element has an attribute named |attrName|.
+ ///
int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName);
+ ///
// Returns the element attribute named |attrName|.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)(
struct _cef_domnode_t* self, const cef_string_t* attrName);
+ ///
// Returns a map of all element attributes.
+ ///
void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self,
cef_string_map_t attrMap);
+ ///
// Set the value for the element attribute named |attrName|. Returns true (1)
// on success.
+ ///
int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self,
const cef_string_t* attrName, const cef_string_t* value);
+ ///
// Returns the inner text of the element.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)(
struct _cef_domnode_t* self);
@@ -2172,80 +3008,108 @@ typedef struct _cef_domnode_t
} cef_domnode_t;
+///
// Structure used to represent a DOM event. The functions of this structure
// should only be called on the UI thread.
+///
typedef struct _cef_domevent_t
{
// Base structure.
cef_base_t base;
+ ///
// Returns the event type.
+ ///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_type)(struct _cef_domevent_t* self);
+ ///
// Returns the event category.
+ ///
enum cef_dom_event_category_t (CEF_CALLBACK *get_category)(
struct _cef_domevent_t* self);
+ ///
// Returns the event processing phase.
+ ///
enum cef_dom_event_phase_t (CEF_CALLBACK *get_phase)(
struct _cef_domevent_t* self);
+ ///
// Returns true (1) if the event can bubble up the tree.
+ ///
int (CEF_CALLBACK *can_bubble)(struct _cef_domevent_t* self);
+ ///
// Returns true (1) if the event can be canceled.
+ ///
int (CEF_CALLBACK *can_cancel)(struct _cef_domevent_t* self);
+ ///
// Returns the document associated with this event.
+ ///
struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
struct _cef_domevent_t* self);
+ ///
// Returns the target of the event.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_target)(
struct _cef_domevent_t* self);
+ ///
// Returns the current target of the event.
+ ///
struct _cef_domnode_t* (CEF_CALLBACK *get_current_target)(
struct _cef_domevent_t* self);
} cef_domevent_t;
+///
// Structure to implement for handling DOM events. The functions of this
// structure will be called on the UI thread.
+///
typedef struct _cef_domevent_listener_t
{
// Base structure.
cef_base_t base;
+ ///
// Called when an event is received. The event object passed to this function
// contains a snapshot of the DOM at the time this function is executed. DOM
// objects are only valid for the scope of this function. Do not keep
// references to or attempt to access any DOM objects outside the scope of
// this function.
+ ///
void (CEF_CALLBACK *handle_event)(struct _cef_domevent_listener_t* self,
struct _cef_domevent_t* event);
} cef_domevent_listener_t;
+///
// Structure to implement for filtering response content. The functions of this
// structure will always be called on the UI thread.
+///
typedef struct _cef_content_filter_t
{
// Base structure.
cef_base_t base;
+ ///
// Set |substitute_data| to the replacement for the data in |data| if data
// should be modified.
+ ///
void (CEF_CALLBACK *process_data)(struct _cef_content_filter_t* self,
const void* data, int data_size,
struct _cef_stream_reader_t** substitute_data);
+ ///
// Called when there is no more data to be processed. It is expected that
// whatever data was retained in the last process_data() call, it should be
// returned now by setting |remainder| if appropriate.
+ ///
void (CEF_CALLBACK *drain)(struct _cef_content_filter_t* self,
struct _cef_stream_reader_t** remainder);
diff --git a/include/cef_nplugin.h b/include/cef_nplugin.h
index 87381172b..9d94e9f7e 100644
--- a/include/cef_nplugin.h
+++ b/include/cef_nplugin.h
@@ -33,15 +33,17 @@
#include "internal/cef_nplugin_types.h"
+///
// Netscape plugins are normally built at separate DLLs that are loaded by the
// browser when needed. This interface supports the creation of plugins that
// are an embedded component of the application. Embedded plugins built using
// this interface use the same Netscape Plugin API as DLL-based plugins.
// See https://developer.mozilla.org/En/Gecko_Plugin_API_Reference for complete
// documentation on how to use the Netscape Plugin API.
-
+//
// This class provides attribute information and entry point functions for a
// plugin.
+///
class CefPluginInfo : public cef_plugin_info_t
{
public:
@@ -111,7 +113,9 @@ protected:
}
};
+///
// Register a plugin with the system.
+///
bool CefRegisterPlugin(const CefPluginInfo& plugin_info);
#endif // _CEF_NPLUGIN_H
diff --git a/include/cef_nplugin_capi.h b/include/cef_nplugin_capi.h
index ebdd04a6e..f3f46d080 100644
--- a/include/cef_nplugin_capi.h
+++ b/include/cef_nplugin_capi.h
@@ -37,7 +37,9 @@ extern "C" {
#include "internal/cef_nplugin_types.h"
+///
// Register a plugin with the system. Returns true (1) on success.
+///
CEF_EXPORT int cef_register_plugin(const cef_plugin_info_t* plugin_info);
#ifdef __cplusplus
diff --git a/include/cef_wrapper.h b/include/cef_wrapper.h
index 7152e0eeb..e455ce812 100644
--- a/include/cef_wrapper.h
+++ b/include/cef_wrapper.h
@@ -40,11 +40,12 @@
#include
+///
template
class CefRefPtr {
public:
diff --git a/include/internal/cef_string.h b/include/internal/cef_string.h
index 56792e6ec..192164915 100644
--- a/include/internal/cef_string.h
+++ b/include/internal/cef_string.h
@@ -48,10 +48,10 @@
#ifdef __cplusplus
#include "cef_string_wrappers.h"
-#if defined(CEF_STRING_TYPE_UTF8)
-typedef CefStringUTF8 CefString;
-#elif defined(CEF_STRING_TYPE_UTF16)
+#if defined(CEF_STRING_TYPE_UTF16)
typedef CefStringUTF16 CefString;
+#elif defined(CEF_STRING_TYPE_UTF8)
+typedef CefStringUTF8 CefString;
#elif defined(CEF_STRING_TYPE_WIDE)
typedef CefStringWide CefString;
#endif
diff --git a/include/internal/cef_string_list.h b/include/internal/cef_string_list.h
index 1e7bc7ead..fef0a97cc 100644
--- a/include/internal/cef_string_list.h
+++ b/include/internal/cef_string_list.h
@@ -37,31 +37,47 @@
extern "C" {
#endif
+///
// CEF string maps are a set of key/value string pairs.
+///
typedef void* cef_string_list_t;
+///
// Allocate a new string map.
+///
CEF_EXPORT cef_string_list_t cef_string_list_alloc();
+///
// Return the number of elements in the string list.
+///
CEF_EXPORT int cef_string_list_size(cef_string_list_t list);
+///
// Retrieve the value at the specified zero-based string list index. Returns
// true (1) if the value was successfully retrieved.
+///
CEF_EXPORT int cef_string_list_value(cef_string_list_t list,
int index, cef_string_t* value);
+///
// Append a new value at the end of the string list.
+///
CEF_EXPORT void cef_string_list_append(cef_string_list_t list,
const cef_string_t* value);
+///
// Clear the string list.
+///
CEF_EXPORT void cef_string_list_clear(cef_string_list_t list);
+///
// Free the string list.
+///
CEF_EXPORT void cef_string_list_free(cef_string_list_t list);
+///
// Creates a copy of an existing string list.
+///
CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list);
#ifdef __cplusplus
diff --git a/include/internal/cef_string_map.h b/include/internal/cef_string_map.h
index 64a6378a7..e20f824a1 100644
--- a/include/internal/cef_string_map.h
+++ b/include/internal/cef_string_map.h
@@ -37,37 +37,55 @@
extern "C" {
#endif
+///
// CEF string maps are a set of key/value string pairs.
+///
typedef void* cef_string_map_t;
+///
// Allocate a new string map.
+///
CEF_EXPORT cef_string_map_t cef_string_map_alloc();
+///
// Return the number of elements in the string map.
+///
CEF_EXPORT int cef_string_map_size(cef_string_map_t map);
+///
// Return the value assigned to the specified key.
+///
CEF_EXPORT int cef_string_map_find(cef_string_map_t map,
const cef_string_t* key,
cef_string_t* value);
+///
// Return the key at the specified zero-based string map index.
+///
CEF_EXPORT int cef_string_map_key(cef_string_map_t map, int index,
cef_string_t* key);
+///
// Return the value at the specified zero-based string map index.
+///
CEF_EXPORT int cef_string_map_value(cef_string_map_t map, int index,
cef_string_t* value);
+///
// Append a new key/value pair at the end of the string map.
+///
CEF_EXPORT int cef_string_map_append(cef_string_map_t map,
const cef_string_t* key,
const cef_string_t* value);
+///
// Clear the string map.
+///
CEF_EXPORT void cef_string_map_clear(cef_string_map_t map);
+///
// Free the string map.
+///
CEF_EXPORT void cef_string_map_free(cef_string_map_t map);
diff --git a/include/internal/cef_string_types.h b/include/internal/cef_string_types.h
index f62d43ad1..28d182169 100644
--- a/include/internal/cef_string_types.h
+++ b/include/internal/cef_string_types.h
@@ -82,9 +82,11 @@ typedef struct _cef_string_utf16_t {
} cef_string_utf16_t;
+///
// These functions set string values. If |copy| is true (1) the value will be
// copied instead of referenced. It is up to the user to properly manage
// the lifespan of references.
+///
CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len,
cef_string_wide_t* output, int copy);
@@ -94,7 +96,9 @@ CEF_EXPORT int cef_string_utf16_set(const char16_t* src, size_t src_len,
cef_string_utf16_t* output, int copy);
+///
// Convenience macros for copying values.
+///
#define cef_string_wide_copy(src, src_len, output) \
cef_string_wide_set(src, src_len, output, true)
@@ -104,14 +108,18 @@ CEF_EXPORT int cef_string_utf16_set(const char16_t* src, size_t src_len,
cef_string_utf16_set(src, src_len, output, true)
+///
// These functions clear string values. The structure itself is not freed.
+///
CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str);
CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str);
CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str);
+///
// These functions compare two string values with the same results as strcmp().
+///
CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1,
const cef_string_wide_t* str2);
@@ -121,10 +129,12 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
const cef_string_utf16_t* str2);
+///
// These functions convert between UTF-8, -16, and -32 strings. They are
// potentially slow so unnecessary conversions should be avoided. The best
// possible result will always be written to |output| with the boolean return
// value indicating whether the conversion is 100% valid.
+///
CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len,
cef_string_utf8_t* output);
@@ -142,9 +152,11 @@ CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src, size_t src_len,
cef_string_utf8_t* output);
+///
// These functions convert an ASCII string, typically a hardcoded constant, to a
// Wide/UTF16 string. Use instead of the UTF8 conversion routines if you know
// the string is ASCII.
+///
CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len,
cef_string_wide_t* output);
@@ -153,25 +165,31 @@ CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len,
+///
// It is sometimes necessary for the system to allocate string structures with
// the expectation that the user will free them. The userfree types act as a
// hint that the user is responsible for freeing the structure.
+///
typedef cef_string_wide_t* cef_string_userfree_wide_t;
typedef cef_string_utf8_t* cef_string_userfree_utf8_t;
typedef cef_string_utf16_t* cef_string_userfree_utf16_t;
+///
// These functions allocate a new string structure. They must be freed by
// calling the associated free function.
+///
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc();
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc();
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc();
+///
// These functions free the string structure allocated by the associated
// alloc function. Any string contents will first be cleared.
+///
CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str);
CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str);
diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h
index 246bf8d6e..a5645d1f7 100644
--- a/include/internal/cef_string_wrappers.h
+++ b/include/internal/cef_string_wrappers.h
@@ -37,7 +37,9 @@
#include
#include
+///
// Traits implementation for wide character strings.
+///
struct CefStringTraitsWide {
typedef wchar_t char_type;
typedef cef_string_wide_t struct_type;
@@ -115,7 +117,9 @@ struct CefStringTraitsWide {
#endif // BUILDING_CEF_SHARED
};
+///
// Traits implementation for utf8 character strings.
+///
struct CefStringTraitsUTF8 {
typedef char char_type;
typedef cef_string_utf8_t struct_type;
@@ -180,7 +184,9 @@ struct CefStringTraitsUTF8 {
#endif // BUILDING_CEF_SHARED
};
+///
// Traits implementation for utf16 character strings.
+///
struct CefStringTraitsUTF16 {
typedef char16_t char_type;
typedef cef_string_utf16_t struct_type;
@@ -259,7 +265,34 @@ struct CefStringTraitsUTF16 {
#endif // BUILDING_CEF_SHARED
};
-// String template.
+///
+// CEF string classes can convert between all supported string types. For
+// example, the CefStringWide class uses wchar_t as the underlying character
+// type and provides two approaches for converting data to/from a UTF8 string
+// (std::string).
+//
+// 1. Implicit conversion using the assignment operator overload.
+//
+// CefStringWide aCefString;
+// std::string aUTF8String;
+// aCefString = aUTF8String; // Assign std::string to CefStringWide
+// aUTF8String = aCefString; // Assign CefStringWide to std::string
+//
+// 2. Explicit conversion using the FromString/ToString methods.
+//
+// CefStringWide aCefString;
+// std::string aUTF8String;
+// aCefString.FromString(aUTF8String); // Assign std::string to CefStringWide
+// aUTF8String = aCefString.ToString(); // Assign CefStringWide to std::string
+//
+// Conversion will only occur if the assigned value is a different string type.
+// Assigning a std::string to a CefStringUTF8, for example, will copy the data
+// without performing a conversion.
+//
+// CEF string classes are safe for reading from multiple threads but not for
+// modification. It is the user's responsibility to provide synchronization if
+// modifying CEF strings from multiple threads.
+///
template
class CefStringBase {
public:
@@ -267,50 +300,64 @@ public:
typedef typename traits::struct_type struct_type;
typedef typename traits::userfree_struct_type userfree_struct_type;
+ ///
// Default constructor.
+ ///
CefStringBase() : string_(NULL), owner_(false) {}
+ ///
// Create a new string from an existing string. Data will always be copied.
+ ///
CefStringBase(const CefStringBase& str) : string_(NULL), owner_(false)
{ FromString(str.c_str(), str.length(), true); }
+ ///
// Create a new string from an existing std::string. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
+ ///
CefStringBase(const std::string& src) : string_(NULL), owner_(false)
{ FromString(src); }
CefStringBase(const char* src) : string_(NULL), owner_(false)
{ FromString(std::string(src)); }
+ ///
// Create a new string from an existing std::wstring. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
+ ///
CefStringBase(const std::wstring& src) : string_(NULL), owner_(false)
{ FromWString(src); }
CefStringBase(const wchar_t* src) : string_(NULL), owner_(false)
{ FromWString(std::wstring(src)); }
#if (defined(BUILDING_CEF_SHARED) && defined(WCHAR_T_IS_UTF32))
+ ///
// Create a new string from an existing string16. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
+ ///
CefStringBase(const string16& src) : string_(NULL), owner_(false)
{ FromString16(src); }
CefStringBase(const char16_t* src) : string_(NULL), owner_(false)
{ FromString16(string16(src)); }
#endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
+ ///
// Create a new string from an existing character array. If |copy| is true
// this class will copy the data. Otherwise, this class will reference the
// existing data. Referenced data must exist for the lifetime of this class
// and will not be freed by this class.
+ ///
CefStringBase(const char_type* src, size_t src_len, bool copy)
: string_(NULL), owner_(false)
{ FromString(src, src_len, copy); }
+ ///
// Create a new string referencing an existing string structure without taking
// ownership. Referenced structures must exist for the lifetime of this class
// and will not be freed by this class.
+ ///
CefStringBase(const struct_type* src) : string_(NULL), owner_(false)
{
if (!src)
@@ -325,19 +372,29 @@ public:
// The following methods are named for compatibility with the standard library
// string template types.
+ ///
// Return a read-only pointer to the string data.
+ ///
const char_type* c_str() const { return (string_ ? string_->str : NULL); }
+ ///
// Return the length of the string data.
+ ///
size_t length() const { return (string_ ? string_->length : 0); }
+ ///
// Return the length of the string data.
+ ///
inline size_t size() const { return length(); }
+ ///
// Returns true if the string is empty.
+ ///
bool empty() const { return (string_ == NULL || string_->length == 0); }
+ ///
// Compare this string to the specified string.
+ ///
int compare(const CefStringBase& str) const
{
if (empty() && str.empty())
@@ -349,7 +406,9 @@ public:
return traits::compare(string_, str.GetStruct());
}
+ ///
// Clear the string data.
+ ///
void clear()
{
if (!empty())
@@ -359,23 +418,31 @@ public:
// The following methods are unique to CEF string template types.
+ ///
// Returns true if this class owns the underlying string structure.
+ ///
bool IsOwner() const { return owner_; }
+ ///
// Returns a read-only pointer to the underlying string structure. May return
// NULL if no structure is currently allocated.
+ ///
const struct_type* GetStruct() const { return string_; }
+ ///
// Returns a writable pointer to the underlying string structure. Will never
// return NULL.
+ ///
struct_type* GetWritableStruct()
{
AllocIfNeeded();
return string_;
}
+ ///
// Clear the state of this class. The underlying string structure and data
// will be freed if this class owns the structure.
+ ///
void ClearAndFree()
{
if (!string_)
@@ -388,8 +455,10 @@ public:
owner_ = false;
}
+ ///
// Attach to the specified string structure. If |owner| is true this class
// will take ownership of the structure.
+ ///
void Attach(struct_type* str, bool owner)
{
// Free the previous structure and data, if any.
@@ -399,9 +468,11 @@ public:
owner_ = owner;
}
+ ///
// Take ownership of the specified userfree structure's string data. The
// userfree structure itself will be freed. Only use this method with userfree
// structures.
+ ///
void AttachToUserFree(userfree_struct_type str)
{
// Free the previous structure and data, if any.
@@ -419,18 +490,22 @@ public:
traits::userfree_free(str);
}
+ ///
// Detach from the underlying string structure. To avoid memory leaks only use
// this method if you already hold a pointer to the underlying string
// structure.
+ ///
void Detach()
{
string_ = NULL;
owner_ = false;
}
+ ///
// Create a userfree structure and give it ownership of this class' string
// data. This class will be disassociated from the data. May return NULL if
// this string class currently contains no data.
+ ///
userfree_struct_type DetachToUserFree()
{
if (empty())
@@ -446,10 +521,12 @@ public:
return str;
}
+ ///
// Set this string's data to the specified character array. If |copy| is true
// this class will copy the data. Otherwise, this class will reference the
// existing data. Referenced data must exist for the lifetime of this class
// and will not be freed by this class.
+ ///
bool FromString(const char_type* src, size_t src_len, bool copy)
{
if (src == NULL || src_len == 0) {
@@ -460,9 +537,11 @@ public:
return traits::set(src, src_len, string_, copy) ? true : false;
}
+ ///
// Set this string's data from an existing ASCII string. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
+ ///
bool FromASCII(const char* str)
{
size_t len = str ? strlen(str) : 0;
@@ -474,8 +553,10 @@ public:
return traits::from_ascii(str, len, string_);
}
+ ///
// Return this string's data as a std::string. Translation will occur if
// necessary based on the underlying string type.
+ ///
std::string ToString() const
{
if (empty())
@@ -483,9 +564,11 @@ public:
return traits::to_string(string_);
}
+ ///
// Set this string's data from an existing std::string. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
+ ///
bool FromString(const std::string& str)
{
if (str.empty()) {
@@ -496,8 +579,10 @@ public:
return traits::from_string(str, string_);
}
+ ///
// Return this string's data as a std::wstring. Translation will occur if
// necessary based on the underlying string type.
+ ///
std::wstring ToWString() const
{
if (empty())
@@ -505,9 +590,11 @@ public:
return traits::to_wstring(string_);
}
+ ///
// Set this string's data from an existing std::wstring. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
+ ///
bool FromWString(const std::wstring& str)
{
if (str.empty()) {
@@ -518,8 +605,10 @@ public:
return traits::from_wstring(str, string_);
}
#if defined(BUILDING_CEF_SHARED)
+ ///
// Return this string's data as a string16. Translation will occur if
// necessary based on the underlying string type.
+ ///
string16 ToString16() const
{
if (empty())
@@ -527,9 +616,11 @@ public:
return traits::to_string16(string_);
}
+ ///
// Set this string's data from an existing string16. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
+ ///
bool FromString16(const string16& str)
{
if (str.empty()) {
@@ -541,7 +632,9 @@ public:
}
#endif // BUILDING_CEF_SHARED
+ ///
// Comparison operator overloads.
+ ///
bool operator<(const CefStringBase& str) const
{ return (compare(str) < 0); }
bool operator<=(const CefStringBase& str) const
@@ -555,7 +648,9 @@ public:
bool operator!=(const CefStringBase& str) const
{ return (compare(str) != 0); }
+ ///
// Assignment operator overloads.
+ ///
CefStringBase& operator=(const CefStringBase& str)
{ FromString(str.c_str(), str.length(), true); return *this; }
operator std::string() const { return ToString(); }
@@ -592,33 +687,6 @@ private:
};
-// CEF string classes can convert between all supported string types. For
-// example, the CefStringWide class uses wchar_t as the underlying character
-// type and provides two approaches for converting data to/from a UTF8 string
-// (std::string).
-//
-// 1. Implicit conversion using the assignment operator overload.
-//
-// CefStringWide aCefString;
-// std::string aUTF8String;
-// aCefString = aUTF8String; // Assign std::string to CefStringWide
-// aUTF8String = aCefString; // Assign CefStringWide to std::string
-//
-// 2. Explicit conversion using the FromString/ToString methods.
-//
-// CefStringWide aCefString;
-// std::string aUTF8String;
-// aCefString.FromString(aUTF8String); // Assign std::string to CefStringWide
-// aUTF8String = aCefString.ToString(); // Assign CefStringWide to std::string
-//
-// Conversion will only occur if the assigned value is a different string type.
-// Assigning a std::string to a CefStringUTF8, for example, will copy the data
-// without performing a conversion.
-//
-// CEF string classes are safe for reading from multiple threads but not for
-// modification. It is the user's responsibility to provide synchronization if
-// modifying CEF strings from multiple threads.
-
typedef CefStringBase CefStringWide;
typedef CefStringBase CefStringUTF8;
typedef CefStringBase CefStringUTF16;
diff --git a/include/internal/cef_time.h b/include/internal/cef_time.h
index 8ae183355..11235792c 100644
--- a/include/internal/cef_time.h
+++ b/include/internal/cef_time.h
@@ -37,7 +37,9 @@ extern "C" {
#include "cef_export.h"
#include
+///
// Time information. Values should always be in UTC.
+///
typedef struct _cef_time_t
{
int year; // Four digit year "2007"
@@ -51,15 +53,19 @@ typedef struct _cef_time_t
int millisecond; // Milliseconds within the current second (0-999)
} cef_time_t;
+///
// Converts cef_time_t to/from time_t. Returns true (1) on success and false (0)
// on failure.
+///
CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time);
CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time);
+///
// Converts cef_time_t to/from a double which is the number of seconds since
// epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0
// means "not initialized". Returns true (1) on success and false (0) on
// failure.
+///
CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time);
CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time);
diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h
index ef40f20dd..7f71416aa 100644
--- a/include/internal/cef_types.h
+++ b/include/internal/cef_types.h
@@ -59,7 +59,9 @@ typedef unsigned long long uint64;
extern "C" {
#endif
+///
// Log severity levels.
+///
enum cef_log_severity_t
{
LOGSEVERITY_VERBOSE = -1,
@@ -71,64 +73,92 @@ enum cef_log_severity_t
LOGSEVERITY_DISABLE = 99
};
+///
// Initialization settings. Specify NULL or 0 to get the recommended default
// values.
+///
typedef struct _cef_settings_t
{
+ ///
// Size of this structure.
+ ///
size_t size;
+ ///
// Set to true (1) to have the message loop run in a separate thread. If
// false (0) than the CefDoMessageLoopWork() function must be called from
// your application message loop.
+ ///
bool multi_threaded_message_loop;
+ ///
// The location where cache data will be stored on disk. If empty an
// in-memory cache will be used. HTML5 databases such as localStorage will
// only persist across sessions if a cache path is specified.
+ ///
cef_string_t cache_path;
+ ///
// Value that will be returned as the User-Agent HTTP header. If empty the
// default User-Agent string will be used.
+ ///
cef_string_t user_agent;
+ ///
// Value that will be inserted as the product portion of the default
// User-Agent string. If empty the Chromium product version will be used. If
// |userAgent| is specified this value will be ignored.
+ ///
cef_string_t product_version;
+ ///
// The locale string that will be passed to WebKit. If empty the default
// locale of "en-US" will be used.
+ ///
cef_string_t locale;
+ ///
// List of fully qualified paths to plugins (including plugin name) that will
// be loaded in addition to any plugins found in the default search paths.
+ ///
cef_string_list_t extra_plugin_paths;
+ ///
// The directory and file name to use for the debug log. If empty, the
// default name of "debug.log" will be used and the file will be written
// to the application directory.
+ ///
cef_string_t log_file;
+ ///
// The log severity. Only messages of this severity level or higher will be
// logged.
+ ///
cef_log_severity_t log_severity;
} cef_settings_t;
+///
// Browser initialization settings. Specify NULL or 0 to get the recommended
// default values. The consequences of using custom values may not be well
// tested.
+///
typedef struct _cef_browser_settings_t
{
+ ///
// Size of this structure.
+ ///
size_t size;
+ ///
// Disable drag & drop of URLs from other windows.
+ ///
bool drag_drop_disabled;
// The below values map to WebPreferences settings.
+ ///
// Font settings.
+ ///
cef_string_t standard_font_family;
cef_string_t fixed_font_family;
cef_string_t serif_font_family;
@@ -140,176 +170,280 @@ typedef struct _cef_browser_settings_t
int minimum_font_size;
int minimum_logical_font_size;
+ ///
// Set to true (1) to disable loading of fonts from remote sources.
+ ///
bool remote_fonts_disabled;
+ ///
// Default encoding for Web content. If empty "ISO-8859-1" will be used.
+ ///
cef_string_t default_encoding;
+ ///
// Set to true (1) to attempt automatic detection of content encoding.
+ ///
bool encoding_detector_enabled;
+ ///
// Set to true (1) to disable JavaScript.
+ ///
bool javascript_disabled;
+ ///
// Set to true (1) to disallow JavaScript from opening windows.
+ ///
bool javascript_open_windows_disallowed;
+ ///
// Set to true (1) to disallow JavaScript from closing windows.
+ ///
bool javascript_close_windows_disallowed;
+ ///
// Set to true (1) to disallow JavaScript from accessing the clipboard.
+ ///
bool javascript_access_clipboard_disallowed;
+ ///
// Set to true (1) to disable DOM pasting in the editor. DOM pasting also
// depends on |javascript_cannot_access_clipboard| being false (0).
+ ///
bool dom_paste_disabled;
+ ///
// Set to true (1) to enable drawing of the caret position.
+ ///
bool caret_browsing_enabled;
+ ///
// Set to true (1) to disable Java.
+ ///
bool java_disabled;
+ ///
// Set to true (1) to disable plugins.
+ ///
bool plugins_disabled;
+ ///
// Set to true (1) to allow access to all URLs from file URLs.
+ ///
bool universal_access_from_file_urls_allowed;
+ ///
// Set to true (1) to allow access to file URLs from other file URLs.
+ ///
bool file_access_from_file_urls_allowed;
+ ///
// Set to true (1) to allow risky security behavior such as cross-site
// scripting (XSS). Use with extreme care.
+ ///
bool web_security_disabled;
+ ///
// Set to true (1) to enable console warnings about XSS attempts.
+ ///
bool xss_auditor_enabled;
+ ///
// Set to true (1) to suppress the network load of image URLs. A cached
// image will still be rendered if requested.
+ ///
bool image_load_disabled;
+ ///
// Set to true (1) to shrink standalone images to fit the page.
+ ///
bool shrink_standalone_images_to_fit;
+ ///
// Set to true (1) to disable browser backwards compatibility features.
+ ///
bool site_specific_quirks_disabled;
+ ///
// Set to true (1) to disable resize of text areas.
+ ///
bool text_area_resize_disabled;
+ ///
// Set to true (1) to disable use of the page cache.
+ ///
bool page_cache_disabled;
+ ///
// Set to true (1) to not have the tab key advance focus to links.
+ ///
bool tab_to_links_disabled;
+ ///
// Set to true (1) to disable hyperlink pings ( and window.sendPing).
+ ///
bool hyperlink_auditing_disabled;
+ ///
// Set to true (1) to enable the user style sheet for all pages.
// |user_style_sheet_location| must be set to the style sheet URL.
+ ///
bool user_style_sheet_enabled;
cef_string_t user_style_sheet_location;
+ ///
// Set to true (1) to disable style sheets.
+ ///
bool author_and_user_styles_disabled;
+ ///
// Set to true (1) to disable local storage.
+ ///
bool local_storage_disabled;
+ ///
// Set to true (1) to disable databases.
+ ///
bool databases_disabled;
+ ///
// Set to true (1) to disable application cache.
+ ///
bool application_cache_disabled;
+ ///
// Set to true (1) to disable WebGL.
+ ///
bool webgl_disabled;
+ ///
// Set to true (1) to disable accelerated compositing.
+ ///
bool accelerated_compositing_disabled;
+ ///
// Set to true (1) to disable accelerated layers. This affects features like
// 3D CSS transforms.
+ ///
bool accelerated_layers_disabled;
+ ///
// Set to true (1) to disable accelerated 2d canvas.
+ ///
bool accelerated_2d_canvas_disabled;
+ ///
// Set to true (1) to disable developer tools (WebKit inspector).
+ ///
bool developer_tools_disabled;
} cef_browser_settings_t;
+///
// URL component parts.
+///
typedef struct _cef_urlparts_t
{
+ ///
// The complete URL specification.
+ ///
cef_string_t spec;
+ ///
// Scheme component not including the colon (e.g., "http").
+ ///
cef_string_t scheme;
+ ///
// User name component.
+ ///
cef_string_t username;
+ ///
// Password component.
+ ///
cef_string_t password;
+ ///
// Host component. This may be a hostname, an IPv4 address or an IPv6 literal
// surrounded by square brackets (e.g., "[2001:db8::1]").
+ ///
cef_string_t host;
+ ///
// Port number component.
+ ///
cef_string_t port;
+ ///
// Path component including the first slash following the host.
+ ///
cef_string_t path;
+ ///
// Query string component (i.e., everything following the '?').
+ ///
cef_string_t query;
} cef_urlparts_t;
+///
// Cookie information.
+///
typedef struct _cef_cookie_t
{
+ ///
// The cookie name.
+ ///
cef_string_t name;
+ ///
// The cookie value.
+ ///
cef_string_t value;
+ ///
// If |domain| is empty a host cookie will be created instead of a domain
// cookie. Domain cookies are stored with a leading "." and are visible to
// sub-domains whereas host cookies are not.
+ ///
cef_string_t domain;
+ ///
// If |path| is non-empty only URLs at or below the path will get the cookie
// value.
+ ///
cef_string_t path;
+ ///
// If |secure| is true the cookie will only be sent for HTTPS requests.
+ ///
bool secure;
+ ///
// If |httponly| is true the cookie will only be sent for HTTP requests.
+ ///
bool httponly;
+ ///
// The cookie creation date. This is automatically populated by the system on
// cookie creation.
+ ///
cef_time_t creation;
+ ///
// The cookie last access date. This is automatically populated by the system
// on access.
+ ///
cef_time_t last_access;
+ ///
// The cookie expiration date is only valid if |has_expires| is true.
+ ///
bool has_expires;
cef_time_t expires;
} cef_cookie_t;
+///
// Mouse button types.
+///
enum cef_mouse_button_type_t
{
MBT_LEFT = 0,
@@ -317,7 +451,9 @@ enum cef_mouse_button_type_t
MBT_RIGHT,
};
+///
// Key types.
+///
enum cef_key_type_t
{
KT_KEYUP = 0,
@@ -325,7 +461,9 @@ enum cef_key_type_t
KT_CHAR,
};
+///
// Various browser navigation types supported by chrome.
+///
enum cef_handler_navtype_t
{
NAVTYPE_LINKCLICKED = 0,
@@ -336,8 +474,10 @@ enum cef_handler_navtype_t
NAVTYPE_OTHER,
};
+///
// Supported error code values. See net\base\net_error_list.h for complete
// descriptions of the error codes.
+///
enum cef_handler_errorcode_t
{
ERR_FAILED = -2,
@@ -390,7 +530,9 @@ enum cef_handler_errorcode_t
ERR_INSECURE_RESPONSE = -501,
};
+///
// V8 access control values.
+///
enum cef_v8_accesscontrol_t
{
V8_ACCESS_CONTROL_DEFAULT = 0,
@@ -399,7 +541,9 @@ enum cef_v8_accesscontrol_t
V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2
};
+///
// V8 property attribute values.
+///
enum cef_v8_propertyattribute_t
{
V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable,
@@ -409,14 +553,20 @@ enum cef_v8_propertyattribute_t
V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable
};
+///
// Structure representing menu information.
+///
typedef struct _cef_handler_menuinfo_t
{
+ ///
// Values from the cef_handler_menutypebits_t enumeration.
+ ///
int typeFlags;
+ ///
// If window rendering is enabled |x| and |y| will be in screen coordinates.
// Otherwise, |x| and |y| will be in view coordinates.
+ ///
int x;
int y;
@@ -427,40 +577,66 @@ typedef struct _cef_handler_menuinfo_t
cef_string_t selectionText;
cef_string_t misspelledWord;
+ ///
// Values from the cef_handler_menucapabilitybits_t enumeration.
+ ///
int editFlags;
cef_string_t securityInfo;
} cef_handler_menuinfo_t;
+///
// The cef_handler_menuinfo_t typeFlags value will be a combination of the
// following values.
+///
enum cef_handler_menutypebits_t
{
+ ///
// No node is selected
+ ///
MENUTYPE_NONE = 0x0,
+ ///
// The top page is selected
+ ///
MENUTYPE_PAGE = 0x1,
+ ///
// A subframe page is selected
+ ///
MENUTYPE_FRAME = 0x2,
+ ///
// A link is selected
+ ///
MENUTYPE_LINK = 0x4,
+ ///
// An image is selected
+ ///
MENUTYPE_IMAGE = 0x8,
+ ///
// There is a textual or mixed selection that is selected
+ ///
MENUTYPE_SELECTION = 0x10,
+ ///
// An editable element is selected
+ ///
MENUTYPE_EDITABLE = 0x20,
+ ///
// A misspelled word is selected
+ ///
MENUTYPE_MISSPELLED_WORD = 0x40,
+ ///
// A video node is selected
+ ///
MENUTYPE_VIDEO = 0x80,
+ ///
// A video node is selected
+ ///
MENUTYPE_AUDIO = 0x100,
};
+///
// The cef_handler_menuinfo_t editFlags value will be a combination of the
// following values.
+///
enum cef_handler_menucapabilitybits_t
{
// Values from WebContextMenuData::EditFlags in WebContextMenuData.h
@@ -478,7 +654,9 @@ enum cef_handler_menucapabilitybits_t
MENU_CAN_GO_BACK = 0x20000000,
};
+///
// Supported menu ID values.
+///
enum cef_handler_menuid_t
{
MENU_ID_NAV_BACK = 10,
@@ -503,7 +681,9 @@ enum cef_paint_element_type_t
PET_POPUP,
};
+///
// Post data elements may represent either bytes or files.
+///
enum cef_postdataelement_type_t
{
PDE_TYPE_EMPTY = 0,
@@ -533,7 +713,9 @@ enum cef_weburlrequest_state_t
WUR_STATE_ABORT = 6,
};
+///
// Key event types.
+///
enum cef_handler_keyevent_type_t
{
KEYEVENT_RAWKEYDOWN = 0,
@@ -542,7 +724,9 @@ enum cef_handler_keyevent_type_t
KEYEVENT_CHAR
};
+///
// Key event modifiers.
+///
enum cef_handler_keyevent_modifiers_t
{
KEY_SHIFT = 1 << 0,
@@ -551,7 +735,9 @@ enum cef_handler_keyevent_modifiers_t
KEY_META = 1 << 3
};
+///
// Structure representing a rectangle.
+///
typedef struct _cef_rect_t
{
int x;
@@ -560,7 +746,9 @@ typedef struct _cef_rect_t
int height;
} cef_rect_t;
+///
// Existing thread IDs.
+///
enum cef_thread_id_t
{
TID_UI = 0,
@@ -568,7 +756,9 @@ enum cef_thread_id_t
TID_FILE = 2,
};
+///
// Paper type for printing.
+///
enum cef_paper_type_t
{
PT_LETTER = 0,
@@ -579,7 +769,9 @@ enum cef_paper_type_t
PT_CUSTOM
};
+///
// Paper metric information for printing.
+///
struct cef_paper_metrics
{
enum cef_paper_type_t paper_type;
@@ -589,7 +781,9 @@ struct cef_paper_metrics
double width;
};
+///
// Paper print margins.
+///
struct cef_print_margins
{
//Margin size in inches for left/right/top/bottom (this is content margins).
@@ -602,14 +796,18 @@ struct cef_print_margins
double footer;
};
+///
// Page orientation for printing.
+///
enum cef_page_orientation
{
PORTRAIT = 0,
LANDSCAPE
};
+///
// Printing options.
+///
typedef struct _cef_print_options_t
{
enum cef_page_orientation page_orientation;
@@ -617,10 +815,12 @@ typedef struct _cef_print_options_t
struct cef_print_margins paper_margins;
} cef_print_options_t;
+///
// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and
// UTF16 (LE and BE) by default. All other types must be translated to UTF8
// before being passed to the parser. If a BOM is detected and the correct
// decoder is available then that decoder will be used automatically.
+///
enum cef_xml_encoding_type_t
{
XML_ENCODING_NONE = 0,
@@ -630,7 +830,9 @@ enum cef_xml_encoding_type_t
XML_ENCODING_ASCII,
};
+///
// XML node types.
+///
enum cef_xml_node_type_t
{
XML_NODE_UNSUPPORTED = 0,
@@ -646,7 +848,9 @@ enum cef_xml_node_type_t
XML_NODE_COMMENT,
};
+///
// Status message types.
+///
enum cef_handler_statustype_t
{
STATUSTYPE_TEXT = 0,
@@ -654,7 +858,9 @@ enum cef_handler_statustype_t
STATUSTYPE_KEYBOARD_FOCUS_URL,
};
+///
// Popup window features.
+///
typedef struct _cef_popup_features_t
{
int x;
@@ -678,7 +884,9 @@ typedef struct _cef_popup_features_t
cef_string_list_t additionalFeatures;
} cef_popup_features_t;
+///
// DOM document types.
+///
enum cef_dom_document_type_t
{
DOM_DOCUMENT_TYPE_UNKNOWN = 0,
@@ -687,7 +895,9 @@ enum cef_dom_document_type_t
DOM_DOCUMENT_TYPE_PLUGIN,
};
+///
// DOM event category flags.
+///
enum cef_dom_event_category_t
{
DOM_EVENT_CATEGORY_UNKNOWN = 0x0,
@@ -712,7 +922,9 @@ enum cef_dom_event_category_t
DOM_EVENT_CATEGORY_BEFORE_LOAD = 0x40000,
};
+///
// DOM event processing phases.
+///
enum cef_dom_event_phase_t
{
DOM_EVENT_PHASE_UNKNOWN = 0,
@@ -721,7 +933,9 @@ enum cef_dom_event_phase_t
DOM_EVENT_PHASE_BUBBLING,
};
+///
// DOM node types.
+///
enum cef_dom_node_type_t
{
DOM_NODE_TYPE_UNSUPPORTED = 0,
diff --git a/include/internal/cef_types_linux.h b/include/internal/cef_types_linux.h
index a2f571cf2..d718e1543 100644
--- a/include/internal/cef_types_linux.h
+++ b/include/internal/cef_types_linux.h
@@ -43,7 +43,9 @@ extern "C" {
#define cef_window_handle_t GtkWidget*
#define cef_cursor_handle_t void*
+///
// Class representing window information.
+///
typedef struct _cef_window_info_t
{
// Pointer for the parent GtkBox widget.
@@ -53,7 +55,9 @@ typedef struct _cef_window_info_t
cef_window_handle_t m_Widget;
} cef_window_info_t;
+///
// Class representing print context information.
+///
typedef struct _cef_print_info_t
{
double m_Scale;
diff --git a/include/internal/cef_types_mac.h b/include/internal/cef_types_mac.h
index 5c2ccdd3e..e23a4d6f6 100644
--- a/include/internal/cef_types_mac.h
+++ b/include/internal/cef_types_mac.h
@@ -51,7 +51,9 @@ class NSView;
extern "C" {
#endif
+///
// Class representing window information.
+///
typedef struct _cef_window_info_t
{
cef_string_t m_windowName;
@@ -68,7 +70,9 @@ typedef struct _cef_window_info_t
cef_window_handle_t m_View;
} cef_window_info_t;
+///
// Class representing print context information.
+///
typedef struct _cef_print_info_t
{
double m_Scale;
diff --git a/include/internal/cef_types_win.h b/include/internal/cef_types_win.h
index b8566605e..e752f585d 100644
--- a/include/internal/cef_types_win.h
+++ b/include/internal/cef_types_win.h
@@ -43,7 +43,9 @@ extern "C" {
#define cef_window_handle_t HWND
#define cef_cursor_handle_t HCURSOR
+///
// Class representing window information.
+///
typedef struct _cef_window_info_t
{
// Standard parameters required by CreateWindowEx()
@@ -66,7 +68,9 @@ typedef struct _cef_window_info_t
cef_window_handle_t m_hWnd;
} cef_window_info_t;
+///
// Class representing print context information.
+///
typedef struct _cef_print_info_t
{
HDC m_hDC;
diff --git a/include/internal/cef_types_wrappers.h b/include/internal/cef_types_wrappers.h
index fb0532fb9..0b5e1c2bd 100644
--- a/include/internal/cef_types_wrappers.h
+++ b/include/internal/cef_types_wrappers.h
@@ -34,7 +34,9 @@
#include "cef_string_list.h"
#include "cef_types.h"
+///
// Template class that provides common functionality for CEF structure wrapping.
+///
template
class CefStructBase : public traits::struct_type {
public:
@@ -63,15 +65,19 @@ public:
*this = r;
}
+ ///
// Clear this object's values.
+ ///
void Reset()
{
Clear(this);
Init();
}
+ ///
// Attach to the source structure's existing values. DetachTo() can be called
// to insert the values back into the existing structure.
+ ///
void AttachTo(struct_type& source)
{
// Only clear this object's data if it isn't currently attached to a
@@ -86,7 +92,9 @@ public:
memcpy(static_cast(this), &source, sizeof(struct_type));
}
+ ///
// Relinquish ownership of values to the target structure.
+ ///
void DetachTo(struct_type& target)
{
if (attached_to_ != &target) {
@@ -102,8 +110,10 @@ public:
Init();
}
+ ///
// Set this object's values. If |copy| is true the source structure's values
// will be copied instead of referenced.
+ ///
void Set(const struct_type& source, bool copy)
{
traits::set(&source, this, copy);
@@ -146,7 +156,9 @@ struct CefRectTraits {
}
};
+///
// Class representing a rectangle.
+///
class CefRect : public CefStructBase
{
public:
@@ -223,7 +235,9 @@ struct CefPopupFeaturesTraits {
}
};
+///
// Class representing popup window features.
+///
typedef CefStructBase CefPopupFeatures;
@@ -269,7 +283,9 @@ struct CefSettingsTraits {
}
};
+///
// Class representing initialization settings.
+///
typedef CefStructBase CefSettings;
@@ -367,7 +383,9 @@ struct CefBrowserSettingsTraits {
}
};
+///
// Class representing browser initialization settings.
+///
typedef CefStructBase CefBrowserSettings;
@@ -403,7 +421,9 @@ struct CefURLPartsTraits {
}
};
+///
// Class representing a URL's component parts.
+///
typedef CefStructBase CefURLParts;
@@ -420,7 +440,9 @@ struct CefTimeTraits {
}
};
+///
// Class representing a time.
+///
class CefTime : public CefStructBase
{
public:
@@ -483,7 +505,9 @@ struct CefCookieTraits {
}
};
+///
// Class representing a cookie.
+///
typedef CefStructBase CefCookie;
#endif // _CEF_TYPES_WRAPPERS_H
diff --git a/include/internal/cef_win.h b/include/internal/cef_win.h
index 5883d009d..926cbf8de 100644
--- a/include/internal/cef_win.h
+++ b/include/internal/cef_win.h
@@ -36,11 +36,15 @@
#include "cef_types_win.h"
#include "cef_types_wrappers.h"
+///
// Atomic increment and decrement.
+///
#define CefAtomicIncrement(p) InterlockedIncrement(p)
#define CefAtomicDecrement(p) InterlockedDecrement(p)
+///
// Critical section wrapper.
+///
class CefCriticalSection
{
public:
@@ -65,7 +69,9 @@ public:
CRITICAL_SECTION m_sec;
};
+///
// Handle types.
+///
#define CefWindowHandle cef_window_handle_t
#define CefCursorHandle cef_cursor_handle_t
@@ -97,7 +103,9 @@ struct CefWindowInfoTraits {
}
};
+///
// Class representing window information.
+///
class CefWindowInfo : public CefStructBase
{
public:
@@ -153,7 +161,9 @@ struct CefPrintInfoTraits {
}
};
+///
// Class representing print context information.
+///
typedef CefStructBase CefPrintInfo;
#endif // OS_WIN
diff --git a/tools/cef_parser.py b/tools/cef_parser.py
index 96b49d0b6..657f6e324 100644
--- a/tools/cef_parser.py
+++ b/tools/cef_parser.py
@@ -189,7 +189,8 @@ def get_comment(body, name):
elif line[0:2] == '/*':
continue
elif line[0:2] == '//':
- result.append(line[3:])
+ # keep the comment line including any leading spaces
+ result.append(line[2:])
else:
break
@@ -202,7 +203,15 @@ def format_comment(comment, indent, translate_map = None, maxchars = 80):
wrapme = ''
hasemptyline = False
for line in comment:
- if line is None or len(line) == 0 or line[0:1] == ' ':
+ # if the line starts with a leading space, remove that space
+ if not line is None and len(line) > 0 and line[0:1] == ' ':
+ line = line[1:]
+ didremovespace = True
+ else:
+ didremovespace = False
+
+ if line is None or len(line) == 0 or line[0:1] == ' ' \
+ or line[0:1] == '/':
# the previous paragraph, if any, has ended
if len(wrapme) > 0:
if not translate_map is None:
@@ -214,12 +223,15 @@ def format_comment(comment, indent, translate_map = None, maxchars = 80):
wrapme = ''
if not line is None:
- if len(line) == 0 or line[0:1] == ' ':
+ if len(line) == 0 or line[0:1] == ' ' or line[0:1] == '/':
# blank lines or anything that's further indented should be
# output as-is
result += indent+'//'
if len(line) > 0:
- result += ' '+line
+ if didremovespace:
+ result += ' '+line
+ else:
+ result += line;
result += '\n'
else:
# add to the current paragraph