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