FormAssociatedElement.h 735 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/WeakPtr.h>
  8. #include <LibWeb/Forward.h>
  9. #include <LibWeb/HTML/HTMLElement.h>
  10. namespace Web::HTML {
  11. class FormAssociatedElement : public HTMLElement {
  12. public:
  13. HTMLFormElement* form() { return m_form; }
  14. HTMLFormElement const* form() const { return m_form; }
  15. void set_form(HTMLFormElement*);
  16. bool enabled() const;
  17. protected:
  18. FormAssociatedElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  19. : HTMLElement(document, move(qualified_name))
  20. {
  21. }
  22. virtual ~FormAssociatedElement() = default;
  23. private:
  24. WeakPtr<HTMLFormElement> m_form;
  25. };
  26. }