#include <Ultralight/Listener.h>
User-defined interface to listen for View-specific events.
- See also
- View::set_view_listener
|
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< View > | OnCreateChildView (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< View > | OnCreateInspectorView (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.
|
|
◆ ~ViewListener()
virtual ultralight::ViewListener::~ViewListener |
( |
| ) |
|
|
inlinevirtual |
◆ OnAddConsoleMessage()
Called when a message is added to the console (useful for errors / debug)
◆ OnChangeCursor()
Called when the mouse cursor changes.
◆ OnChangeTitle()
Called when the page title changes.
◆ OnChangeTooltip()
Called when the tooltip changes (usually as result of a mouse hover)
◆ OnChangeURL()
Called when the page URL changes.
◆ OnCreateChildView()
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
-
caller | The View that called this event. |
opener_url | The URL of the page that initiated this request. |
target_url | The URL that the new View will navigate to. |
is_popup | Whether or not this was triggered by window.open(). |
popup_rect | Popups 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()
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: