Molybden API
Loading...
Searching...
No Matches
molybden::Navigation Class Referenceabstract

Allows loading resources in the browser and working with the navigation history. More...

#include <navigation.hpp>

Inheritance diagram for molybden::Navigation:
molybden::NavigationEvents molybden::NavigationDelegates

Public Member Functions

virtual std::shared_ptr< Browserbrowser ()=0
 The browser instance of this navigation.
 
virtual void loadUrl (const std::string &url)=0
 Starts a navigation to the resource identified by the given url.
 
virtual void loadUrl (const std::string &url, const LoadUrlOptions &options)=0
 Starts a navigation to the resource identified by the given url and options.
 
virtual NavigationResult loadUrlAndWait (const std::string &url)=0
 Starts a navigation to the resource identified by the given url and blocks the current thread until the navigation is completed.
 
virtual NavigationResult loadUrlAndWait (const std::string &url, uint64_t timeout_in_seconds)=0
 Starts a navigation to the resource identified by the given url and blocks the current thread until the navigation is completed.
 
virtual NavigationResult loadUrlAndWait (const std::string &url, const LoadUrlOptions &options)=0
 Starts a navigation to the resource identified by the given options and blocks the current thread until the navigation is completed.
 
virtual NavigationResult loadUrlAndWait (const std::string &url, const LoadUrlOptions &options, uint64_t timeout_in_seconds)=0
 Starts a navigation to the resource identified by the given options and blocks the current thread until the navigation is completed.
 
virtual void goBack ()=0
 Loads the previous location in the back-forward list.
 
virtual bool canGoBack ()=0
 Checks if the previous location can be loaded.
 
virtual void goForward ()=0
 Loads the next location in the back-forward list.
 
virtual bool canGoForward ()=0
 Checks if the next location can be loaded.
 
virtual void stop ()=0
 Cancels any pending navigation or download operation and stops any dynamic page elements, such as background sounds and animations.
 
virtual void reload ()=0
 Reloads the currently loaded web page.
 
virtual void reloadAndCheckForRepost ()=0
 Reloads the currently loaded web page, but if the current web page has POST data, the user is prompted to see if they really want to reload the page.
 
virtual void reloadIgnoringCache ()=0
 Reloads the currently loaded web page ignoring caches.
 
virtual void reloadIgnoringCacheAndCheckForRepost ()=0
 Reloads the currently loaded web page ignoring caches, but if the current web page has POST data, the user is prompted to see if they really want to reload the page.
 
virtual void goToIndex (uint32_t index)=0
 Navigates to the navigation entry item at the given index in the back-forward list.
 
virtual uint32_t entryCount ()=0
 Returns the number of items in the back-forward list.
 
virtual int32_t currentEntryIndex ()=0
 Returns the index of the current item in the back-forward list or -1 if the list is empty.
 
virtual NavigationEntry entryAtIndex (uint32_t index)=0
 Returns the navigation entry item at the given index in the back-forward list.
 
virtual bool removeEntryAtIndex (uint32_t index)=0
 Removes the item at the given index in the back-forward list and returns true if it was removed successfully.
 

Additional Inherited Members

- Public Attributes inherited from molybden::NavigationEvents
Event< NavigationStartedonNavigationStarted
 Invoked when a navigation has been started.
 
Event< NavigationFinishedonNavigationFinished
 Invoked when a navigation has been finished.
 
Event< NavigationRedirectedonNavigationRedirected
 Invoked when a navigation has encountered a server redirect.
 
Event< NavigationStoppedonNavigationStopped
 Invoked when a navigation has been stopped.
 
Event< LoadProgressChangedonLoadProgressChanged
 Invoked when the web page loading progress has been changed.
 
Event< FrameLoadFailedonFrameLoadFailed
 Invoked when the frame load has been failed.
 
Event< FrameLoadFinishedonFrameLoadFinished
 Invoked when the frame load has been finished.
 
Event< FrameDocumentLoadFinishedonFrameDocumentLoadFinished
 Invoked when the frame document load has been finished.
 
Event< LoadStartedonLoadStarted
 Invoked when the load has been started.
 
Event< LoadFinishedonLoadFinished
 Invoked when the load has been finished.
 
- Public Attributes inherited from molybden::NavigationDelegates
Delegate< StartNavigationArgs, StartNavigationActiononStartNavigation
 Invoked when navigation to a resource is about to start.
 
Delegate< ShowHttpErrorPageArgs, ShowHttpErrorPageActiononShowHttpErrorPage
 Invoked when a network error web page is about to display, because the web server sends an empty HTTP response with the HTTP status code that represents an error.
 
Delegate< ShowNetErrorPageArgs, ShowNetErrorPageActiononShowNetErrorPage
 Invoked when a network error web page is about to display, because the required web resource cannot be loaded because of a network error.
 

Detailed Description

Allows loading resources in the browser and working with the navigation history.

Member Function Documentation

◆ entryAtIndex()

virtual NavigationEntry molybden::Navigation::entryAtIndex ( uint32_t  index)
pure virtual

Returns the navigation entry item at the given index in the back-forward list.

Parameters
indexthe position of the item in the back-forward list.

◆ goBack()

virtual void molybden::Navigation::goBack ( )
pure virtual

Loads the previous location in the back-forward list.

It does nothing if there is no previous location in the list.

◆ goForward()

virtual void molybden::Navigation::goForward ( )
pure virtual

Loads the next location in the back-forward list.

It does nothing if there is no next location in the list.

◆ goToIndex()

virtual void molybden::Navigation::goToIndex ( uint32_t  index)
pure virtual

Navigates to the navigation entry item at the given index in the back-forward list.

Parameters
indexthe position of the item in the back-forward list.

◆ loadUrl() [1/2]

virtual void molybden::Navigation::loadUrl ( const std::string &  url)
pure virtual

Starts a navigation to the resource identified by the given url.

Tells browser to start asynchronous loading and returns immediately. There is no guarantee that the resource will be loaded completely, by the time this method returns. If there is a pending navigation, it will be stopped/canceled.

Parameters
urlthe URL of the resource to load. It can be the URL of a web page (e.g. https://teamdev.com/molybden) or absolute path to a local file (e.g. file:///Users/me/index.html)

◆ loadUrl() [2/2]

virtual void molybden::Navigation::loadUrl ( const std::string &  url,
const LoadUrlOptions options 
)
pure virtual

Starts a navigation to the resource identified by the given url and options.

Tells the browser to start asynchronous loading and returns immediately. There is no guarantee that the resource will be loaded completely by the time this method returns. If there is a pending navigation, it will be stopped/canceled.

Parameters
urlthe URL of the resource to load. It can be the URL of a web page (e.g. https://teamdev.com/molybden) or absolute path to a local file (e.g. file:///Users/me/index.html)
optionsthe options such as upload data and extra HTTP headers.

◆ loadUrlAndWait() [1/4]

virtual NavigationResult molybden::Navigation::loadUrlAndWait ( const std::string &  url)
pure virtual

Starts a navigation to the resource identified by the given url and blocks the current thread until the navigation is completed.

If the navigation does not complete within the kDefaultNavigationTimeoutInSeconds, this method returns false.

This method is equivalent of loadUrlAndWait(url, kDefaultNavigationTimeoutInSeconds).

Parameters
urlthe URL of the resource to load. It can be the URL of a web page (e.g. https://teamdev.com/molybden) or absolute path to a local file (e.g. file:///Users/me/index.html)
Returns
the result of the navigation.

◆ loadUrlAndWait() [2/4]

virtual NavigationResult molybden::Navigation::loadUrlAndWait ( const std::string &  url,
const LoadUrlOptions options 
)
pure virtual

Starts a navigation to the resource identified by the given options and blocks the current thread until the navigation is completed.

If the navigation does not complete within the kDefaultNavigationTimeoutInSeconds, this method returns false.

This method is equivalent of loadUrlAndWait(options, kDefaultNavigationTimeoutInSeconds).

Parameters
urlthe URL of the resource to load. It can be the URL of a web page (e.g. https://teamdev.com/molybden) or absolute path to a local file (e.g. file:///Users/me/index.html)
optionsthe options such as upload data and extra HTTP headers.
Returns
the result of the navigation.

◆ loadUrlAndWait() [3/4]

virtual NavigationResult molybden::Navigation::loadUrlAndWait ( const std::string &  url,
const LoadUrlOptions options,
uint64_t  timeout_in_seconds 
)
pure virtual

Starts a navigation to the resource identified by the given options and blocks the current thread until the navigation is completed.

Parameters
urlthe URL of the resource to load. It can be the URL of a web page (e.g. https://teamdev.com/molybden) or absolute path to a local file (e.g. file:///Users/me/index.html)
optionsthe options such as upload data and extra HTTP headers.
timeout_in_secondsthe timeout in seconds for the browser to wait until the navigation is completed. If the navigation does not complete within the given timeout, this method returns false.
Returns
the result of the navigation.

◆ loadUrlAndWait() [4/4]

virtual NavigationResult molybden::Navigation::loadUrlAndWait ( const std::string &  url,
uint64_t  timeout_in_seconds 
)
pure virtual

Starts a navigation to the resource identified by the given url and blocks the current thread until the navigation is completed.

Parameters
urlthe URL of the resource to load. It can be the URL of a web page (e.g. https://teamdev.com/molybden) or absolute path to a local file (e.g. file:///Users/me/index.html)
timeout_in_secondsthe timeout in seconds for the browser to wait until the navigation is completed. If the navigation does not complete within the timeout, this method returns false.
Returns
the result of the navigation.

◆ removeEntryAtIndex()

virtual bool molybden::Navigation::removeEntryAtIndex ( uint32_t  index)
pure virtual

Removes the item at the given index in the back-forward list and returns true if it was removed successfully.

Parameters
indexthe position of the item to remove in the back-forward list.
Returns
true if the item was removed successfully.

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