MimeType.h 808 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Bindings/PlatformObject.h>
  8. namespace Web::HTML {
  9. // https://html.spec.whatwg.org/multipage/system-state.html#mimetype
  10. class MimeType : public Bindings::PlatformObject {
  11. WEB_PLATFORM_OBJECT(MimeType, Bindings::PlatformObject);
  12. GC_DECLARE_ALLOCATOR(MimeType);
  13. public:
  14. virtual ~MimeType() override;
  15. String const& type() const;
  16. String description() const;
  17. String const& suffixes() const;
  18. GC::Ref<Plugin> enabled_plugin() const;
  19. private:
  20. MimeType(JS::Realm&, String type);
  21. virtual void initialize(JS::Realm&) override;
  22. // https://html.spec.whatwg.org/multipage/system-state.html#concept-mimetype-type
  23. String m_type;
  24. };
  25. }