EventHandler.h 528 B

12345678910111213141516171819202122232425262728293031323334
  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/String.h>
  8. #include <LibJS/Heap/Handle.h>
  9. #include <LibJS/Runtime/FunctionObject.h>
  10. namespace Web::HTML {
  11. struct EventHandler {
  12. EventHandler()
  13. {
  14. }
  15. EventHandler(String s)
  16. : string(move(s))
  17. {
  18. }
  19. EventHandler(JS::Handle<JS::FunctionObject> c)
  20. : callback(move(c))
  21. {
  22. }
  23. String string;
  24. JS::Handle<JS::FunctionObject> callback;
  25. };
  26. }