AngleStyleValue.h 940 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
  4. * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
  5. * Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
  6. *
  7. * SPDX-License-Identifier: BSD-2-Clause
  8. */
  9. #pragma once
  10. #include <LibWeb/CSS/Angle.h>
  11. #include <LibWeb/CSS/StyleValue.h>
  12. namespace Web::CSS {
  13. class AngleStyleValue : public StyleValueWithDefaultOperators<AngleStyleValue> {
  14. public:
  15. static ValueComparingNonnullRefPtr<AngleStyleValue> create(Angle angle)
  16. {
  17. return adopt_ref(*new AngleStyleValue(move(angle)));
  18. }
  19. virtual ~AngleStyleValue() override;
  20. Angle const& angle() const { return m_angle; }
  21. virtual ErrorOr<String> to_string() const override;
  22. bool properties_equal(AngleStyleValue const& other) const;
  23. private:
  24. explicit AngleStyleValue(Angle angle);
  25. Angle m_angle;
  26. };
  27. }