aboutsummaryrefslogtreecommitdiff
path: root/src/css.hh
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-10-28 16:54:26 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-10-28 16:54:26 +0100
commitfffb653ce6ab4689cb3c5aec18e980497e73ac6d (patch)
tree08d6c93395146d27c7defcc2e9aa9f7554d36578 /src/css.hh
parent54215bccc9abe648593e29b11878552be69fd835 (diff)
flesh out CssProperty
Diffstat (limited to 'src/css.hh')
-rw-r--r--src/css.hh139
1 files changed, 111 insertions, 28 deletions
diff --git a/src/css.hh b/src/css.hh
index a466527b..50e5ae88 100644
--- a/src/css.hh
+++ b/src/css.hh
@@ -3,44 +3,127 @@
#include "dw/core.hh"
-class CssProperties {
- private:
- dw::core::style::StyleAttrs attrs;
- bool fontValid;
- bool textDecorationValid;
- bool colorValid;
- bool backgroundColorValid;
- bool textAlignValid;
- bool valignValid;
- bool textAlignCharValid;
- bool hBorderSpacingValid;
- bool vBorderSpacingValid;
- bool widthValid;
- bool heightValid;
- bool marginValid;
- bool borderWidthValid;
- bool paddingValid;
- bool borderColorValid;
- bool borderStyleValid;
- bool displayValid;
- bool whiteSpaceValid;
- bool listStyleTypeValid;
- bool cursorValid;
-
+class CssProperty {
public:
- CssProperties ();
- ~CssProperties ();
+ typedef union {
+ int color;
+ dw::core::style::Length length;
+ dw::core::style::Cursor cursor;
+ dw::core::style::BorderStyle borderStyle;
+ dw::core::style::TextAlignType textAlignType;
+ dw::core::style::VAlignType valignType;
+ dw::core::style::DisplayType displayType;
+ dw::core::style::ListStyleType listStyleType;
+ dw::core::style::FontStyle fontStyle;
+ dw::core::style::TextDecoration textDecoration;
+ dw::core::style::WhiteSpace whiteSpace;
+ const char *name; /* used for font family */
+ } Value;
+
+ typedef enum {
+ BACKGROUND_ATTACHMENT,
+ BACKGROUND_COLOR,
+ BACKGROUND_IMAGE,
+ BACKGROUND_POSITION,
+ BACKGROUND_REPEAT,
+ BORDER_BOTTOM_COLOR,
+ BORDER_BOTTOM_STYLE,
+ BORDER_BOTTOM_WIDTH,
+ BORDER_COLLAPSE,
+ BORDER_LEFT_COLOR,
+ BORDER_LEFT_STYLE,
+ BORDER_LEFT_WIDTH,
+ BORDER_RIGHT_COLOR,
+ BORDER_RIGHT_STYLE,
+ BORDER_RIGHT_WIDTH,
+ BORDER_SPACING,
+ BORDER_TOP_COLOR,
+ BORDER_TOP_STYLE,
+ BORDER_TOP_WIDTH,
+ BOTTOM,
+ CAPTION_SIDE,
+ CLEAR,
+ CLIP,
+ COLOR,
+ CONTENT,
+ COUNTER_INCREMENT,
+ COUNTER_RESET,
+ CURSOR,
+ DIRECTION,
+ DISPLAY,
+ EMPTY_CELLS,
+ FLOAT,
+ FONT_FAMILY,
+ FONT_SIZE,
+ FONT_SIZE_ADJUST,
+ FONT_STRETCH,
+ FONT_STYLE,
+ FONT_VARIANT,
+ FONT_WEIGHT,
+ HEIGHT,
+ LEFT,
+ LETTER_SPACING,
+ LINE_HEIGHT,
+ LIST_STYLE_IMAGE,
+ LIST_STYLE_POSITION,
+ LIST_STYLE_TYPE,
+ MARGIN_BOTTOM,
+ MARGIN_LEFT,
+ MARGIN_RIGHT,
+ MARGIN_TOP,
+ MARKER_OFFSET,
+ MARKS,
+ MAX_HEIGHT,
+ MAX_WIDTH,
+ MIN_HEIGHT,
+ MIN_WIDTH,
+ OUTLINE_COLOR,
+ OUTLINE_STYLE,
+ OUTLINE_WIDTH,
+ OVERFLOW,
+ PADDING_BOTTOM,
+ PADDING_LEFT,
+ PADDING_RIGHT,
+ PADDING_TOP,
+ POSITION,
+ QUOTES,
+ RIGHT,
+ TEXT_ALIGN,
+ TEXT_DECORATION,
+ TEXT_SHADOW,
+ TEXT_TRANSFORM,
+ TOP,
+ UNICODE_BIDI,
+ VERTICAL_ALIGN,
+ VISIBILITY,
+ WHITE_SPACE,
+ TEXT_INDENT,
+ WIDTH,
+ WORD_SPACING,
+ Z_INDEX,
+ X_LINK,
+ X_COLSPAN,
+ X_ROWSPAN,
+ LAST
+ } Name;
- void apply (const CssProperties *p);
+ Name name;
+ Value value;
+ CssProperty ();
+ ~CssProperty ();
+
+ void apply (dw::core::style::StyleAttrs *styleAttr);
};
+typedef lout::container::typed::List <CssProperty> CssPropertyList;
+
class CssSelector {
};
class CssRule {
private:
- CssProperties props;
+ CssPropertyList props;
public:
CssRule ();