16#ifndef AEONGUI_DOM_LOCATION_H
17#define AEONGUI_DOM_LOCATION_H
18#include "aeongui/dom/USVString.hpp"
47 DLL
void assign (
const USVString& url );
51 DLL
void replace (
const USVString& url );
61 DLL
const USVString&
href()
const;
64 DLL
const USVString&
origin()
const;
67 DLL
const USVString&
protocol()
const;
70 DLL
const USVString&
host()
const;
73 DLL
const USVString&
hostname()
const;
76 DLL
const USVString&
port()
const;
79 DLL
const USVString&
pathname()
const;
82 DLL
const USVString&
search()
const;
85 DLL
const USVString&
hash()
const;
92 USVString m_href{
"about:blank"};
93 USVString m_origin{
"about:blank"};
94 USVString m_protocol{
"about:"};
95 USVString m_host{
"blank"};
96 USVString m_hostname{
"blank"};
98 USVString m_pathname{};
101 std::function<void (
const Location& ) > mCallback{};
Location & operator=(const USVString &url)
Assign a URL using the = operator.
Definition Location.cpp:57
void assign(const USVString &url)
Navigate to the given URL.
Definition Location.cpp:63
void SetCallback(std::function< void(const Location &) > callback)
Set or replace the change callback.
Definition Location.cpp:52
const USVString & hostname() const
Get the hostname.
Definition Location.cpp:128
const USVString & search() const
Get the query string (including leading '?').
Definition Location.cpp:146
const USVString & hash() const
Get the fragment (including leading '#').
Definition Location.cpp:152
const USVString & pathname() const
Get the pathname.
Definition Location.cpp:140
const USVString & protocol() const
Get the protocol (e.g. "https:").
Definition Location.cpp:116
Location()
Default constructor. URL is "about:blank".
void replace(const USVString &url)
Replace the current URL without creating a history entry.
Definition Location.cpp:87
const USVString & port() const
Get the port number.
Definition Location.cpp:134
const USVString & origin() const
Get the origin portion of the URL.
Definition Location.cpp:110
const USVString & host() const
Get the host (hostname:port).
Definition Location.cpp:122
const USVString & href() const
Get the full URL.
Definition Location.cpp:104
void reload()
Reload the current document.
Definition Location.cpp:95