add support for Ayatana indicator to Notification plugin
[claws.git] / src / plugins / litehtml_viewer / litehtml / css_properties.h
bloba5609a9b1de4fbce5b1fef6ae4e4aa00ca91ac3c
1 #ifndef LITEHTML_CSS_PROPERTIES_H
2 #define LITEHTML_CSS_PROPERTIES_H
4 #include "os_types.h"
5 #include "types.h"
6 #include "css_margins.h"
7 #include "borders.h"
8 #include "css_offsets.h"
9 #include "background.h"
11 namespace litehtml
13 class element;
14 class document;
16 class css_properties
18 private:
19 element_position m_el_position;
20 text_align m_text_align;
21 overflow m_overflow;
22 white_space m_white_space;
23 style_display m_display;
24 visibility m_visibility;
25 box_sizing m_box_sizing;
26 css_length m_z_index;
27 vertical_align m_vertical_align;
28 element_float m_float;
29 element_clear m_clear;
30 css_margins m_css_margins;
31 css_margins m_css_padding;
32 css_borders m_css_borders;
33 css_length m_css_width;
34 css_length m_css_height;
35 css_length m_css_min_width;
36 css_length m_css_min_height;
37 css_length m_css_max_width;
38 css_length m_css_max_height;
39 css_offsets m_css_offsets;
40 css_length m_css_text_indent;
41 css_length m_css_line_height;
42 int m_line_height;
43 list_style_type m_list_style_type;
44 list_style_position m_list_style_position;
45 string m_list_style_image;
46 string m_list_style_image_baseurl;
47 background m_bg;
48 uint_ptr m_font;
49 css_length m_font_size;
50 string m_font_family;
51 font_weight m_font_weight;
52 font_style m_font_style;
53 string m_text_decoration;
54 font_metrics m_font_metrics;
55 text_transform m_text_transform;
56 web_color m_color;
57 string m_cursor;
58 string m_content;
59 border_collapse m_border_collapse;
60 css_length m_css_border_spacing_x;
61 css_length m_css_border_spacing_y;
63 float m_flex_grow;
64 float m_flex_shrink;
65 css_length m_flex_basis;
66 flex_direction m_flex_direction;
67 flex_wrap m_flex_wrap;
68 flex_justify_content m_flex_justify_content;
69 flex_align_items m_flex_align_items;
70 flex_align_items m_flex_align_self;
71 flex_align_content m_flex_align_content;
73 caption_side m_caption_side;
75 int m_order;
77 private:
78 void compute_font(const element* el, const std::shared_ptr<document>& doc);
79 void compute_background(const element* el, const std::shared_ptr<document>& doc);
80 void compute_flex(const element* el, const std::shared_ptr<document>& doc);
82 public:
83 css_properties() :
84 m_el_position(element_position_static),
85 m_text_align(text_align_left),
86 m_overflow(overflow_visible),
87 m_white_space(white_space_normal),
88 m_display(display_inline),
89 m_visibility(visibility_visible),
90 m_box_sizing(box_sizing_content_box),
91 m_z_index(0),
92 m_vertical_align(va_baseline),
93 m_float(float_none),
94 m_clear(clear_none),
95 m_css_margins(),
96 m_css_padding(),
97 m_css_borders(),
98 m_css_width(),
99 m_css_height(),
100 m_css_min_width(),
101 m_css_min_height(),
102 m_css_max_width(),
103 m_css_max_height(),
104 m_css_offsets(),
105 m_css_text_indent(),
106 m_css_line_height(0),
107 m_line_height(0),
108 m_list_style_type(list_style_type_none),
109 m_list_style_position(list_style_position_outside),
110 m_bg(),
111 m_font_size(0),
112 m_font(0),
113 m_font_metrics(),
114 m_text_transform(text_transform_none),
115 m_border_collapse(border_collapse_separate),
116 m_css_border_spacing_x(),
117 m_css_border_spacing_y(),
118 m_flex_grow(0),
119 m_flex_shrink(1),
120 m_flex_direction(flex_direction_row),
121 m_flex_wrap(flex_wrap_nowrap),
122 m_flex_justify_content(flex_justify_content_flex_start),
123 m_flex_align_items(flex_align_items_stretch),
124 m_flex_align_self(flex_align_items_auto),
125 m_flex_align_content(flex_align_content_stretch),
126 m_order(0)
129 void compute(const element* el, const std::shared_ptr<document>& doc);
130 std::vector<std::tuple<string, string>> dump_get_attrs();
132 element_position get_position() const;
133 void set_position(element_position mElPosition);
135 text_align get_text_align() const;
136 void set_text_align(text_align mTextAlign);
138 overflow get_overflow() const;
139 void set_overflow(overflow mOverflow);
141 white_space get_white_space() const;
142 void set_white_space(white_space mWhiteSpace);
144 style_display get_display() const;
145 void set_display(style_display mDisplay);
147 visibility get_visibility() const;
148 void set_visibility(visibility mVisibility);
150 box_sizing get_box_sizing() const;
151 void set_box_sizing(box_sizing mBoxSizing);
153 int get_z_index() const;
154 void set_z_index(int mZIndex);
156 vertical_align get_vertical_align() const;
157 void set_vertical_align(vertical_align mVerticalAlign);
159 element_float get_float() const;
160 void set_float(element_float mFloat);
162 element_clear get_clear() const;
163 void set_clear(element_clear mClear);
165 const css_margins &get_margins() const;
166 void set_margins(const css_margins &mCssMargins);
168 const css_margins &get_padding() const;
169 void set_padding(const css_margins &mCssPadding);
171 const css_borders &get_borders() const;
172 void set_borders(const css_borders &mCssBorders);
174 const css_length &get_width() const;
175 void set_width(const css_length &mCssWidth);
177 const css_length &get_height() const;
178 void set_height(const css_length &mCssHeight);
180 const css_length &get_min_width() const;
181 void set_min_width(const css_length &mCssMinWidth);
183 const css_length &get_min_height() const;
184 void set_min_height(const css_length &mCssMinHeight);
186 const css_length &get_max_width() const;
187 void set_max_width(const css_length &mCssMaxWidth);
189 const css_length &get_max_height() const;
190 void set_max_height(const css_length &mCssMaxHeight);
192 const css_offsets &get_offsets() const;
193 void set_offsets(const css_offsets &mCssOffsets);
195 const css_length &get_text_indent() const;
196 void set_text_indent(const css_length &mCssTextIndent);
198 int get_line_height() const;
199 void set_line_height(int mLineHeight);
201 list_style_type get_list_style_type() const;
202 void set_list_style_type(list_style_type mListStyleType);
204 list_style_position get_list_style_position() const;
205 void set_list_style_position(list_style_position mListStylePosition);
207 string get_list_style_image() const;
208 void set_list_style_image(const string& url);
210 string get_list_style_image_baseurl() const;
211 void set_list_style_image_baseurl(const string& url);
213 const background &get_bg() const;
214 void set_bg(const background &mBg);
216 int get_font_size() const;
217 void set_font_size(int mFontSize);
219 uint_ptr get_font() const;
220 void set_font(uint_ptr mFont);
222 const font_metrics& get_font_metrics() const;
223 void set_font_metrics(const font_metrics& mFontMetrics);
225 text_transform get_text_transform() const;
226 void set_text_transform(text_transform mTextTransform);
228 web_color get_color() const;
229 void set_color(web_color color);
231 string get_cursor() const;
232 void set_cursor(const string& cursor);
234 string get_content() const;
235 void set_content(const string& content);
237 border_collapse get_border_collapse() const;
238 void set_border_collapse(border_collapse mBorderCollapse);
240 const css_length& get_border_spacing_x() const ;
241 void set_border_spacing_x(const css_length& mBorderSpacingX);
243 const css_length& get_border_spacing_y() const;
244 void set_border_spacing_y(const css_length& mBorderSpacingY);
246 caption_side get_caption_side() const;
247 void set_caption_side(caption_side side);
249 float get_flex_grow() const;
250 float get_flex_shrink() const;
251 const css_length& get_flex_basis() const;
252 flex_direction get_flex_direction() const;
253 flex_wrap get_flex_wrap() const;
254 flex_justify_content get_flex_justify_content() const;
255 flex_align_items get_flex_align_items() const;
256 flex_align_items get_flex_align_self() const;
257 flex_align_content get_flex_align_content() const;
259 int get_order() const;
260 void set_order(int order);
263 inline element_position css_properties::get_position() const
265 return m_el_position;
268 inline void css_properties::set_position(element_position mElPosition)
270 m_el_position = mElPosition;
273 inline text_align css_properties::get_text_align() const
275 return m_text_align;
278 inline void css_properties::set_text_align(text_align mTextAlign)
280 m_text_align = mTextAlign;
283 inline overflow css_properties::get_overflow() const
285 return m_overflow;
288 inline void css_properties::set_overflow(overflow mOverflow)
290 m_overflow = mOverflow;
293 inline white_space css_properties::get_white_space() const
295 return m_white_space;
298 inline void css_properties::set_white_space(white_space mWhiteSpace)
300 m_white_space = mWhiteSpace;
303 inline style_display css_properties::get_display() const
305 return m_display;
308 inline void css_properties::set_display(style_display mDisplay)
310 m_display = mDisplay;
313 inline visibility css_properties::get_visibility() const
315 return m_visibility;
318 inline void css_properties::set_visibility(visibility mVisibility)
320 m_visibility = mVisibility;
323 inline box_sizing css_properties::get_box_sizing() const
325 return m_box_sizing;
328 inline void css_properties::set_box_sizing(box_sizing mBoxSizing)
330 m_box_sizing = mBoxSizing;
333 inline int css_properties::get_z_index() const
335 return (int)m_z_index.val();
338 inline void css_properties::set_z_index(int mZIndex)
340 m_z_index.set_value((float)mZIndex, css_units_none);
343 inline vertical_align css_properties::get_vertical_align() const
345 return m_vertical_align;
348 inline void css_properties::set_vertical_align(vertical_align mVerticalAlign)
350 m_vertical_align = mVerticalAlign;
353 inline element_float css_properties::get_float() const
355 return m_float;
358 inline void css_properties::set_float(element_float mFloat)
360 m_float = mFloat;
363 inline element_clear css_properties::get_clear() const
365 return m_clear;
368 inline void css_properties::set_clear(element_clear mClear)
370 m_clear = mClear;
373 inline const css_margins &css_properties::get_margins() const
375 return m_css_margins;
378 inline void css_properties::set_margins(const css_margins &mCssMargins)
380 m_css_margins = mCssMargins;
383 inline const css_margins &css_properties::get_padding() const
385 return m_css_padding;
388 inline void css_properties::set_padding(const css_margins &mCssPadding)
390 m_css_padding = mCssPadding;
393 inline const css_borders &css_properties::get_borders() const
395 return m_css_borders;
398 inline void css_properties::set_borders(const css_borders &mCssBorders)
400 m_css_borders = mCssBorders;
403 inline const css_length &css_properties::get_width() const
405 return m_css_width;
408 inline void css_properties::set_width(const css_length &mCssWidth)
410 m_css_width = mCssWidth;
413 inline const css_length &css_properties::get_height() const
415 return m_css_height;
418 inline void css_properties::set_height(const css_length &mCssHeight)
420 m_css_height = mCssHeight;
423 inline const css_length &css_properties::get_min_width() const
425 return m_css_min_width;
428 inline void css_properties::set_min_width(const css_length &mCssMinWidth)
430 m_css_min_width = mCssMinWidth;
433 inline const css_length &css_properties::get_min_height() const
435 return m_css_min_height;
438 inline void css_properties::set_min_height(const css_length &mCssMinHeight)
440 m_css_min_height = mCssMinHeight;
443 inline const css_length &css_properties::get_max_width() const
445 return m_css_max_width;
448 inline void css_properties::set_max_width(const css_length &mCssMaxWidth)
450 m_css_max_width = mCssMaxWidth;
453 inline const css_length &css_properties::get_max_height() const
455 return m_css_max_height;
458 inline void css_properties::set_max_height(const css_length &mCssMaxHeight)
460 m_css_max_height = mCssMaxHeight;
463 inline const css_offsets &css_properties::get_offsets() const
465 return m_css_offsets;
468 inline void css_properties::set_offsets(const css_offsets &mCssOffsets)
470 m_css_offsets = mCssOffsets;
473 inline const css_length &css_properties::get_text_indent() const
475 return m_css_text_indent;
478 inline void css_properties::set_text_indent(const css_length &mCssTextIndent)
480 m_css_text_indent = mCssTextIndent;
483 inline int css_properties::get_line_height() const
485 return m_line_height;
488 inline void css_properties::set_line_height(int mLineHeight)
490 m_line_height = mLineHeight;
493 inline list_style_type css_properties::get_list_style_type() const
495 return m_list_style_type;
498 inline void css_properties::set_list_style_type(list_style_type mListStyleType)
500 m_list_style_type = mListStyleType;
503 inline list_style_position css_properties::get_list_style_position() const
505 return m_list_style_position;
508 inline void css_properties::set_list_style_position(list_style_position mListStylePosition)
510 m_list_style_position = mListStylePosition;
513 inline string css_properties::get_list_style_image() const { return m_list_style_image; }
514 inline void css_properties::set_list_style_image(const string& url) { m_list_style_image = url; }
516 inline string css_properties::get_list_style_image_baseurl() const { return m_list_style_image_baseurl; }
517 inline void css_properties::set_list_style_image_baseurl(const string& url) { m_list_style_image_baseurl = url; }
519 inline const background &css_properties::get_bg() const
521 return m_bg;
524 inline void css_properties::set_bg(const background &mBg)
526 m_bg = mBg;
529 inline int css_properties::get_font_size() const
531 return (int)m_font_size.val();
534 inline void css_properties::set_font_size(int mFontSize)
536 m_font_size = (float)mFontSize;
539 inline uint_ptr css_properties::get_font() const
541 return m_font;
544 inline void css_properties::set_font(uint_ptr mFont)
546 m_font = mFont;
549 inline const font_metrics& css_properties::get_font_metrics() const
551 return m_font_metrics;
554 inline void css_properties::set_font_metrics(const font_metrics& mFontMetrics)
556 m_font_metrics = mFontMetrics;
559 inline text_transform css_properties::get_text_transform() const
561 return m_text_transform;
564 inline void css_properties::set_text_transform(text_transform mTextTransform)
566 m_text_transform = mTextTransform;
569 inline web_color css_properties::get_color() const { return m_color; }
570 inline void css_properties::set_color(web_color color) { m_color = color; }
572 inline string css_properties::get_cursor() const { return m_cursor; }
573 inline void css_properties::set_cursor(const string& cursor) { m_cursor = cursor; }
575 inline string css_properties::get_content() const { return m_content; }
576 inline void css_properties::set_content(const string& content) { m_content = content; }
578 inline border_collapse css_properties::get_border_collapse() const
580 return m_border_collapse;
583 inline void css_properties::set_border_collapse(border_collapse mBorderCollapse)
585 m_border_collapse = mBorderCollapse;
588 inline const css_length& css_properties::get_border_spacing_x() const
590 return m_css_border_spacing_x;
593 inline void css_properties::set_border_spacing_x(const css_length& mBorderSpacingX)
595 m_css_border_spacing_x = mBorderSpacingX;
598 inline const css_length& css_properties::get_border_spacing_y() const
600 return m_css_border_spacing_y;
603 inline void css_properties::set_border_spacing_y(const css_length& mBorderSpacingY)
605 m_css_border_spacing_y = mBorderSpacingY;
608 inline float css_properties::get_flex_grow() const
610 return m_flex_grow;
613 inline float css_properties::get_flex_shrink() const
615 return m_flex_shrink;
618 inline const css_length& css_properties::get_flex_basis() const
620 return m_flex_basis;
623 inline flex_direction css_properties::get_flex_direction() const
625 return m_flex_direction;
628 inline flex_wrap css_properties::get_flex_wrap() const
630 return m_flex_wrap;
633 inline flex_justify_content css_properties::get_flex_justify_content() const
635 return m_flex_justify_content;
638 inline flex_align_items css_properties::get_flex_align_items() const
640 return m_flex_align_items;
643 inline flex_align_items css_properties::get_flex_align_self() const
645 return m_flex_align_self;
648 inline flex_align_content css_properties::get_flex_align_content() const
650 return m_flex_align_content;
653 inline caption_side css_properties::get_caption_side() const
655 return m_caption_side;
657 inline void css_properties::set_caption_side(caption_side side)
659 m_caption_side = side;
662 inline int css_properties::get_order() const
664 return m_order;
667 inline void css_properties::set_order(int order)
669 m_order = order;
673 #endif //LITEHTML_CSS_PROPERTIES_H