Loading...
Searching...
No Matches
ViewListener

#include <Ultralight/Listener.h>

Overview

User-defined interface to handle general events for a View.

See also
View::set_view_listener

Public Member Functions

virtual ~ViewListener ()
 
virtual void OnChangeTitle (ultralight::View *caller, const String &title)
 Called when the page title changes.
 
virtual void OnChangeURL (ultralight::View *caller, const String &url)
 Called when the page URL changes.
 
virtual void OnChangeTooltip (ultralight::View *caller, const String &tooltip)
 Called when the tooltip changes (usually as result of a mouse hover)
 
virtual void OnChangeCursor (ultralight::View *caller, Cursor cursor)
 Called when the mouse cursor changes.
 
virtual void OnAddConsoleMessage (ultralight::View *caller, const ultralight::ConsoleMessage &message)
 Called when a message is added to the console (useful for errors / debug)
 
virtual RefPtr< ViewOnCreateChildView (ultralight::View *caller, const String &opener_url, const String &target_url, bool is_popup, const IntRect &popup_rect)
 Called when the page wants to create a new child View.
 
virtual RefPtr< ViewOnCreateInspectorView (ultralight::View *caller, bool is_local, const String &inspected_url)
 Called when the page wants to create a new View to display the local inspector in.
 
virtual void OnRequestClose (ultralight::View *caller)
 Called when the page requests to be closed.
 

Constructor & Destructor Documentation

◆ ~ViewListener()

virtual ~ViewListener ( )
inlinevirtual

Member Function Documentation

◆ OnAddConsoleMessage()

virtual void OnAddConsoleMessage ( ultralight::View * caller,
const ultralight::ConsoleMessage & message )
inlinevirtual

Called when a message is added to the console (useful for errors / debug)

◆ OnChangeCursor()

virtual void OnChangeCursor ( ultralight::View * caller,
Cursor cursor )
inlinevirtual

Called when the mouse cursor changes.

◆ OnChangeTitle()

virtual void OnChangeTitle ( ultralight::View * caller,
const String & title )
inlinevirtual

Called when the page title changes.

◆ OnChangeTooltip()

virtual void OnChangeTooltip ( ultralight::View * caller,
const String & tooltip )
inlinevirtual

Called when the tooltip changes (usually as result of a mouse hover)

◆ OnChangeURL()

virtual void OnChangeURL ( ultralight::View * caller,
const String & url )
inlinevirtual

Called when the page URL changes.

◆ OnCreateChildView()

virtual RefPtr< View > OnCreateChildView ( ultralight::View * caller,
const String & opener_url,
const String & target_url,
bool is_popup,
const IntRect & popup_rect )
virtual

Called when the page wants to create a new child View.

This is usually the result of a user clicking a link with target="_blank" or by JavaScript calling window.open(url).

To allow creation of these new Views, you should create a new View in this callback (eg, Renderer::CreateView()), resize it to your container, and return it. You are responsible for displaying the returned View.

Parameters
callerThe View that called this event.
opener_urlThe URL of the page that initiated this request.
target_urlThe URL that the new View will navigate to.
is_popupWhether or not this was triggered by window.open().
popup_rectPopups can optionally request certain dimensions and coordinates via window.open(). You can choose to respect these or not by resizing/moving the View to this rect.
Returns
Returns a RefPtr to a created View to use to satisfy the the request (or return nullptr if you want to block the action).

◆ OnCreateInspectorView()

virtual RefPtr< View > OnCreateInspectorView ( ultralight::View * caller,
bool is_local,
const String & inspected_url )
virtual

Called when the page wants to create a new View to display the local inspector in.

You should create a new View in this callback (eg, Renderer::CreateView()), resize it to your container, and return it. You are responsible for displaying the returned View.

Returns
Returns a RefPtr to a created View to use to satisfy the the request (or return nullptr if you want to block the action).

◆ OnRequestClose()

virtual void OnRequestClose ( ultralight::View * caller)
inlinevirtual

Called when the page requests to be closed.


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