Ultralight C++ API 1.3.0
Loading...
Searching...
No Matches
ultralight::ViewListener Class Reference

#include <Ultralight/Listener.h>

Details

User-defined interface to listen for View-specific events.

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, MessageSource source, MessageLevel level, const String &message, uint32_t line_number, uint32_t column_number, const String &source_id)
 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 ultralight::ViewListener::~ViewListener ( )
inlinevirtual

Member Function Documentation

◆ OnAddConsoleMessage()

virtual void ultralight::ViewListener::OnAddConsoleMessage ( ultralight::View caller,
MessageSource  source,
MessageLevel  level,
const String message,
uint32_t  line_number,
uint32_t  column_number,
const String source_id 
)
inlinevirtual

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

◆ OnChangeCursor()

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

Called when the mouse cursor changes.

◆ OnChangeTitle()

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

Called when the page title changes.

◆ OnChangeTooltip()

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

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

◆ OnChangeURL()

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

Called when the page URL changes.

◆ OnCreateChildView()

virtual RefPtr< View > ultralight::ViewListener::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 > ultralight::ViewListener::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 ultralight::ViewListener::OnRequestClose ( ultralight::View caller)
inlinevirtual

Called when the page requests to be closed.


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