HTMLHyperlinkElementUtils.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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/URL.h>
  8. #include <LibWeb/Forward.h>
  9. namespace Web::HTML {
  10. class HTMLHyperlinkElementUtils {
  11. public:
  12. virtual ~HTMLHyperlinkElementUtils();
  13. String origin() const;
  14. String href() const;
  15. void set_href(String);
  16. String protocol() const;
  17. void set_protocol(String);
  18. String username() const;
  19. void set_username(String);
  20. String password() const;
  21. void set_password(String);
  22. String host() const;
  23. void set_host(String);
  24. String hostname() const;
  25. void set_hostname(String);
  26. String port() const;
  27. void set_port(String);
  28. String pathname() const;
  29. void set_pathname(String);
  30. String search() const;
  31. void set_search(String);
  32. String hash() const;
  33. void set_hash(String);
  34. protected:
  35. virtual DOM::Document const& hyperlink_element_utils_document() const = 0;
  36. virtual String hyperlink_element_utils_href() const = 0;
  37. virtual void set_hyperlink_element_utils_href(String) = 0;
  38. void set_the_url();
  39. private:
  40. void reinitialize_url() const;
  41. void update_href();
  42. Optional<AK::URL> m_url;
  43. };
  44. }