2021-10-03 14:39:12 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
|
2021-10-03 14:39:12 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-03-18 00:22:27 -03:00
|
|
|
#include <LibURL/URL.h>
|
2021-10-03 14:39:12 -03:00
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
|
|
class HTMLHyperlinkElementUtils {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~HTMLHyperlinkElementUtils();
|
|
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String origin() const;
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String href() const;
|
2025-10-31 09:30:47 -03:00
|
|
|
void set_href(String);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String protocol() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_protocol(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String username() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_username(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String password() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_password(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String host() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_host(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String hostname() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_hostname(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String port() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_port(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String pathname() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_pathname(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String search() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_search(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
2023-11-19 21:34:37 -03:00
|
|
|
String hash() const;
|
2023-09-03 00:36:00 -03:00
|
|
|
void set_hash(StringView);
|
2021-10-03 14:39:12 -03:00
|
|
|
|
|
|
|
|
protected:
|
2024-11-06 14:00:18 -03:00
|
|
|
virtual DOM::Element& hyperlink_element_utils_element() = 0;
|
2026-01-11 16:54:57 -03:00
|
|
|
virtual DOM::Element const& hyperlink_element_utils_element() const = 0;
|
2023-06-18 12:22:10 -03:00
|
|
|
|
2025-12-07 10:19:54 -03:00
|
|
|
Optional<URL::Origin> hyperlink_element_utils_extract_an_origin() const;
|
|
|
|
|
|
2021-10-03 14:39:12 -03:00
|
|
|
void set_the_url();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void reinitialize_url() const;
|
|
|
|
|
void update_href();
|
|
|
|
|
|
2024-03-18 00:22:27 -03:00
|
|
|
Optional<URL::URL> m_url;
|
2021-10-03 14:39:12 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|