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]

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

Constructor & Destructor Documentation

◆ CSS1Parser()

CSS1Parser::CSS1Parser ( )

Definition at line 1126 of file parcss1.cxx.

◆ ~CSS1Parser()

CSS1Parser::~CSS1Parser ( )
virtual

Definition at line 1139 of file parcss1.cxx.

Member Function Documentation

◆ DeclarationParsed()

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 1218 of file parcss1.cxx.

Referenced by ParseRule(), and ParseStyleOption().

◆ GetNextChar()

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

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().

◆ GetNextToken()

CSS1Token CSS1Parser::GetNextToken ( )
private

◆ InitRead()

void CSS1Parser::InitRead ( const OUString &  rIn)
private

◆ IsEOF()

bool CSS1Parser::IsEOF ( ) const
inlineprivate

Definition at line 213 of file parcss1.hxx.

References m_bEOF.

Referenced by GetNextToken().

◆ IsParserWorking()

bool CSS1Parser::IsParserWorking ( ) const
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().

◆ ParseDeclaration()

std::unique_ptr< CSS1Expression > CSS1Parser::ParseDeclaration ( OUString &  rProperty)
private

◆ ParseRule()

void CSS1Parser::ParseRule ( )
private

◆ ParseSelector()

std::unique_ptr< CSS1Selector > CSS1Parser::ParseSelector ( )
private

◆ ParseStyleOption()

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 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().

◆ ParseStyleSheet() [1/2]

void CSS1Parser::ParseStyleSheet ( )
protected

◆ ParseStyleSheet() [2/2]

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 1143 of file parcss1.cxx.

References InitRead(), and ParseStyleSheet().

◆ SelectorParsed()

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 1214 of file parcss1.cxx.

Referenced by ParseRule().

Member Data Documentation

◆ m_aIn

OUString CSS1Parser::m_aIn
private

Definition at line 198 of file parcss1.hxx.

Referenced by GetNextChar(), and InitRead().

◆ m_aToken

OUString CSS1Parser::m_aToken
private

Definition at line 199 of file parcss1.hxx.

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

◆ m_bEOF

bool CSS1Parser::m_bEOF
private

Definition at line 184 of file parcss1.hxx.

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

◆ m_bWhiteSpace

bool CSS1Parser::m_bWhiteSpace
private

Definition at line 183 of file parcss1.hxx.

Referenced by GetNextToken(), InitRead(), and SvxCSS1Parser::ParseStyleSheet().

◆ m_cNextCh

sal_Unicode CSS1Parser::m_cNextCh
private

◆ m_eState

CSS1ParserState CSS1Parser::m_eState
private

Definition at line 195 of file parcss1.hxx.

Referenced by InitRead(), and IsParserWorking().

◆ m_nInPos

sal_Int32 CSS1Parser::m_nInPos
private

Definition at line 188 of file parcss1.hxx.

Referenced by GetNextChar(), and InitRead().

◆ m_nlLineNr

sal_uInt32 CSS1Parser::m_nlLineNr
private

Definition at line 190 of file parcss1.hxx.

Referenced by GetNextChar(), and InitRead().

◆ m_nlLinePos

sal_uInt32 CSS1Parser::m_nlLinePos
private

Definition at line 191 of file parcss1.hxx.

Referenced by GetNextChar(), and InitRead().

◆ m_nToken

CSS1Token CSS1Parser::m_nToken
private

◆ m_nValue

double CSS1Parser::m_nValue
private

Definition at line 193 of file parcss1.hxx.

Referenced by InitRead(), and ParseDeclaration().


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