1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 04:25:08 +00:00
serenity/Libraries/LibHTML/Layout/ComputedStyle.h
Andreas Kling 04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00

47 lines
1.1 KiB
C++

#pragma once
#include <LibHTML/CSS/LengthBox.h>
#include <SharedGraphics/Color.h>
#include <SharedGraphics/Size.h>
enum FontStyle {
Normal,
Bold,
};
class ComputedStyle {
public:
ComputedStyle();
~ComputedStyle();
Color text_color() const { return m_text_color; }
Color background_color() const { return m_background_color; }
LengthBox& offset() { return m_offset; }
LengthBox& margin() { return m_margin; }
LengthBox& padding() { return m_padding; }
LengthBox& border() { return m_border; }
const LengthBox& offset() const { return m_offset; }
const LengthBox& margin() const { return m_margin; }
const LengthBox& padding() const { return m_padding; }
const LengthBox& border() const { return m_border; }
FontStyle font_style() const { return m_font_style; }
const Size& size() const { return m_size; }
Size& size() { return m_size; }
private:
Color m_text_color;
Color m_background_color;
LengthBox m_offset;
LengthBox m_margin;
LengthBox m_padding;
LengthBox m_border;
Size m_size;
FontStyle m_font_style { FontStyle::Normal };
};