2023-02-28 03:23:53 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-01-10 02:05:03 +03:00
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2023-02-28 03:23:53 +03:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/system-state.html#pluginarray
|
2024-01-10 02:05:03 +03:00
|
|
|
class PluginArray : public Bindings::PlatformObject {
|
|
|
|
WEB_PLATFORM_OBJECT(PluginArray, Bindings::PlatformObject);
|
2023-11-19 21:47:52 +03:00
|
|
|
JS_DECLARE_ALLOCATOR(PluginArray);
|
2023-02-28 03:23:53 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~PluginArray() override;
|
|
|
|
|
|
|
|
void refresh() const;
|
|
|
|
size_t length() const;
|
|
|
|
JS::GCPtr<Plugin> item(u32 index) const;
|
2023-10-08 03:16:50 +03:00
|
|
|
JS::GCPtr<Plugin> named_item(FlyString const& name) const;
|
2023-02-28 03:23:53 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
PluginArray(JS::Realm&);
|
|
|
|
|
2023-08-07 09:41:28 +03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-02-28 03:23:53 +03:00
|
|
|
|
2024-01-10 02:05:03 +03:00
|
|
|
// ^Bindings::PlatformObject
|
2023-12-24 22:59:00 +03:00
|
|
|
virtual Vector<FlyString> supported_property_names() const override;
|
2023-02-28 03:23:53 +03:00
|
|
|
virtual WebIDL::ExceptionOr<JS::Value> item_value(size_t index) const override;
|
2023-10-08 03:16:50 +03:00
|
|
|
virtual WebIDL::ExceptionOr<JS::Value> named_item_value(FlyString const& name) const override;
|
2023-02-28 03:23:53 +03:00
|
|
|
virtual bool is_supported_property_index(u32) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|