/src/serenity/Userland/Libraries/LibWeb/CSS/StyleValues/BackgroundRepeatStyleValue.h
Line | Count | Source |
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 | | |
10 | | #pragma once |
11 | | |
12 | | #include <LibWeb/CSS/CSSStyleValue.h> |
13 | | #include <LibWeb/CSS/Enums.h> |
14 | | |
15 | | namespace Web::CSS { |
16 | | |
17 | | class BackgroundRepeatStyleValue final : public StyleValueWithDefaultOperators<BackgroundRepeatStyleValue> { |
18 | | public: |
19 | | static ValueComparingNonnullRefPtr<BackgroundRepeatStyleValue> create(Repeat repeat_x, Repeat repeat_y) |
20 | 0 | { |
21 | 0 | return adopt_ref(*new (nothrow) BackgroundRepeatStyleValue(repeat_x, repeat_y)); |
22 | 0 | } |
23 | | virtual ~BackgroundRepeatStyleValue() override; |
24 | | |
25 | 0 | Repeat repeat_x() const { return m_properties.repeat_x; } |
26 | 0 | Repeat repeat_y() const { return m_properties.repeat_y; } |
27 | | |
28 | | virtual String to_string() const override; |
29 | | |
30 | 0 | bool properties_equal(BackgroundRepeatStyleValue const& other) const { return m_properties == other.m_properties; } |
31 | | |
32 | | private: |
33 | | BackgroundRepeatStyleValue(Repeat repeat_x, Repeat repeat_y); |
34 | | |
35 | | struct Properties { |
36 | | Repeat repeat_x; |
37 | | Repeat repeat_y; |
38 | 0 | bool operator==(Properties const&) const = default; |
39 | | } m_properties; |
40 | | }; |
41 | | |
42 | | } |