LibreOffice Module sw (master)  1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CSS1Parser Class Reference

Parser of a style element/option. More...

#include <parcss1.hxx>

Inheritance diagram for CSS1Parser:
[legend]
Collaboration diagram for CSS1Parser:
[legend]

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< CSS1SelectorParseSelector ()
 
std::unique_ptr< CSS1ExpressionParseDeclaration (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
 

Detailed Description

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 179 of file parcss1.hxx.

Constructor & Destructor Documentation

CSS1Parser::CSS1Parser ( )

Definition at line 1107 of file parcss1.cxx.

CSS1Parser::~CSS1Parser ( )
virtual

Definition at line 1120 of file parcss1.cxx.

Member Function Documentation

void CSS1Parser::DeclarationParsed ( const OUString &  rProperty,
std::unique_ptr< CSS1Expression pExpr 
)
protectedvirtual

Called after a declaration or property was parsed.

Parameters
rPropertyThe declaration/property
pExpr???

Reimplemented in SvxCSS1Parser.

Definition at line 1199 of file parcss1.cxx.

Referenced by ParseRule(), and ParseStyleOption().

sal_Unicode CSS1Parser::GetNextChar ( )
private
Returns
the next character to parse

Definition at line 75 of file parcss1.cxx.

References m_aIn, m_bEOF, m_nInPos, m_nlLineNr, and m_nlLinePos.

Referenced by GetNextToken(), and InitRead().

CSS1Token CSS1Parser::GetNextToken ( )
private
void CSS1Parser::InitRead ( const OUString &  rIn)
private
bool CSS1Parser::IsEOF ( ) const
inlineprivate

Definition at line 211 of file parcss1.hxx.

References m_bEOF.

Referenced by GetNextToken().

bool CSS1Parser::IsParserWorking ( ) const
inlineprivate

Is the parser still working?

Definition at line 209 of file parcss1.hxx.

References CSS1_PAR_WORKING, and m_eState.

Referenced by GetNextToken(), ParseDeclaration(), ParseRule(), ParseSelector(), ParseStyleOption(), and ParseStyleSheet().

std::unique_ptr< CSS1Expression > CSS1Parser::ParseDeclaration ( OUString &  rProperty)
private
void CSS1Parser::ParseRule ( )
private
std::unique_ptr< CSS1Selector > CSS1Parser::ParseSelector ( )
private
void CSS1Parser::ParseStyleOption ( const OUString &  rIn)
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.

Parameters
rInthe style option as string
Returns
true if ???

Definition at line 1154 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().

void CSS1Parser::ParseStyleSheet ( )
protected
void CSS1Parser::ParseStyleSheet ( const OUString &  rIn)
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

Parameters
rInthe style element as string

Definition at line 1124 of file parcss1.cxx.

References InitRead(), and ParseStyleSheet().

void CSS1Parser::SelectorParsed ( std::unique_ptr< CSS1Selector pSelector,
bool  bFirst 
)
protectedvirtual

Called after a selector was parsed.

Parameters
pSelectorThe selector that was parsed
bFirstif true, a new declaration starts with this selector

Reimplemented in SvxCSS1Parser.

Definition at line 1195 of file parcss1.cxx.

Referenced by ParseRule().

Member Data Documentation

OUString CSS1Parser::m_aIn
private

Definition at line 196 of file parcss1.hxx.

Referenced by GetNextChar(), and InitRead().

OUString CSS1Parser::m_aToken
private

Definition at line 197 of file parcss1.hxx.

Referenced by GetNextToken(), ParseDeclaration(), and ParseSelector().

bool CSS1Parser::m_bEOF
private

Definition at line 182 of file parcss1.hxx.

Referenced by GetNextChar(), GetNextToken(), InitRead(), and IsEOF().

bool CSS1Parser::m_bWhiteSpace
private

Definition at line 181 of file parcss1.hxx.

Referenced by GetNextToken(), and InitRead().

sal_Unicode CSS1Parser::m_cNextCh
private

Definition at line 184 of file parcss1.hxx.

Referenced by GetNextToken(), and InitRead().

CSS1ParserState CSS1Parser::m_eState
private

Definition at line 193 of file parcss1.hxx.

Referenced by GetNextToken(), InitRead(), and IsParserWorking().

sal_Int32 CSS1Parser::m_nInPos
private

Definition at line 186 of file parcss1.hxx.

Referenced by GetNextChar(), GetNextToken(), and InitRead().

sal_uInt32 CSS1Parser::m_nlLineNr
private

Definition at line 188 of file parcss1.hxx.

Referenced by GetNextChar(), GetNextToken(), and InitRead().

sal_uInt32 CSS1Parser::m_nlLinePos
private

Definition at line 189 of file parcss1.hxx.

Referenced by GetNextChar(), GetNextToken(), and InitRead().

CSS1Token CSS1Parser::m_nToken
private
double CSS1Parser::m_nValue
private

Definition at line 191 of file parcss1.hxx.

Referenced by GetNextToken(), InitRead(), and ParseDeclaration().


The documentation for this class was generated from the following files: