LibreOffice Module sw (master) 1
|
Parser of a style element/option. More...
#include <parcss1.hxx>
Public Member Functions | |
CSS1Parser () | |
virtual | ~CSS1Parser () |
Protected Member Functions | |
void | ParseStyleSheet () |
void | ParseStyleSheet (const OUString &rIn) |
parse the content of a HTML style element More... | |
void | ParseStyleOption (const OUString &rIn) |
parse the content of a HTML style option More... | |
virtual void | SelectorParsed (std::unique_ptr< CSS1Selector > pSelector, bool bFirst) |
Called after a selector was parsed. More... | |
virtual void | DeclarationParsed (const OUString &rProperty, std::unique_ptr< CSS1Expression > pExpr) |
Called after a declaration or property was parsed. More... | |
Private Member Functions | |
void | InitRead (const OUString &rIn) |
prepare parsing More... | |
sal_Unicode | GetNextChar () |
CSS1Token | GetNextToken () |
bool | IsParserWorking () const |
Is the parser still working? More... | |
bool | IsEOF () const |
void | ParseRule () |
std::unique_ptr< CSS1Selector > | ParseSelector () |
std::unique_ptr< CSS1Expression > | ParseDeclaration (OUString &rProperty) |
Private Attributes | |
bool | m_bWhiteSpace: 1 |
bool | m_bEOF: 1 |
sal_Unicode | m_cNextCh |
sal_Int32 | m_nInPos |
sal_uInt32 | m_nlLineNr |
sal_uInt32 | m_nlLinePos |
double | m_nValue |
CSS1ParserState | m_eState |
CSS1Token | m_nToken |
OUString | m_aIn |
OUString | m_aToken |
Parser of a style element/option.
This class parses the content of a style element or a style option and preprocesses it.
The result of the parser is forwarded to derived parsers by the methods SelectorParsed() and DeclarationParsed(). Example: H1, H2 { font-weight: bold; text-align: right } | | | | | | | DeclP( 'text-align', 'right' ) | | DeclP( 'font-weight', 'bold' ) | SelP( 'H2', false ) SelP( 'H1', true )
Definition at line 181 of file parcss1.hxx.
CSS1Parser::CSS1Parser | ( | ) |
Definition at line 1126 of file parcss1.cxx.
|
virtual |
Definition at line 1139 of file parcss1.cxx.
|
protectedvirtual |
Called after a declaration or property was parsed.
rProperty | The declaration/property |
pExpr | ??? |
Reimplemented in SvxCSS1Parser.
Definition at line 1218 of file parcss1.cxx.
Referenced by ParseRule(), and ParseStyleOption().
|
private |
Definition at line 73 of file parcss1.cxx.
References m_aIn, m_bEOF, m_nInPos, m_nlLineNr, and m_nlLinePos.
Referenced by GetNextToken(), InitRead(), SvxCSS1Parser::ParseStyleOption(), and SvxCSS1Parser::ParseStyleSheet().
|
private |
Definition at line 103 of file parcss1.cxx.
References CSS1_IMPORT_SYM, CSS1_NULL, CSS1_PAGE_SYM, CSS1_SLASH, GetNextChar(), IsEOF(), m_aToken, m_bWhiteSpace, and m_cNextCh.
Referenced by InitRead(), ParseDeclaration(), ParseRule(), ParseSelector(), ParseStyleOption(), and ParseStyleSheet().
|
private |
prepare parsing
Definition at line 57 of file parcss1.cxx.
References CSS1_PAR_WORKING, GetNextChar(), GetNextToken(), m_aIn, m_bEOF, m_bWhiteSpace, m_cNextCh, m_eState, m_nInPos, m_nlLineNr, m_nlLinePos, m_nToken, and m_nValue.
Referenced by ParseStyleOption(), and ParseStyleSheet().
|
inlineprivate |
|
inlineprivate |
Is the parser still working?
Definition at line 211 of file parcss1.hxx.
References CSS1_PAR_WORKING, and m_eState.
Referenced by ParseDeclaration(), ParseRule(), ParseSelector(), ParseStyleOption(), and ParseStyleSheet().
|
private |
Definition at line 1011 of file parcss1.cxx.
References CSS1_COLON, CSS1_COMMA, CSS1_EMS, CSS1_EMX, CSS1_HEXCOLOR, CSS1_IDENT, CSS1_IMPORTANT_SYM, CSS1_LENGTH, CSS1_MINUS, CSS1_NUMBER, CSS1_PERCENTAGE, CSS1_PIXLENGTH, CSS1_PLUS, CSS1_RGB, CSS1_SLASH, CSS1_STRING, CSS1_URL, GetNextToken(), IsParserWorking(), LOOP_CHECK_CHECK, LOOP_CHECK_DECL, m_aToken, m_nToken, m_nValue, and CSS1Expression::SetNext().
Referenced by ParseRule(), and ParseStyleOption().
|
private |
Definition at line 752 of file parcss1.cxx.
References CSS1_CBRACE, CSS1_COMMA, CSS1_IDENT, CSS1_OBRACE, CSS1_SEMICOLON, DeclarationParsed(), GetNextToken(), IsParserWorking(), LOOP_CHECK_CHECK, LOOP_CHECK_DECL, LOOP_CHECK_RESTART, m_nToken, ParseDeclaration(), ParseSelector(), and SelectorParsed().
Referenced by ParseStyleSheet().
|
private |
Definition at line 842 of file parcss1.cxx.
References CSS1_COLON, CSS1_DOT_W_WS, CSS1_DOT_WO_WS, CSS1_HASH, CSS1_IDENT, CSS1_PAGE_SYM, CSS1_SELTYPE_CLASS, CSS1_SELTYPE_ELEM_CLASS, CSS1_SELTYPE_ELEMENT, CSS1_SELTYPE_ID, CSS1_SELTYPE_PAGE, CSS1_SELTYPE_PSEUDO, eType, GetNextToken(), IsParserWorking(), LOOP_CHECK_CHECK, LOOP_CHECK_DECL, m_aToken, m_nToken, and CSS1Selector::SetNext().
Referenced by ParseRule().
|
protected |
parse the content of a HTML style option
For each selector and each declaration the methods SelectorParsed() or DeclarationParsed() need to be called afterwards.
rIn | the style option as string |
Definition at line 1173 of file parcss1.cxx.
References CSS1_IDENT, CSS1_SEMICOLON, DeclarationParsed(), GetNextToken(), InitRead(), IsParserWorking(), LOOP_CHECK_CHECK, LOOP_CHECK_DECL, m_nToken, and ParseDeclaration().
Referenced by SvxCSS1Parser::ParseStyleOption().
|
protected |
Definition at line 691 of file parcss1.cxx.
References CSS1_DOT_W_WS, CSS1_HASH, CSS1_IDENT, CSS1_IMPORT_SYM, CSS1_PAGE_SYM, GetNextToken(), IsParserWorking(), LOOP_CHECK_CHECK, LOOP_CHECK_DECL, LOOP_CHECK_RESTART, m_nToken, and ParseRule().
Referenced by ParseStyleSheet(), and SvxCSS1Parser::ParseStyleSheet().
|
protected |
parse the content of a HTML style element
For each selector and each declaration the methods SelectorParsed() or DeclarationParsed() need to be called afterwards
rIn | the style element as string |
Definition at line 1143 of file parcss1.cxx.
References InitRead(), and ParseStyleSheet().
|
protectedvirtual |
Called after a selector was parsed.
pSelector | The selector that was parsed |
bFirst | if true, a new declaration starts with this selector |
Reimplemented in SvxCSS1Parser.
Definition at line 1214 of file parcss1.cxx.
Referenced by ParseRule().
|
private |
Definition at line 198 of file parcss1.hxx.
Referenced by GetNextChar(), and InitRead().
|
private |
Definition at line 199 of file parcss1.hxx.
Referenced by GetNextToken(), ParseDeclaration(), and ParseSelector().
|
private |
Definition at line 184 of file parcss1.hxx.
Referenced by GetNextChar(), InitRead(), and IsEOF().
|
private |
Definition at line 183 of file parcss1.hxx.
Referenced by GetNextToken(), InitRead(), and SvxCSS1Parser::ParseStyleSheet().
|
private |
Definition at line 186 of file parcss1.hxx.
Referenced by GetNextToken(), InitRead(), SvxCSS1Parser::ParseStyleOption(), and SvxCSS1Parser::ParseStyleSheet().
|
private |
Definition at line 195 of file parcss1.hxx.
Referenced by InitRead(), and IsParserWorking().
|
private |
Definition at line 188 of file parcss1.hxx.
Referenced by GetNextChar(), and InitRead().
|
private |
Definition at line 190 of file parcss1.hxx.
Referenced by GetNextChar(), and InitRead().
|
private |
Definition at line 191 of file parcss1.hxx.
Referenced by GetNextChar(), and InitRead().
|
private |
Definition at line 196 of file parcss1.hxx.
Referenced by InitRead(), ParseDeclaration(), ParseRule(), ParseSelector(), ParseStyleOption(), and ParseStyleSheet().
|
private |
Definition at line 193 of file parcss1.hxx.
Referenced by InitRead(), and ParseDeclaration().