htmlstyle.h 4.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright 2008 Jacek Caban for CodeWeavers
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

19
struct HTMLStyle {
20
    DispatchEx dispex;
21
    IHTMLStyle  IHTMLStyle_iface;
22
    IHTMLStyle2 IHTMLStyle2_iface;
23
    IHTMLStyle3 IHTMLStyle3_iface;
24
    IHTMLStyle4 IHTMLStyle4_iface;
25
    IHTMLStyle5 IHTMLStyle5_iface;
26
    IHTMLStyle6 IHTMLStyle6_iface;
27 28 29 30

    LONG ref;

    nsIDOMCSSStyleDeclaration *nsstyle;
31
    HTMLElement *elem;
32
};
33

34
/* NOTE: Make sure to keep in sync with style_tbl in htmlstyle.c */
35 36
typedef enum {
    STYLEID_BACKGROUND,
37
    STYLEID_BACKGROUND_ATTACHMENT,
38 39
    STYLEID_BACKGROUND_COLOR,
    STYLEID_BACKGROUND_IMAGE,
40
    STYLEID_BACKGROUND_POSITION,
41
    STYLEID_BACKGROUND_POSITION_X,
42
    STYLEID_BACKGROUND_POSITION_Y,
43
    STYLEID_BACKGROUND_REPEAT,
44
    STYLEID_BORDER,
45
    STYLEID_BORDER_BOTTOM,
46
    STYLEID_BORDER_BOTTOM_COLOR,
47
    STYLEID_BORDER_BOTTOM_STYLE,
48
    STYLEID_BORDER_BOTTOM_WIDTH,
49
    STYLEID_BORDER_COLOR,
50
    STYLEID_BORDER_LEFT,
51
    STYLEID_BORDER_LEFT_COLOR,
52
    STYLEID_BORDER_LEFT_STYLE,
53
    STYLEID_BORDER_LEFT_WIDTH,
54
    STYLEID_BORDER_RIGHT,
55
    STYLEID_BORDER_RIGHT_COLOR,
56
    STYLEID_BORDER_RIGHT_STYLE,
57
    STYLEID_BORDER_RIGHT_WIDTH,
58
    STYLEID_BORDER_STYLE,
59
    STYLEID_BORDER_TOP,
60
    STYLEID_BORDER_TOP_COLOR,
61
    STYLEID_BORDER_TOP_STYLE,
62
    STYLEID_BORDER_TOP_WIDTH,
63
    STYLEID_BORDER_WIDTH,
64
    STYLEID_BOTTOM,
65
    STYLEID_BOX_SIZING,
66
    STYLEID_CLEAR,
67
    STYLEID_CLIP,
68
    STYLEID_COLOR,
69
    STYLEID_CURSOR,
70
    STYLEID_DIRECTION,
71
    STYLEID_DISPLAY,
72
    STYLEID_FILTER,
73
    STYLEID_FLOAT,
74 75 76
    STYLEID_FONT_FAMILY,
    STYLEID_FONT_SIZE,
    STYLEID_FONT_STYLE,
77
    STYLEID_FONT_VARIANT,
78
    STYLEID_FONT_WEIGHT,
79
    STYLEID_HEIGHT,
80
    STYLEID_LEFT,
81
    STYLEID_LETTER_SPACING,
82
    STYLEID_LINE_HEIGHT,
83
    STYLEID_LIST_STYLE,
84
    STYLEID_LISTSTYLEPOSITION,
85
    STYLEID_LISTSTYLETYPE,
86
    STYLEID_MARGIN,
87
    STYLEID_MARGIN_BOTTOM,
88 89
    STYLEID_MARGIN_LEFT,
    STYLEID_MARGIN_RIGHT,
90
    STYLEID_MARGIN_TOP,
91
    STYLEID_MAX_HEIGHT,
92
    STYLEID_MAX_WIDTH,
93
    STYLEID_MIN_HEIGHT,
94
    STYLEID_MIN_WIDTH,
95
    STYLEID_OUTLINE,
96
    STYLEID_OVERFLOW,
97
    STYLEID_OVERFLOW_X,
98
    STYLEID_OVERFLOW_Y,
99
    STYLEID_PADDING,
100
    STYLEID_PADDING_BOTTOM,
101
    STYLEID_PADDING_LEFT,
102
    STYLEID_PADDING_RIGHT,
103
    STYLEID_PADDING_TOP,
104
    STYLEID_PAGE_BREAK_AFTER,
105
    STYLEID_PAGE_BREAK_BEFORE,
106
    STYLEID_POSITION,
107
    STYLEID_RIGHT,
108
    STYLEID_TABLE_LAYOUT,
109
    STYLEID_TEXT_ALIGN,
110
    STYLEID_TEXT_DECORATION,
111
    STYLEID_TEXT_INDENT,
112
    STYLEID_TEXT_TRANSFORM,
113
    STYLEID_TOP,
114
    STYLEID_VERTICAL_ALIGN,
115
    STYLEID_VISIBILITY,
116
    STYLEID_WHITE_SPACE,
117
    STYLEID_WIDTH,
118
    STYLEID_WORD_SPACING,
119
    STYLEID_WORD_WRAP,
120 121
    STYLEID_Z_INDEX,
    STYLEID_MAX_VALUE
122 123
} styleid_t;

124
HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**) DECLSPEC_HIDDEN;
125 126
void HTMLStyle2_Init(HTMLStyle*) DECLSPEC_HIDDEN;
void HTMLStyle3_Init(HTMLStyle*) DECLSPEC_HIDDEN;
127

128
HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,BSTR*,DWORD) DECLSPEC_HIDDEN;
129
HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,LPCWSTR,DWORD) DECLSPEC_HIDDEN;
130

131 132
HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) DECLSPEC_HIDDEN;
HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) DECLSPEC_HIDDEN;
133

134 135 136
HRESULT get_elem_style(HTMLElement*,styleid_t,BSTR*) DECLSPEC_HIDDEN;
HRESULT set_elem_style(HTMLElement*,styleid_t,const WCHAR*) DECLSPEC_HIDDEN;

137 138 139 140 141
#define ATTR_FIX_PX         0x0001
#define ATTR_FIX_URL        0x0002
#define ATTR_STR_TO_INT     0x0004
#define ATTR_HEX_INT        0x0008
#define ATTR_REMOVE_COMMA   0x0010
142
#define ATTR_NO_NULL        0x0020