|
Awesomium
1.6.3
|
#include <WebViewListener.h>
Public Member Functions | |
| virtual void | onBeginNavigation (Awesomium::WebView *caller, const std::string &url, const std::wstring &frameName)=0 |
| virtual void | onBeginLoading (Awesomium::WebView *caller, const std::string &url, const std::wstring &frameName, int statusCode, const std::wstring &mimeType)=0 |
| virtual void | onFinishLoading (Awesomium::WebView *caller)=0 |
| virtual void | onCallback (Awesomium::WebView *caller, const std::wstring &objectName, const std::wstring &callbackName, const Awesomium::JSArguments &args)=0 |
| virtual void | onReceiveTitle (Awesomium::WebView *caller, const std::wstring &title, const std::wstring &frameName)=0 |
| virtual void | onChangeTooltip (Awesomium::WebView *caller, const std::wstring &tooltip)=0 |
| virtual void | onChangeCursor (Awesomium::WebView *caller, Awesomium::CursorType cursor)=0 |
| virtual void | onChangeKeyboardFocus (Awesomium::WebView *caller, bool isFocused)=0 |
| virtual void | onChangeTargetURL (Awesomium::WebView *caller, const std::string &url)=0 |
| virtual void | onOpenExternalLink (Awesomium::WebView *caller, const std::string &url, const std::wstring &source)=0 |
| virtual void | onRequestDownload (Awesomium::WebView *caller, const std::string &url)=0 |
| virtual void | onWebViewCrashed (Awesomium::WebView *caller)=0 |
| virtual void | onPluginCrashed (Awesomium::WebView *caller, const std::wstring &pluginName)=0 |
| virtual void | onRequestMove (Awesomium::WebView *caller, int x, int y)=0 |
| virtual void | onGetPageContents (Awesomium::WebView *caller, const std::string &url, const std::wstring &contents)=0 |
| virtual void | onDOMReady (Awesomium::WebView *caller)=0 |
| virtual void | onRequestFileChooser (Awesomium::WebView *caller, bool selectMultipleFiles, const std::wstring &title, const std::wstring &defaultPath)=0 |
| virtual void | onGetScrollData (Awesomium::WebView *caller, int contentWidth, int contentHeight, int preferredWidth, int scrollX, int scrollY)=0 |
| virtual void | onJavascriptConsoleMessage (Awesomium::WebView *caller, const std::wstring &message, int lineNumber, const std::wstring &source)=0 |
| virtual void | onGetFindResults (Awesomium::WebView *caller, int requestID, int numMatches, const Awesomium::Rect &selection, int curMatch, bool finalUpdate)=0 |
| virtual void | onUpdateIME (Awesomium::WebView *caller, Awesomium::IMEState imeState, const Awesomium::Rect &caretRect)=0 |
| virtual void | onShowContextMenu (Awesomium::WebView *caller, int mouseX, int mouseY, Awesomium::MediaType type, int mediaState, const std::string &linkURL, const std::string &srcURL, const std::string &pageURL, const std::string &frameURL, const std::wstring &selectionText, bool isEditable, int editFlags)=0 |
| virtual void | onRequestLogin (Awesomium::WebView *caller, int requestID, const std::string &requestURL, bool isProxy, const std::wstring &hostAndPort, const std::wstring &scheme, const std::wstring &realm)=0 |
| virtual void | onChangeHistory (Awesomium::WebView *caller, int backCount, int forwardCount)=0 |
| virtual void | onFinishResize (Awesomium::WebView *caller, int width, int height)=0 |
| virtual void | onShowJavascriptDialog (Awesomium::WebView *caller, int requestID, int dialogFlags, const std::wstring &message, const std::wstring &defaultPrompt, const std::string &frameURL)=0 |
WebViewListener is a virtual interface that you can use to receive notifications from a certain WebView. Simply make a class that inherits from WebViewListener and register it via WebView::setListener.
| virtual void Awesomium::WebViewListener::onBeginLoading | ( | Awesomium::WebView * | caller, |
| const std::string & | url, | ||
| const std::wstring & | frameName, | ||
| int | statusCode, | ||
| const std::wstring & | mimeType | ||
| ) | [pure virtual] |
This event is fired when a WebView begins to actually receive data from a server.
| caller | The WebView that fired the event. |
| url | The URL of the frame that is being loaded. |
| frameName | The name of the frame that this event originated from. |
| statusCode | The HTTP status code returned by the server. |
| mimeType | The mime-type of the content that is being loaded. |
| virtual void Awesomium::WebViewListener::onBeginNavigation | ( | Awesomium::WebView * | caller, |
| const std::string & | url, | ||
| const std::wstring & | frameName | ||
| ) | [pure virtual] |
| virtual void Awesomium::WebViewListener::onCallback | ( | Awesomium::WebView * | caller, |
| const std::wstring & | objectName, | ||
| const std::wstring & | callbackName, | ||
| const Awesomium::JSArguments & | args | ||
| ) | [pure virtual] |
This event is fired when a Client callback has been invoked via Javascript from a page.
| caller | The WebView that fired the event. |
| objectName | The name of the Javascript Object that contains the invoked callback. |
| callbackName | The name of the callback that was invoked (must have been previously bound via WebView::setObjectCallback). |
| args | The arguments passed to the callback. |
| virtual void Awesomium::WebViewListener::onChangeCursor | ( | Awesomium::WebView * | caller, |
| Awesomium::CursorType | cursor | ||
| ) | [pure virtual] |
This event is fired when the cursor has changed state.
| caller | The WebView that fired the event. |
| cursor | The cursor type. |
| virtual void Awesomium::WebViewListener::onChangeHistory | ( | Awesomium::WebView * | caller, |
| int | backCount, | ||
| int | forwardCount | ||
| ) | [pure virtual] |
This event is fired whenever the history state has changed. (eg, the state of thie back/forward buttons should be updated)
| caller | The WebView that fired the event. |
| backCount | The number of times we can go backward in history. |
| forwardCount | The number of times we can go forward in history. |
| virtual void Awesomium::WebViewListener::onChangeKeyboardFocus | ( | Awesomium::WebView * | caller, |
| bool | isFocused | ||
| ) | [pure virtual] |
This event is fired when keyboard focus has changed.
| caller | The WebView that fired the event. |
| isFocused | Whether or not the keyboard is currently focused. |
| virtual void Awesomium::WebViewListener::onChangeTargetURL | ( | Awesomium::WebView * | caller, |
| const std::string & | url | ||
| ) | [pure virtual] |
This event is fired when the target URL has changed. This is usually the result of hovering over a link on the page.
| caller | The WebView that fired the event. |
| url | The updated target URL (or empty if the target URL is cleared). |
| virtual void Awesomium::WebViewListener::onChangeTooltip | ( | Awesomium::WebView * | caller, |
| const std::wstring & | tooltip | ||
| ) | [pure virtual] |
This event is fired when a tooltip has changed state.
| caller | The WebView that fired the event. |
| tooltip | The tooltip text (or, is an empty string when the tooltip should disappear). |
| virtual void Awesomium::WebViewListener::onDOMReady | ( | Awesomium::WebView * | caller | ) | [pure virtual] |
This event is fired once the DOM (Document Object Model) for a page is ready. This is very useful for executing Javascript on a page before its content has finished loading.
| caller | The WebView that fired the event. |
| virtual void Awesomium::WebViewListener::onFinishLoading | ( | Awesomium::WebView * | caller | ) | [pure virtual] |
| virtual void Awesomium::WebViewListener::onFinishResize | ( | Awesomium::WebView * | caller, |
| int | width, | ||
| int | height | ||
| ) | [pure virtual] |
This event is fired whenever a WebView has finished resizing to a certain size (and has finished repainting the RenderBuffer).
| virtual void Awesomium::WebViewListener::onGetFindResults | ( | Awesomium::WebView * | caller, |
| int | requestID, | ||
| int | numMatches, | ||
| const Awesomium::Rect & | selection, | ||
| int | curMatch, | ||
| bool | finalUpdate | ||
| ) | [pure virtual] |
This event is fired whenever we get the results back from a call to WebView::find. You may receive multiple events as more results come in.
| caller | The WebView that fired the event. |
| requestID | The unique ID of the request passed to WebView::find |
| numMatches | Number of matches on the page |
| selection | The location of the currently-selected match. |
| curMatch | The index of the current match. |
| finalUpdate | Whether or not this is the final update. |
| virtual void Awesomium::WebViewListener::onGetPageContents | ( | Awesomium::WebView * | caller, |
| const std::string & | url, | ||
| const std::wstring & | contents | ||
| ) | [pure virtual] |
This event is fired when the contents of the page has finished loading. This occurs at the end of most page loads.
| caller | The WebView that fired the event. |
| url | The URL of the page. |
| contents | The contents of the page as plain text. |
| virtual void Awesomium::WebViewListener::onGetScrollData | ( | Awesomium::WebView * | caller, |
| int | contentWidth, | ||
| int | contentHeight, | ||
| int | preferredWidth, | ||
| int | scrollX, | ||
| int | scrollY | ||
| ) | [pure virtual] |
This event is fired as a response to WebView::requestScrollData.
| caller | The WebView that fired the event. |
| contentWidth | The width of the contents of the page (actual page width, NOT WebView width) |
| contentHeight | The height of the contents of the page (actual page height, NOT WebView height) |
| preferredWidth | The preferred width of the page (usually the minimum width specified via CSS) |
| scrollX | The current scroll position (x value) |
| scrollY | The current scroll position (y value) |
| virtual void Awesomium::WebViewListener::onJavascriptConsoleMessage | ( | Awesomium::WebView * | caller, |
| const std::wstring & | message, | ||
| int | lineNumber, | ||
| const std::wstring & | source | ||
| ) | [pure virtual] |
This event is fired whenever a message is added to the Javascript console. This is usually the result of a Javascript error being encountered on a page.
| caller | The WebView that fired the event. |
| message | The console message. |
| lineNumber | The line number that the message occured on. |
| source | The source (usually the filename) of the message. |
| virtual void Awesomium::WebViewListener::onOpenExternalLink | ( | Awesomium::WebView * | caller, |
| const std::string & | url, | ||
| const std::wstring & | source | ||
| ) | [pure virtual] |
This event is fired when an external link is attempted to be opened. An external link is any link that normally opens in a new window in a standard browser (for example, links with target="_blank", calls to window.open(url), and URL open events from Flash plugins).
| caller | The WebView that fired the event. |
| url | The URL of the external link. |
| source | The URL of the page that initiated the event. May be blank. |
| virtual void Awesomium::WebViewListener::onPluginCrashed | ( | Awesomium::WebView * | caller, |
| const std::wstring & | pluginName | ||
| ) | [pure virtual] |
This event is fired when the renderer for a certain plugin (usually Flash, which is isolated in a separate process) crashes unexpectedly.
| caller | The WebView that fired the event. |
| pluginName | The name of the plugin that crashed. |
| virtual void Awesomium::WebViewListener::onReceiveTitle | ( | Awesomium::WebView * | caller, |
| const std::wstring & | title, | ||
| const std::wstring & | frameName | ||
| ) | [pure virtual] |
This event is fired when a page title is received.
| caller | The WebView that fired the event. |
| title | The page title. |
| frameName | The name of the frame that this event originated from. |
| virtual void Awesomium::WebViewListener::onRequestDownload | ( | Awesomium::WebView * | caller, |
| const std::string & | url | ||
| ) | [pure virtual] |
This event is fired when the page requests a certain URL to be downloaded by the user.
| caller | The WebView that fired the event. |
| url | The URL of the file requested to be downloaded. |
| virtual void Awesomium::WebViewListener::onRequestFileChooser | ( | Awesomium::WebView * | caller, |
| bool | selectMultipleFiles, | ||
| const std::wstring & | title, | ||
| const std::wstring & | defaultPath | ||
| ) | [pure virtual] |
This event is fired whenever a page requests a file chooser dialog to be displayed (usually the result of an "input" element with type "file" being clicked by a user). You will need to display your own dialog (it does not have to be modal, this request does not block). Once a file has been chosen by the user, WebView::chooseFile (or WebView::chooseMultipleFiles) should be called.
| caller | The WebView that fired the event. |
| selectMultipleFiles | Whether or not the dialog should allow more than one file to be selected. |
| title | The title to be displayed (if any). |
| defaultPath | The default file path the dialog should display (if any). |
| virtual void Awesomium::WebViewListener::onRequestLogin | ( | Awesomium::WebView * | caller, |
| int | requestID, | ||
| const std::string & | requestURL, | ||
| bool | isProxy, | ||
| const std::wstring & | hostAndPort, | ||
| const std::wstring & | scheme, | ||
| const std::wstring & | realm | ||
| ) | [pure virtual] |
This event is fired whenever a page requests authentication from the user (ex, Basic HTTP Auth, NTLM Auth, etc.). See WebView::login and WebView::cancelLogin.
| caller | The WebView that fired the event. |
| requestID | The unique ID of this login request. To be used with WebView::login |
| requestURL | The URL of the page requesting authentication. |
| isProxy | Whether or not this is a proxy auth request. |
| hostAndPort | The host and port of the server (<host>:<port>) |
| scheme | "Basic", "Digest", or whatever other authentication method is requested. |
| realm | The realm of the server (if one is provided). |
| virtual void Awesomium::WebViewListener::onRequestMove | ( | Awesomium::WebView * | caller, |
| int | x, | ||
| int | y | ||
| ) | [pure virtual] |
This event is fired when the page requests for the containing window to be moved to a certain location on the screen.
| caller | The WebView that fired the event. |
| x | The x-coordinate. |
| y | The y-coordinate. |
| virtual void Awesomium::WebViewListener::onShowContextMenu | ( | Awesomium::WebView * | caller, |
| int | mouseX, | ||
| int | mouseY, | ||
| Awesomium::MediaType | type, | ||
| int | mediaState, | ||
| const std::string & | linkURL, | ||
| const std::string & | srcURL, | ||
| const std::string & | pageURL, | ||
| const std::string & | frameURL, | ||
| const std::wstring & | selectionText, | ||
| bool | isEditable, | ||
| int | editFlags | ||
| ) | [pure virtual] |
This event is fired whenever a user right-clicks a location on the page. It is your responsibility to display a menu for the user to select an appropriate action.
| caller | The WebView that fired the event. |
| mouseX | The position of the mouse in screen-space. |
| mouseY | The position of the mouse in screen-space. |
| type | The type of media underneath the mouse. |
| mediaState | If the media is an audio or video element, then this represents the state of the media. See "MediaState" enum. |
| linkURL | The URL of any link underneath the mouse. |
| srcURL | The URL of any media underneath the mouse. |
| pageURL | The URL of the page. |
| frameURL | The URL of the frame. |
| selectionText | The selected text on the page, if any. |
| isEditable | Whether or not the element underneath the mouse is editable. |
| editFlags | Represents which edit actions (eg, cut, copy, paste) are available. See "CanEditFlags" enum. |
| virtual void Awesomium::WebViewListener::onShowJavascriptDialog | ( | Awesomium::WebView * | caller, |
| int | requestID, | ||
| int | dialogFlags, | ||
| const std::wstring & | message, | ||
| const std::wstring & | defaultPrompt, | ||
| const std::string & | frameURL | ||
| ) | [pure virtual] |
This event is fired whenever a WebView requests that a certain Javascript dialog be shown (eg, alert, confirm, prompt). See WebView::closeJavascriptDialog for more information.
| caller | The WebView that fired the event. |
| requestID | The unique ID of this dialog request. To be used with WebView::closeJavascriptDialog |
| dialogFlags | The description of the dialog's UI and buttons. This may be different depending on what type of dialog was requested (eg, alert dialogs only have a single OK button, but confirm dialogs may also have a Cancel button). See DialogFlags enum. |
| message | The main message text of the dialog. |
| defaultPrompt | If this dialog is a prompt, this should be the default value of the textbox. |
| frameURL | The URL of the page frame that requested the dialog. |
| virtual void Awesomium::WebViewListener::onUpdateIME | ( | Awesomium::WebView * | caller, |
| Awesomium::IMEState | imeState, | ||
| const Awesomium::Rect & | caretRect | ||
| ) | [pure virtual] |
You should handle this message if you are displaying your own IME (input method editor) widget.
This event is fired whenever the user does something that may change the position or visiblity of the IME Widget (for example, deselecting a textbox, scrolling the page, tabbing to another textbox, or clicking the submit button). This event is only active when IME is activated (please see WebView::activateIME).
| caller | The WebView that fired the event. |
| imeState | The action to apply to your IME widget (for example, IME_DISABLE, IME_MOVE_WINDOW, and IME_COMPLETE_COMPOSITION). |
| caretRect | The current location of the input caret on the page. You should generally move your IME widget to this location. |
| virtual void Awesomium::WebViewListener::onWebViewCrashed | ( | Awesomium::WebView * | caller | ) | [pure virtual] |