xref: /reactos/dll/win32/mshtml/htmlstyle.h (revision c2c66aff)
1 /*
2  * Copyright 2008 Jacek Caban for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #pragma once
20 
21 struct HTMLStyle {
22     DispatchEx dispex;
23     IHTMLStyle  IHTMLStyle_iface;
24     IHTMLStyle2 IHTMLStyle2_iface;
25     IHTMLStyle3 IHTMLStyle3_iface;
26     IHTMLStyle4 IHTMLStyle4_iface;
27     IHTMLStyle5 IHTMLStyle5_iface;
28     IHTMLStyle6 IHTMLStyle6_iface;
29 
30     LONG ref;
31 
32     nsIDOMCSSStyleDeclaration *nsstyle;
33     HTMLElement *elem;
34 };
35 
36 /* NOTE: Make sure to keep in sync with style_tbl in htmlstyle.c */
37 typedef enum {
38     STYLEID_BACKGROUND,
39     STYLEID_BACKGROUND_ATTACHMENT,
40     STYLEID_BACKGROUND_COLOR,
41     STYLEID_BACKGROUND_IMAGE,
42     STYLEID_BACKGROUND_POSITION,
43     STYLEID_BACKGROUND_POSITION_X,
44     STYLEID_BACKGROUND_POSITION_Y,
45     STYLEID_BACKGROUND_REPEAT,
46     STYLEID_BORDER,
47     STYLEID_BORDER_BOTTOM,
48     STYLEID_BORDER_BOTTOM_COLOR,
49     STYLEID_BORDER_BOTTOM_STYLE,
50     STYLEID_BORDER_BOTTOM_WIDTH,
51     STYLEID_BORDER_COLOR,
52     STYLEID_BORDER_LEFT,
53     STYLEID_BORDER_LEFT_COLOR,
54     STYLEID_BORDER_LEFT_STYLE,
55     STYLEID_BORDER_LEFT_WIDTH,
56     STYLEID_BORDER_RIGHT,
57     STYLEID_BORDER_RIGHT_COLOR,
58     STYLEID_BORDER_RIGHT_STYLE,
59     STYLEID_BORDER_RIGHT_WIDTH,
60     STYLEID_BORDER_STYLE,
61     STYLEID_BORDER_TOP,
62     STYLEID_BORDER_TOP_COLOR,
63     STYLEID_BORDER_TOP_STYLE,
64     STYLEID_BORDER_TOP_WIDTH,
65     STYLEID_BORDER_WIDTH,
66     STYLEID_BOTTOM,
67     STYLEID_BOX_SIZING,
68     STYLEID_CLEAR,
69     STYLEID_CLIP,
70     STYLEID_COLOR,
71     STYLEID_CURSOR,
72     STYLEID_DIRECTION,
73     STYLEID_DISPLAY,
74     STYLEID_FILTER,
75     STYLEID_FLOAT,
76     STYLEID_FONT_FAMILY,
77     STYLEID_FONT_SIZE,
78     STYLEID_FONT_STYLE,
79     STYLEID_FONT_VARIANT,
80     STYLEID_FONT_WEIGHT,
81     STYLEID_HEIGHT,
82     STYLEID_LEFT,
83     STYLEID_LETTER_SPACING,
84     STYLEID_LINE_HEIGHT,
85     STYLEID_LIST_STYLE,
86     STYLEID_LISTSTYLEPOSITION,
87     STYLEID_LISTSTYLETYPE,
88     STYLEID_MARGIN,
89     STYLEID_MARGIN_BOTTOM,
90     STYLEID_MARGIN_LEFT,
91     STYLEID_MARGIN_RIGHT,
92     STYLEID_MARGIN_TOP,
93     STYLEID_MAX_HEIGHT,
94     STYLEID_MAX_WIDTH,
95     STYLEID_MIN_HEIGHT,
96     STYLEID_MIN_WIDTH,
97     STYLEID_OUTLINE,
98     STYLEID_OVERFLOW,
99     STYLEID_OVERFLOW_X,
100     STYLEID_OVERFLOW_Y,
101     STYLEID_PADDING,
102     STYLEID_PADDING_BOTTOM,
103     STYLEID_PADDING_LEFT,
104     STYLEID_PADDING_RIGHT,
105     STYLEID_PADDING_TOP,
106     STYLEID_PAGE_BREAK_AFTER,
107     STYLEID_PAGE_BREAK_BEFORE,
108     STYLEID_POSITION,
109     STYLEID_RIGHT,
110     STYLEID_TABLE_LAYOUT,
111     STYLEID_TEXT_ALIGN,
112     STYLEID_TEXT_DECORATION,
113     STYLEID_TEXT_INDENT,
114     STYLEID_TEXT_TRANSFORM,
115     STYLEID_TOP,
116     STYLEID_VERTICAL_ALIGN,
117     STYLEID_VISIBILITY,
118     STYLEID_WHITE_SPACE,
119     STYLEID_WIDTH,
120     STYLEID_WORD_SPACING,
121     STYLEID_WORD_WRAP,
122     STYLEID_Z_INDEX,
123     STYLEID_MAX_VALUE
124 } styleid_t;
125 
126 HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**) DECLSPEC_HIDDEN;
127 void HTMLStyle2_Init(HTMLStyle*) DECLSPEC_HIDDEN;
128 void HTMLStyle3_Init(HTMLStyle*) DECLSPEC_HIDDEN;
129 
130 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,BSTR*,DWORD) DECLSPEC_HIDDEN;
131 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,LPCWSTR,DWORD) DECLSPEC_HIDDEN;
132 
133 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) DECLSPEC_HIDDEN;
134 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) DECLSPEC_HIDDEN;
135 
136 HRESULT get_elem_style(HTMLElement*,styleid_t,BSTR*) DECLSPEC_HIDDEN;
137 HRESULT set_elem_style(HTMLElement*,styleid_t,const WCHAR*) DECLSPEC_HIDDEN;
138 
139 #define ATTR_FIX_PX         0x0001
140 #define ATTR_FIX_URL        0x0002
141 #define ATTR_STR_TO_INT     0x0004
142 #define ATTR_HEX_INT        0x0008
143 #define ATTR_REMOVE_COMMA   0x0010
144 #define ATTR_NO_NULL        0x0020
145