#ifndef Location_h
#define Location_h
#include "DOMStringList.h"
#include "DOMWindowProperty.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class DOMWindow;
class Frame;
class KURL;
typedef int ExceptionCode;
class Location : public RefCounted<Location>, public DOMWindowProperty {
public:
static PassRefPtr<Location> create(Frame* frame) { return adoptRef(new Location(frame)); }
void setHref(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String href() const;
void assign(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
void replace(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
void reload(DOMWindow* activeWindow);
void setProtocol(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow, ExceptionCode&);
String protocol() const;
void setHost(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String host() const;
void setHostname(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String hostname() const;
void setPort(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String port() const;
void setPathname(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String pathname() const;
void setSearch(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String search() const;
void setHash(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String hash() const;
String origin() const;
String toString() const { return href(); }
PassRefPtr<DOMStringList> ancestorOrigins() const;
private:
explicit Location(Frame*);
void setLocation(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
const KURL& url() const;
};
}
#endif // Location_h