HTMLTableElement.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/DOM/ExceptionOr.h>
  8. #include <LibWeb/HTML/HTMLElement.h>
  9. #include <LibWeb/HTML/HTMLTableCaptionElement.h>
  10. #include <LibWeb/HTML/HTMLTableRowElement.h>
  11. #include <LibWeb/HTML/HTMLTableSectionElement.h>
  12. namespace Web::HTML {
  13. class HTMLTableElement final : public HTMLElement {
  14. WEB_PLATFORM_OBJECT(HTMLTableElement, HTMLElement);
  15. public:
  16. virtual ~HTMLTableElement() override;
  17. JS::GCPtr<HTMLTableCaptionElement> caption();
  18. void set_caption(HTMLTableCaptionElement*);
  19. JS::NonnullGCPtr<HTMLTableCaptionElement> create_caption();
  20. void delete_caption();
  21. JS::GCPtr<HTMLTableSectionElement> t_head();
  22. DOM::ExceptionOr<void> set_t_head(HTMLTableSectionElement* thead);
  23. JS::NonnullGCPtr<HTMLTableSectionElement> create_t_head();
  24. void delete_t_head();
  25. JS::GCPtr<HTMLTableSectionElement> t_foot();
  26. DOM::ExceptionOr<void> set_t_foot(HTMLTableSectionElement* tfoot);
  27. JS::NonnullGCPtr<HTMLTableSectionElement> create_t_foot();
  28. void delete_t_foot();
  29. JS::NonnullGCPtr<DOM::HTMLCollection> t_bodies();
  30. JS::NonnullGCPtr<HTMLTableSectionElement> create_t_body();
  31. JS::NonnullGCPtr<DOM::HTMLCollection> rows();
  32. DOM::ExceptionOr<JS::NonnullGCPtr<HTMLTableRowElement>> insert_row(long index);
  33. DOM::ExceptionOr<void> delete_row(long index);
  34. private:
  35. HTMLTableElement(DOM::Document&, DOM::QualifiedName);
  36. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  37. };
  38. }
  39. WRAPPER_HACK(HTMLTableElement, Web::HTML)