1
#ifndef __CSSREADER_H__
2
#define __CSSREADER_H__
4
* Phoebe DOM Implementation.
6
* This is a C++ approximation of the W3C DOM model, which follows
7
* fairly closely the specifications in the various .idl files, copies of
8
* which are provided for reference. Most important is this one:
10
* http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
15
* Copyright (C) 2005-2008 Bob Jamison
17
* This library is free software; you can redistribute it and/or
18
* modify it under the terms of the GNU Lesser General Public
19
* License as published by the Free Software Foundation; either
20
* version 2.1 of the License, or (at your option) any later version.
22
* This library is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25
* Lesser General Public License for more details.
27
* You should have received a copy of the GNU Lesser General Public
28
* License along with this library; if not, write to the Free Software
29
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
66
virtual bool parse(const DOMString &str);
71
virtual bool parseFile(const DOMString &str);
78
CSSStyleSheet stylesheet;
84
void error(char const *fmt, ...)
91
* Get the character at the given location in the buffer.
92
* Return 0 if out-of-bounds
98
* Test if the given substring exists at the given position
99
* in parsebuf. Use get() in case of out-of-bounds
101
bool match(int pos, const char *str);
104
* Skip over whitespace
105
* Return new position
107
int skipwhite(int index);
110
* Get the word at the current position. Return the new
111
* position if successful, the current position if no word,
114
int getWord(int index, DOMString &str);
118
* Get a number at the current position
119
* Return the new position if a proper number, else the original pos
121
int getNumber(int index, double &result);
124
* Assume that we are starting on a quote. Ends on the char
125
* after the final '"'
127
int getQuoted(int p0, DOMString &result);
130
* Not in api. replaces URI return by lexer
132
int getUri(int p0, DOMString &str);
136
* Skip to the next rule
138
int skipBlock(int p0);
140
//#########################################################################
141
//# P R O D U C T I O N S
142
//#########################################################################
146
* : [ CHARSET_SYM S* STRING S* ';' ]?
147
* [S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
148
* [ [ ruleset | media | page ] [S|CDO|CDC]* ]*
151
int getStyleSheet(int p0);
156
* [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S*
159
int getImport(int p0);
163
* : MEDIA_SYM S* medium [ COMMA S* medium ]* LBRACE S* ruleset* '}' S*
166
int getMedia(int p0);
173
int getMedium(int p0);
177
* : PAGE_SYM S* pseudo_page? S*
178
* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
188
int getPseudoPage(int p0);
192
* : selector [ COMMA S* selector ]*
193
* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
196
int getRuleSet(int p0);
200
* : simple_selector [ combinator simple_selector ]*
203
int getSelector(int p0);
207
* : element_name [ HASH | class | attrib | pseudo ]*
208
* | [ HASH | class | attrib | pseudo ]+
211
int getSimpleSelector(int p0);
215
* : property ':' S* expr prio?
219
int getDeclaration(int p0, CSSStyleDeclaration &declarationList);
226
int getPrio(int p0, DOMString &val);
230
* : term [ operator term ]*
238
* [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
239
* TIME S* | FREQ S* | function ]
240
* | STRING S* | IDENT S* | URI S* | hexcolor
247
* : FUNCTION S* expr ')' S*
250
int getFunction(int p0);
253
* There is a constraint on the color that it must
254
* have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
255
* after the "#"; e.g., "#000" is OK, but "#abcd" is not.
261
int getHexColor(int p0);
267
* Get the column and row number of the given character position.
268
* Also gets the last-occuring newline before the position
270
void getColumnAndRow(int p, int &col, int &row, int &lastNL);
286
#endif /* __CSSREADER_H__ */
287
//#########################################################################
288
//# E N D O F F I L E
289
//#########################################################################