summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h
blob: 20cc0b6fde1eb3091f68659e9c5dcdfd3c821e40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright (c) 2022, Martin Falisse <mfalisse@outlook.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/String.h>

namespace Web::CSS {

class GridTrackPlacement {
public:
    GridTrackPlacement(int, bool);
    GridTrackPlacement(int);
    GridTrackPlacement();

    static GridTrackPlacement make_auto() { return GridTrackPlacement(); };

    void set_position(int position) { m_position = position; }
    int position() const { return m_position; }

    void set_has_span(bool has_span) { m_has_span = has_span; }
    bool has_span() const { return m_has_span; }

    String to_string() const;
    bool operator==(GridTrackPlacement const& other) const
    {
        return m_position == other.position() && m_has_span == other.has_span();
    }

private:
    int m_position { 0 };
    bool m_has_span { false };
};

}