Interface that allows clients to listen to View events. More...
#include <Coherent/UI/ViewListener.h>
Public Member Functions | |
virtual void | Release () |
Called when the listener is no longer needed by the UI context. | |
virtual void | OnViewCreated (View *view)=0 |
Called when the requested View has been created and is ready to use. More... | |
virtual void | OnDraw (CoherentHandle handle, bool usesSharedMemory, int width, int height) |
Called when a new surface has been drawn and is ready to use by the client. More... | |
virtual void | OnFinishLoad (int frameId, const wchar_t *validatedPath, bool isMainFrame, int statusCode, HTTPHeader *headers, unsigned headersCount) |
Called when a frame has been successfully loaded. More... | |
virtual void | OnFailLoad (int frameId, const wchar_t *validatedPath, bool isMainFrame, const char *error) |
Called when a frame has been failed loading. More... | |
virtual void | OnURLRequest (URLRequest *request) |
Called before an URL request is made. The default implementation allows all requests. NOTE: this method will be called only when View::InterceptURLRequests(true) has been called. More... | |
virtual void | OnReadyForBindings (int frameId, const wchar_t *path, bool isMainFrame) |
Called when a frame is ready for bindings. More... | |
virtual void | OnBindingsReleased (int frameId, const wchar_t *path, bool isMainFrame) |
Called when the bindings for frame are released. More... | |
virtual void | OnStartLoading () |
Called when a new path has started loading. | |
virtual void | OnStopLoading () |
Called when all load operations have completed. | |
virtual void | OnNavigateTo (const wchar_t *path) |
Called when the view starts navigation to a new path. More... | |
virtual void | OnError (const ViewError &error) |
Called when an error occurs for this specific View. More... | |
virtual void | OnScriptMessage (MessageLevel level, const wchar_t *message, const wchar_t *sourceId, int line) |
Called when a message is sent from a script running in this specific View. More... | |
virtual void | OnCursorChanged (CursorTypes cursor) |
Called when the cursor has changed internally in the View. Can be used to allow the user to change the shown cursor if needed - for instance when hovering a text field etc. More... | |
virtual void | OnCallback (const char *eventName, const EventArguments &arguments) |
Called by the UI when there is no registered handler for this event. More... | |
virtual void | OnJavaScriptMessage (const wchar_t *message, const wchar_t *defaultPrompt, const wchar_t *frameUrl, int messageType) |
Called when the view triggered a javascript message box, i.e. an alert, confirmation dialog or a prompt dialog. More... | |
virtual void | OnGetAuthCredentials (bool isProxy, const wchar_t *host, unsigned int port, const wchar_t *realm, const wchar_t *scheme) |
Called when a view requires authentication credentials. More... | |
virtual void | CreateSurface (bool sharedMemory, unsigned width, unsigned height, SurfaceResponse *response)=0 |
Called when the View requires a new surface to draw on. Allows the user to create the resources. Shared textures are preferred and allow for much higher performance. Shared textures must be crated as render targets. More... | |
virtual void | DestroySurface (CoherentHandle surface, bool usesSharedMemory)=0 |
Called when a surface is unneeded anymore and should be destroyed This function can be called from a thread different than the main UI context thread in order to support client applications with multi-threaded rendering. More... | |
virtual void | OnCertificateError (const wchar_t *url, CertificateStatus status, Certificate *certificate, CertificateErrorResponse *response) |
Called when there is an error with the certificate of a particular URL. More... | |
virtual void | OnRequestMediaStream (MediaStreamRequest *request) |
Called when the view requests access to a media stream. Media streams are the audio capture (microphone) and video capture (camera) devices on the system. More... | |
virtual void | OnTextInputTypeChanged (TextInputControlType type, bool canComposeInline) |
Called when the current text input control changes (i.e. the user click an edit-box). Use this methof to decide when to allow for IME input. More... | |
virtual void | OnCaretRectChanged (unsigned x, unsigned y, unsigned width, unsigned height) |
Called when the caret changes during IME composition. You can use this method to correctly position a custom IME control & candidate list. More... | |
virtual void | OnIMEShouldCancelComposition () |
Called when the user must cancel the IME composition due to an event in the View itself (i.e. the user has focused a non-editable element while a composition was on-going) | |
virtual bool | OnCanCreateChildWindow (const wchar_t *openerUrl, const wchar_t *targetUrl, ChildViewInfo &childViewInfo) |
Called when the view wants to open a new window. More... | |
virtual void | OnFileSelectRequest (FileSelectRequest *request) |
Called when the view requests file selection. It could be either single file, directory or multiple files. More... | |
virtual void | OnAudioStreamCreated (int streamId, int channels, int bitDepth, int frequency) |
Called when a new WebAudio stream is created. This is usually when the page is loading (for <audio> HTML tags). More... | |
virtual void | OnAudioStreamPlay (int streamId) |
Called when a WebAudio stream is played. More... | |
virtual void | OnAudioStreamPause (int streamId) |
Called when a WebAudio stream is stopped. More... | |
virtual void | OnAudioStreamClose (int streamId) |
Called when a WebAudio stream is closed. This is usually called when the page is unloading. More... | |
Additional Inherited Members | |
Public Types inherited from Coherent::UI::ViewListenerBase | |
enum | MessageLevel |
Levels of script messages. | |
Interface that allows clients to listen to View events.
|
pure virtual |
Called when the View requires a new surface to draw on. Allows the user to create the resources. Shared textures are preferred and allow for much higher performance. Shared textures must be crated as render targets.
sharedMemory | true if the surface should be created in shared memory (4 * width * height bytes); false if a shared texture must be created. |
width | the width of the surface in pixels |
height | the height of the surface in pixels |
response | - object to hold the response when the surface is created or fails it's creation - must be signaled |
Implements Coherent::UI::ViewListenerBase.
|
pure virtual |
Called when a surface is unneeded anymore and should be destroyed This function can be called from a thread different than the main UI context thread in order to support client applications with multi-threaded rendering.
surface | handle to the surface |
usesSharedMemory | determines whether the surface parameter is a handle to shared memory or shared texture |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a WebAudio stream is closed. This is usually called when the page is unloading.
streamId | the ID of the stream that is closed |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a new WebAudio stream is created. This is usually when the page is loading (for <audio> HTML tags).
streamId | the generated ID for the new stream |
channels | the number of channels in the stream |
bitDepth | bits per sample in the stream |
frequency | the audio stream frequency, in Hz |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a WebAudio stream is stopped.
streamId | the ID of the stream that is stopped |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a WebAudio stream is played.
streamId | the ID of the stream that is played |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the bindings for frame are released.
frameId | the id of the frame |
path | the path in the frame |
isMainFrame | true if this is the main frame of the view |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called by the UI when there is no registered handler for this event.
eventName | name of the event |
arguments | arguments of the event invocation |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the view wants to open a new window.
openerUrl | the URL that wants to open the new window |
targetUrl | the target URL of the new window |
childViewInfo | structure that the user should fill in if she's about to allow new view creation |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the caret changes during IME composition. You can use this method to correctly position a custom IME control & candidate list.
the | x position of the selection caret |
the | y position of the selection caret |
the | width of the selection caret |
the | height of the selection caret |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when there is an error with the certificate of a particular URL.
certificate
and response
pointers are valid only for the duration of this call url | the url of the request |
status | the error status of the certificate |
certificate | the certificate details. This pointer will be valid only for this call |
response | object to signal whether to continue loading the URL. This pointer will be valid only for this call |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the cursor has changed internally in the View. Can be used to allow the user to change the shown cursor if needed - for instance when hovering a text field etc.
cursor | the new cursor |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a new surface has been drawn and is ready to use by the client.
handle | a handle to one of the buffers created by CreateSurface. May be a shared memory buffer or a shared texture depending on the way the View was created. The handle is valid only during this call |
usesSharedMemory | determines whether the handle parameter is a handle to shared memory or shared texture |
width | the width of the surface |
height | the height of the surface |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when an error occurs for this specific View.
error | error description |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a frame has been failed loading.
frameId | the id of the frame |
validatedPath | the path in the frame |
isMainFrame | true if this is the main frame of the View |
error | error message for the failure |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the view requests file selection. It could be either single file, directory or multiple files.
request | contains the file selection params for the request |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a frame has been successfully loaded.
frameId | the id of the loaded frame |
validatedPath | the path loaded in the frame |
isMainFrame | true if this is the main frame of the View |
statusCode | the status code of the response |
headers | an array of header fields |
headersCount | the count of items in the headers array |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a view requires authentication credentials.
isProxy | whether the request came from a server or a proxy |
host | the host which triggered the request |
port | the port at which the request was triggered |
realm | realm of the authentication challenge. Encoded in UTF-8 |
scheme | the authentication scheme used, e.g. "basic" or "digest". Encoded in ASCII |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the view triggered a javascript message box, i.e. an alert, confirmation dialog or a prompt dialog.
message | the JavaScript message |
defaultPrompt | the default value of the prompt text box, in case the message type is prompt |
frameUrl | the URL which created the message |
messageType | the type of the message (alert/confirm/prompt) |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the view starts navigation to a new path.
path | URL that the view is navigating to |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a frame is ready for bindings.
frameId | the id of the frame |
path | the path in the frame |
isMainFrame | true if this is the main frame of the view |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the view requests access to a media stream. Media streams are the audio capture (microphone) and video capture (camera) devices on the system.
request | contains the available media streams for the request |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when a message is sent from a script running in this specific View.
level | message level |
message | the text of the message |
sourceId | id of the script (usually file name) |
line | the number of the line in which the message was sent |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called when the current text input control changes (i.e. the user click an edit-box). Use this methof to decide when to allow for IME input.
type | the type of the currently focused text input control by the user |
canComposeInline | if the IME composition could be performed in-line in the control |
Implements Coherent::UI::ViewListenerBase.
|
inlinevirtual |
Called before an URL request is made. The default implementation allows all requests. NOTE: this method will be called only when View::InterceptURLRequests(true)
has been called.
request | the URLRequest object that can be used to modify the request. This pointer will be valid only for this call |
Implements Coherent::UI::ViewListenerBase.
|
pure virtual |
Called when the requested View has been created and is ready to use.
view | the instance of the view containing all manipulation methods |
Implements Coherent::UI::ViewListenerBase.