#pragma once
#include "DOMStringList.h"
#include "DOMWindowProperty.h"
#include "ExceptionOr.h"
#include "ScriptWrappable.h"
namespace WebCore {
class DOMWindow;
class Location final : public ScriptWrappable, public RefCounted<Location>, public DOMWindowProperty {
WTF_MAKE_ISO_ALLOCATED(Location);
public:
static Ref<Location> create(DOMWindow& window) { return adoptRef(*new Location(window)); }
ExceptionOr<void> setHref(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
String href() const;
ExceptionOr<void> assign(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
ExceptionOr<void> replace(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
void reload(DOMWindow& activeWindow);
ExceptionOr<void> setProtocol(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
String protocol() const;
ExceptionOr<void> setHost(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
WEBCORE_EXPORT String host() const;
ExceptionOr<void> setHostname(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
String hostname() const;
ExceptionOr<void> setPort(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
String port() const;
ExceptionOr<void> setPathname(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
String pathname() const;
ExceptionOr<void> setSearch(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
String search() const;
ExceptionOr<void> setHash(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
String hash() const;
String origin() const;
String toString() const { return href(); }
Ref<DOMStringList> ancestorOrigins() const;
private:
explicit Location(DOMWindow&);
ExceptionOr<void> setLocation(DOMWindow& activeWindow, DOMWindow& firstWindow, const String&);
const URL& url() const;
};
}