summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Bindings/LocationObject.h
blob: 10b9e947be06b72604d820f3a8ea510a67d846b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibJS/Runtime/Object.h>
#include <LibWeb/Forward.h>

namespace Web {
namespace Bindings {

class LocationObject final : public JS::Object {
    JS_OBJECT(LocationObject, JS::Object);

public:
    explicit LocationObject(JS::GlobalObject&);
    virtual void initialize(JS::GlobalObject&) override;
    virtual ~LocationObject() override;

private:
    JS_DECLARE_NATIVE_FUNCTION(reload);

    JS_DECLARE_NATIVE_GETTER(href_getter);
    JS_DECLARE_NATIVE_SETTER(href_setter);

    JS_DECLARE_NATIVE_GETTER(host_getter);
    JS_DECLARE_NATIVE_GETTER(hostname_getter);
    JS_DECLARE_NATIVE_GETTER(pathname_getter);
    JS_DECLARE_NATIVE_GETTER(hash_getter);
    JS_DECLARE_NATIVE_GETTER(search_getter);
    JS_DECLARE_NATIVE_GETTER(protocol_getter);
};

}
}