2023-03-23 17:26:13 +00:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
2023-03-23 17:26:13 +00:00
|
|
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
2024-08-14 16:25:48 +01:00
|
|
|
* Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
|
2023-03-23 17:26:13 +00:00
|
|
|
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibWeb/CSS/Angle.h>
|
2025-08-08 11:08:54 +01:00
|
|
|
#include <LibWeb/CSS/StyleValues/DimensionStyleValue.h>
|
2023-03-23 17:26:13 +00:00
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
2025-08-08 11:08:54 +01:00
|
|
|
class AngleStyleValue : public DimensionStyleValue {
|
2023-03-23 17:26:13 +00:00
|
|
|
public:
|
2025-04-15 15:18:27 -06:00
|
|
|
static ValueComparingNonnullRefPtr<AngleStyleValue const> create(Angle angle)
|
2023-03-23 17:26:13 +00:00
|
|
|
{
|
2023-08-19 14:00:10 +01:00
|
|
|
return adopt_ref(*new (nothrow) AngleStyleValue(move(angle)));
|
2023-03-23 17:26:13 +00:00
|
|
|
}
|
|
|
|
virtual ~AngleStyleValue() override;
|
|
|
|
|
|
|
|
Angle const& angle() const { return m_angle; }
|
2025-08-08 11:08:54 +01:00
|
|
|
virtual double raw_value() const override { return m_angle.raw_value(); }
|
2025-09-11 11:50:59 +01:00
|
|
|
virtual FlyString unit_name() const override { return m_angle.unit_name(); }
|
2023-03-23 17:26:13 +00:00
|
|
|
|
2024-12-07 00:59:49 +01:00
|
|
|
virtual String to_string(SerializationMode) const override;
|
2023-03-23 17:26:13 +00:00
|
|
|
|
2025-08-08 10:11:51 +01:00
|
|
|
bool equals(StyleValue const& other) const override;
|
2023-03-23 17:26:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
explicit AngleStyleValue(Angle angle);
|
|
|
|
|
|
|
|
Angle m_angle;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|