#include <WebView.h>
Public Member Functions | |
| void | destroy () |
| void | setListener (WebViewListener *listener) |
| WebViewListener * | getListener () |
| void | loadURL (const std::string &url, const std::wstring &frameName=L"", const std::string &username="", const std::string &password="") |
| void | loadHTML (const std::string &html, const std::wstring &frameName=L"") |
| void | loadFile (const std::string &file, const std::wstring &frameName=L"") |
| void | goToHistoryOffset (int offset) |
| void | executeJavascript (const std::string &javascript, const std::wstring &frameName=L"") |
| Awesomium::FutureJSValue | executeJavascriptWithResult (const std::string &javascript, const std::wstring &frameName=L"") |
| void | setProperty (const std::string &name, const JSValue &value) |
| void | setCallback (const std::string &name) |
| bool | isDirty () |
| void | render (unsigned char *destination, int destRowSpan, int destDepth, Awesomium::Rect *renderedRect=0) |
| void | injectMouseMove (int x, int y) |
| void | injectMouseDown (Awesomium::MouseButton button) |
| void | injectMouseUp (Awesomium::MouseButton button) |
| void | injectMouseWheel (int scrollAmount) |
| void | cut () |
| void | copy () |
| void | paste () |
| void | selectAll () |
| void | deselectAll () |
| void | getContentAsText (std::wstring &result, int maxChars) |
| void | zoomIn () |
| void | zoomOut () |
| void | resetZoom () |
| void | resize (int width, int height) |
| void | unfocus () |
| void | focus () |
| void | setTransparent (bool isTransparent) |
Protected Member Functions | |
| WebView (int width, int height, bool isTransparent, bool enableAsyncRendering, int maxAsyncRenderPerSec, base::Thread *coreThread) | |
| void | startup () |
| void | setDirty (bool val=true) |
| void | setAsyncDirty (bool val=true) |
| void | setFinishRender () |
| void | setFinishShutdown () |
| void | setFinishGetContentText () |
| void | setFinishResize () |
| void | resolveJSValueFuture (int requestID, Awesomium::JSValue *result) |
| void | handleFutureJSValueCallback (const Awesomium::JSArguments &args) |
| void | nullifyFutureJSValueCallbacks () |
| void | handleCheckKeyboardFocus (bool isFocused) |
Protected Attributes | |
| base::Thread * | coreThread |
| WebViewProxy * | viewProxy |
| WebViewWaitState * | waitState |
| WebViewListener * | listener |
| LockImpl * | dirtinessLock |
| bool | dirtiness |
| bool | isKeyboardFocused |
| LockImpl * | jsValueFutureMapLock |
|
std::map< int, JSValueFutureImpl * > | jsValueFutureMap |
| const bool | enableAsyncRendering |
Friends | |
| class | WebCore |
| class | ::WebViewProxy |
| class | ::FutureValueCallback |
| class | ::CheckKeyboardFocusCallback |
| void Awesomium::WebView::copy | ( | ) |
Invokes a 'copy' action using the system clipboard.
| void Awesomium::WebView::cut | ( | ) |
Invokes a 'cut' action using the system clipboard.
| void Awesomium::WebView::deselectAll | ( | ) |
De-selects all items on the current page.
| void Awesomium::WebView::destroy | ( | ) |
Explicitly destroys this WebView instance. If you neglect to call this, the WebCore singleton will automatically destroy all lingering WebView instances at shutdown.
| void Awesomium::WebView::executeJavascript | ( | const std::string & | javascript, | |
| const std::wstring & | frameName = L"" | |||
| ) |
Executes a string of Javascript in the context of the current page asynchronously.
| javascript | The string of Javascript to execute. | |
| frameName | Optional, the name of the frame to execute in; leave this blank to execute in the main frame. |
| Awesomium::FutureJSValue Awesomium::WebView::executeJavascriptWithResult | ( | const std::string & | javascript, | |
| const std::wstring & | frameName = L"" | |||
| ) |
Executes a string of Javascript in the context of the current page asynchronously with a result.
| javascript | The string of Javascript to execute. | |
| frameName | Optional, the name of the frame to execute in; leave this blank to execute in the main frame. |
| void Awesomium::WebView::focus | ( | ) |
Notifies the current page that is has gained focus.
| void Awesomium::WebView::getContentAsText | ( | std::wstring & | result, | |
| int | maxChars | |||
| ) |
Retrieves the content of the current page as plain text.
| result | The wide string to store the retrieved text in. | |
| maxChars | The maximum number of characters to retrieve. |
| Awesomium::WebViewListener * Awesomium::WebView::getListener | ( | ) |
Retrieves the current WebViewListener.
| void Awesomium::WebView::goToHistoryOffset | ( | int | offset | ) |
Navigates back/forward in history via a relative offset.
| offset | The relative offset in history to navigate to. |
| void Awesomium::WebView::injectMouseDown | ( | Awesomium::MouseButton | button | ) |
Injects a mouse-down event.
| button | The button that was pressed. |
| void Awesomium::WebView::injectMouseMove | ( | int | x, | |
| int | y | |||
| ) |
| void Awesomium::WebView::injectMouseUp | ( | Awesomium::MouseButton | button | ) |
Injects a mouse-up event.
| button | The button that was released. |
| void Awesomium::WebView::injectMouseWheel | ( | int | scrollAmount | ) |
Injects a mouse-wheel event.
| scrollAmount | The amount of pixels to scroll by. |
| bool Awesomium::WebView::isDirty | ( | ) |
Returns whether or not the current web-view is dirty and needs to be re-rendered.
| void Awesomium::WebView::loadFile | ( | const std::string & | file, | |
| const std::wstring & | frameName = L"" | |||
| ) |
Loads a local file into the WebView asynchronously.
| file | The file to load. | |
| frameName | Optional, the name of the frame to load the file in; leave this blank to load in the main frame. |
| void Awesomium::WebView::loadHTML | ( | const std::string & | html, | |
| const std::wstring & | frameName = L"" | |||
| ) |
Loads a string of HTML into the WebView asynchronously.
| html | The HTML string to load. | |
| frameName | Optional, the name of the frame to load the HTML in; leave this blank to load in the main frame. |
| void Awesomium::WebView::loadURL | ( | const std::string & | url, | |
| const std::wstring & | frameName = L"", |
|||
| const std::string & | username = "", |
|||
| const std::string & | password = "" | |||
| ) |
Loads a URL into the WebView asynchronously.
| url | The URL to load. | |
| frameName | Optional, the name of the frame to load the URL in; leave this blank to load in the main frame. | |
| username | Optional, if the URL requires authentication, the username to authorize as. | |
| password | Optional, if the URL requires authentication, the password to use. |
| void Awesomium::WebView::paste | ( | ) |
Invokes a 'paste' action using the system clipboard.
| void Awesomium::WebView::render | ( | unsigned char * | destination, | |
| int | destRowSpan, | |||
| int | destDepth, | |||
| Awesomium::Rect * | renderedRect = 0 | |||
| ) |
Renders the WebView to an off-screen buffer.
| destination | The buffer to render to, its width and height should match the WebView's. | |
| destRowSpan | The row-span of the destination buffer (number of bytes per row). | |
| destDepth | The depth (bytes per pixel) of the destination buffer. Valid options include 3 (BGR/RGB) or 4 (BGRA/RGBA). | |
| renderedRect | Optional (pass 0 to ignore); if asynchronous rendering is not enabled, you can provide a pointer to a Rect to store the dimensions of the rendered area, or rather, the dimensions of the area that actually changed since the last render. |
| void Awesomium::WebView::resetZoom | ( | ) |
Resets the zoom level.
| void Awesomium::WebView::resize | ( | int | width, | |
| int | height | |||
| ) |
Resizes this WebView to certain dimensions.
| width | The width to resize to. | |
| height | The height to resize to. |
| void Awesomium::WebView::selectAll | ( | ) |
Selects all items on the current page.
| void Awesomium::WebView::setCallback | ( | const std::string & | name | ) |
Registers a global 'Client' callback that can be invoked via Javascript from within all pages loaded into this view. You will need to register a WebViewListener (WebView::setListener) to receieve notification of callbacks (WebViewListener::onCallback).
| name | The name of the callback. You can invoke the callback in Javascript as: Client.your_name_here(arg1, arg2, ...); |
| void Awesomium::WebView::setListener | ( | Awesomium::WebViewListener * | listener | ) |
Registers a WebViewListener to call upon various events (such as load completions, callbacks, title receptions, cursor changes, etc).
| listener | The WebViewListener to register. Or, you can pass '0' to undo any current registrations. |
| void Awesomium::WebView::setProperty | ( | const std::string & | name, | |
| const JSValue & | value | |||
| ) |
Sets a global 'Client' property that can be accessed via Javascript from within all pages loaded into this web-view.
| name | The name of the property. | |
| value | The javascript-value of the property. |
| void Awesomium::WebView::setTransparent | ( | bool | isTransparent | ) |
Sets whether or not pages should be rendered with a transparent background-color.
| isTransparent | Whether or not to force the background-color as transparent. |
| void Awesomium::WebView::unfocus | ( | ) |
Notifies the current page that it has lost focus.
| void Awesomium::WebView::zoomIn | ( | ) |
Zooms into the page, enlarging by 20%.
| void Awesomium::WebView::zoomOut | ( | ) |
Zooms out of the page, reducing by 20%.
1.5.8