Awesomium  1.6.3
Awesomium::WebViewListener Class Reference

#include <WebViewListener.h>

List of all members.

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

Detailed Description

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.


Member Function Documentation

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.

Parameters:
callerThe WebView that fired the event.
urlThe URL of the frame that is being loaded.
frameNameThe name of the frame that this event originated from.
statusCodeThe HTTP status code returned by the server.
mimeTypeThe 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]

This event is fired when a WebView begins navigating to a new URL.

Parameters:
callerThe WebView that fired the event.
urlThe URL that is being navigated to.
frameNameThe name of the frame that this event originated from.
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.

Parameters:
callerThe WebView that fired the event.
objectNameThe name of the Javascript Object that contains the invoked callback.
callbackNameThe name of the callback that was invoked (must have been previously bound via WebView::setObjectCallback).
argsThe 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.

Parameters:
callerThe WebView that fired the event.
cursorThe 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)

Parameters:
callerThe WebView that fired the event.
backCountThe number of times we can go backward in history.
forwardCountThe 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.

Parameters:
callerThe WebView that fired the event.
isFocusedWhether 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.

Parameters:
callerThe WebView that fired the event.
urlThe 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.

Parameters:
callerThe WebView that fired the event.
tooltipThe 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.

Parameters:
callerThe WebView that fired the event.
virtual void Awesomium::WebViewListener::onFinishLoading ( Awesomium::WebView caller) [pure virtual]

This event is fired when all loads have finished for a WebView.

Parameters:
callerThe WebView that fired the event.
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).

Parameters:
callerThe WebView that fired the event.
widthThe new width of the WebView
heightThe new height of the WebView
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.

Parameters:
callerThe WebView that fired the event.
requestIDThe unique ID of the request passed to WebView::find
numMatchesNumber of matches on the page
selectionThe location of the currently-selected match.
curMatchThe index of the current match.
finalUpdateWhether 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.

Parameters:
callerThe WebView that fired the event.
urlThe URL of the page.
contentsThe 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.

Parameters:
callerThe WebView that fired the event.
contentWidthThe width of the contents of the page (actual page width, NOT WebView width)
contentHeightThe height of the contents of the page (actual page height, NOT WebView height)
preferredWidthThe preferred width of the page (usually the minimum width specified via CSS)
scrollXThe current scroll position (x value)
scrollYThe 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.

Parameters:
callerThe WebView that fired the event.
messageThe console message.
lineNumberThe line number that the message occured on.
sourceThe 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).

Parameters:
callerThe WebView that fired the event.
urlThe URL of the external link.
sourceThe 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.

Parameters:
callerThe WebView that fired the event.
pluginNameThe 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.

Parameters:
callerThe WebView that fired the event.
titleThe page title.
frameNameThe 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.

Parameters:
callerThe WebView that fired the event.
urlThe 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.

Parameters:
callerThe WebView that fired the event.
selectMultipleFilesWhether or not the dialog should allow more than one file to be selected.
titleThe title to be displayed (if any).
defaultPathThe 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.

Parameters:
callerThe WebView that fired the event.
requestIDThe unique ID of this login request. To be used with WebView::login
requestURLThe URL of the page requesting authentication.
isProxyWhether or not this is a proxy auth request.
hostAndPortThe host and port of the server (<host>:<port>)
scheme"Basic", "Digest", or whatever other authentication method is requested.
realmThe 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.

Parameters:
callerThe WebView that fired the event.
xThe x-coordinate.
yThe 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.

Parameters:
callerThe WebView that fired the event.
mouseXThe position of the mouse in screen-space.
mouseYThe position of the mouse in screen-space.
typeThe type of media underneath the mouse.
mediaStateIf the media is an audio or video element, then this represents the state of the media. See "MediaState" enum.
linkURLThe URL of any link underneath the mouse.
srcURLThe URL of any media underneath the mouse.
pageURLThe URL of the page.
frameURLThe URL of the frame.
selectionTextThe selected text on the page, if any.
isEditableWhether or not the element underneath the mouse is editable.
editFlagsRepresents 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.

Parameters:
callerThe WebView that fired the event.
requestIDThe unique ID of this dialog request. To be used with WebView::closeJavascriptDialog
dialogFlagsThe 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.
messageThe main message text of the dialog.
defaultPromptIf this dialog is a prompt, this should be the default value of the textbox.
frameURLThe URL of the page frame that requested the dialog.
Note:
WARNING! The page will be frozen until you call WebView::closeJavascriptDialog. Even if you never handle this event, you must call this method.
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).

Parameters:
callerThe WebView that fired the event.
imeStateThe action to apply to your IME widget (for example, IME_DISABLE, IME_MOVE_WINDOW, and IME_COMPLETE_COMPOSITION).
caretRectThe 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]

This event is fired when the renderer for a certain WebView (which is isolated in a separate process) crashes unexpectedly.

Parameters:
callerThe WebView that fired the event.

The documentation for this class was generated from the following file: