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

#include <Ultralight/Listener.h>

Details

User-defined interface to listen for load-related events for a View.

See also
View::set_load_listener

Public Member Functions

virtual ~LoadListener ()
 
virtual void OnBeginLoading (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url)
 Called when the page begins loading a new URL into a frame.
 
virtual void OnFinishLoading (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url)
 Called when the page finishes loading a URL into a frame.
 
virtual void OnFailLoading (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url, const String &description, const String &error_domain, int error_code)
 Called when an error occurs while loading a URL into a frame.
 
virtual void OnWindowObjectReady (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url)
 Called when the JavaScript window object is reset for a new page load.
 
virtual void OnDOMReady (ultralight::View *caller, uint64_t frame_id, bool is_main_frame, const String &url)
 Called when all JavaScript has been parsed and the document is ready.
 
virtual void OnUpdateHistory (ultralight::View *caller)
 Called when the session history (back/forward state) is modified.
 

Constructor & Destructor Documentation

◆ ~LoadListener()

virtual ultralight::LoadListener::~LoadListener ( )
inlinevirtual

Member Function Documentation

◆ OnBeginLoading()

virtual void ultralight::LoadListener::OnBeginLoading ( ultralight::View caller,
uint64_t  frame_id,
bool  is_main_frame,
const String url 
)
inlinevirtual

Called when the page begins loading a new URL into a frame.

Parameters
frame_idA unique ID for the frame.
is_main_frameWhether or not this is the main frame.
urlThe URL for the load.

◆ OnDOMReady()

virtual void ultralight::LoadListener::OnDOMReady ( ultralight::View caller,
uint64_t  frame_id,
bool  is_main_frame,
const String url 
)
inlinevirtual

Called when all JavaScript has been parsed and the document is ready.

This is the best time to make any JavaScript calls that are dependent on DOM elements or scripts on the page.

Parameters
frame_idA unique ID for the frame.
is_main_frameWhether or not this is the main frame.
urlThe URL for the load.

◆ OnFailLoading()

virtual void ultralight::LoadListener::OnFailLoading ( ultralight::View caller,
uint64_t  frame_id,
bool  is_main_frame,
const String url,
const String description,
const String error_domain,
int  error_code 
)
inlinevirtual

Called when an error occurs while loading a URL into a frame.

Parameters
frame_idA unique ID for the frame.
is_main_frameWhether or not this is the main frame.
urlThe URL for the load.
descriptionA human-readable description of the error.
error_domainThe name of the module that triggered the error.
error_codeInternal error code generated by the module.

◆ OnFinishLoading()

virtual void ultralight::LoadListener::OnFinishLoading ( ultralight::View caller,
uint64_t  frame_id,
bool  is_main_frame,
const String url 
)
inlinevirtual

Called when the page finishes loading a URL into a frame.

Parameters
frame_idA unique ID for the frame.
is_main_frameWhether or not this is the main frame.
urlThe URL for the load.

◆ OnUpdateHistory()

virtual void ultralight::LoadListener::OnUpdateHistory ( ultralight::View caller)
inlinevirtual

Called when the session history (back/forward state) is modified.

◆ OnWindowObjectReady()

virtual void ultralight::LoadListener::OnWindowObjectReady ( ultralight::View caller,
uint64_t  frame_id,
bool  is_main_frame,
const String url 
)
inlinevirtual

Called when the JavaScript window object is reset for a new page load.

This is called before any scripts are executed on the page and is the earliest time to setup any initial JavaScript state or bindings.

The document is not guaranteed to be loaded/parsed at this point. If you need to make any JavaScript calls that are dependent on DOM elements or scripts on the page, use OnDOMReady instead.

The window object is lazily initialized (this will not be called on pages with no scripts).

Parameters
frame_idA unique ID for the frame.
is_main_frameWhether or not this is the main frame.
urlThe URL for the load.

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