#pragma once

#include "foundation/result.h"

#include <cstdint>
#include <string_view>

namespace pp::ui {

enum class LayoutLengthKind : std::uint8_t {
    auto_value,
    pixels,
    percent,
};

struct LayoutLength {
    LayoutLengthKind kind = LayoutLengthKind::auto_value;
    std::uint32_t value = 0;
};

[[nodiscard]] pp::foundation::Result<LayoutLength> parse_layout_length(std::string_view text) noexcept;
[[nodiscard]] const char* layout_length_kind_name(LayoutLengthKind kind) noexcept;

}
