|
AeonGUI
A portable video game graphic user interface library.
|
Represents the URL of the active document. More...
#include <aeongui/dom/Location.hpp>
Public Member Functions | |
| Location () | |
| Default constructor. URL is "about:blank". | |
| Location (std::function< void(const Location &) > callback) | |
| Construct with a change callback. | |
| ~Location () | |
| Destructor. | |
| void | SetCallback (std::function< void(const Location &) > callback) |
| Set or replace the change callback. | |
| void | assign (const USVString &url) |
| Navigate to the given URL. | |
| void | replace (const USVString &url) |
| Replace the current URL without creating a history entry. | |
| Location & | operator= (const USVString &url) |
| Assign a URL using the = operator. | |
| void | reload () |
| Reload the current document. | |
| const USVString & | href () const |
| Get the full URL. | |
| const USVString & | origin () const |
| Get the origin portion of the URL. | |
| const USVString & | protocol () const |
| Get the protocol (e.g. "https:"). | |
| const USVString & | host () const |
| Get the host (hostname:port). | |
| const USVString & | hostname () const |
| Get the hostname. | |
| const USVString & | port () const |
| Get the port number. | |
| const USVString & | pathname () const |
| Get the pathname. | |
| const USVString & | search () const |
| Get the query string (including leading '?'). | |
| const USVString & | hash () const |
| Get the fragment (including leading '#'). | |
Represents the URL of the active document.
Provides access to the individual components of a URL (protocol, hostname, port, pathname, etc.) and methods to navigate.
| AeonGUI::DOM::Location::Location | ( | std::function< void(const Location &) > | callback | ) |
Construct with a change callback.
| callback | Called whenever the location changes. |
| void AeonGUI::DOM::Location::assign | ( | const USVString & | url | ) |
Navigate to the given URL.
DOM Properties and Methods
| url | The URL to navigate to. |
| const USVString & AeonGUI::DOM::Location::hash | ( | ) | const |
Get the fragment (including leading '#').
| const USVString & AeonGUI::DOM::Location::host | ( | ) | const |
Get the host (hostname:port).
| const USVString & AeonGUI::DOM::Location::hostname | ( | ) | const |
Get the hostname.
| const USVString & AeonGUI::DOM::Location::href | ( | ) | const |
Get the full URL.
| Location & AeonGUI::DOM::Location::operator= | ( | const USVString & | url | ) |
Assign a URL using the = operator.
| url | The URL to navigate to. |
| const USVString & AeonGUI::DOM::Location::origin | ( | ) | const |
Get the origin portion of the URL.
| const USVString & AeonGUI::DOM::Location::pathname | ( | ) | const |
Get the pathname.
| const USVString & AeonGUI::DOM::Location::port | ( | ) | const |
Get the port number.
| const USVString & AeonGUI::DOM::Location::protocol | ( | ) | const |
Get the protocol (e.g. "https:").
| void AeonGUI::DOM::Location::replace | ( | const USVString & | url | ) |
Replace the current URL without creating a history entry.
| url | The URL to navigate to. |
| const USVString & AeonGUI::DOM::Location::search | ( | ) | const |
Get the query string (including leading '?').
| void AeonGUI::DOM::Location::SetCallback | ( | std::function< void(const Location &) > | callback | ) |
Set or replace the change callback.
| callback | The new callback function. |