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

#include <svxcss1.hxx>

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

Public Member Functions

 SvxCSS1Parser (SfxItemPool &rPool, OUString aBaseURL, sal_uInt16 const *pWhichIds, sal_uInt16 nWhichIds)
 
virtual ~SvxCSS1Parser () override
 
bool IsIgnoreFontFamily () const
 
void SetIgnoreFontFamily (bool bSet)
 
virtual bool ParseStyleSheet (const OUString &rIn)
 
void ParseStyleOption (const OUString &rIn, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo)
 
virtual sal_uInt32 GetFontHeight (sal_uInt16 nSize) const
 
virtual const FontListGetFontList () const
 
const WhichRangesContainerGetWhichMap () const
 
void InsertId (const OUString &rId, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
 
const SvxCSS1MapEntryGetId (const OUString &rId) const
 
void InsertClass (const OUString &rClass, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
 
const SvxCSS1MapEntryGetClass (const OUString &rClass) const
 
void InsertPage (const OUString &rPage, bool bPseudo, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
 
SvxCSS1MapEntryGetPage (const OUString &rPage, bool bPseudo)
 
void InsertTag (const OUString &rTag, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp)
 
SvxCSS1MapEntryGetTag (const OUString &rTag)
 
virtual void SetDfltEncoding (rtl_TextEncoding eEnc)
 
rtl_TextEncoding GetDfltEncoding () const
 
const OUString & GetBaseURL () const
 
- Public Member Functions inherited from CSS1Parser
 CSS1Parser ()
 
virtual ~CSS1Parser ()
 

Static Public Member Functions

static bool GetEnum (const CSS1PropertyEnum *pPropTable, std::u16string_view rValue, sal_uInt16 &rEnum)
 
static void PixelToTwip (tools::Long &nWidth, tools::Long &nHeight)
 
static void InsertMapEntry (const OUString &rKey, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp, CSS1Map &rMap)
 
static void MergeStyles (const SfxItemSet &rSrcSet, const SvxCSS1PropertyInfo &rSrcInfo, SfxItemSet &rTargetSet, SvxCSS1PropertyInfo &rTargetInfo, bool bSmart)
 
static sal_uInt16 GetMinFixLineSpace ()
 

Protected Member Functions

virtual void StyleParsed (const CSS1Selector *pSelector, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo)
 
virtual void SelectorParsed (std::unique_ptr< CSS1Selector > pSelector, bool bFirst) override
 Will be called when a Selector is parsed. More...
 
virtual void DeclarationParsed (const OUString &rProperty, std::unique_ptr< CSS1Expression > pExpr) override
 Will be called for every parsed Property. More...
 
void ParseStyleSheet ()
 
void ParseStyleSheet (const OUString &rIn)
 parse the content of a HTML style element More...
 
- Protected Member Functions inherited from CSS1Parser
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 Types

typedef std::vector< std::unique_ptr< CSS1Selector > > CSS1Selectors
 
typedef std::map< OUString, std::unique_ptr< SvxCSS1MapEntry > > CSS1Map
 

Private Member Functions

void ParseStyleOption (const OUString &rIn)
 parse the content of a HTML style option More...
 

Private Attributes

CSS1Selectors m_Selectors
 
CSS1Map m_Ids
 
CSS1Map m_Classes
 
CSS1Map m_Pages
 
CSS1Map m_Tags
 
OUString m_sBaseURL
 
std::unique_ptr< SfxItemSetm_pSheetItemSet
 
SfxItemSetm_pItemSet
 
std::unique_ptr< SvxCSS1PropertyInfom_pSheetPropInfo
 
SvxCSS1PropertyInfom_pPropInfo
 
rtl_TextEncoding m_eDefaultEnc
 
bool m_bIgnoreFontFamily
 
WhichRangesContainer m_aWhichMap
 

Static Private Attributes

static constexpr sal_uInt16 gnMinFixLineSpace = o3tl::toTwips(25, o3tl::Length::mm10)
 

Detailed Description

Definition at line 188 of file svxcss1.hxx.

Member Typedef Documentation

◆ CSS1Map

typedef std::map<OUString, std::unique_ptr<SvxCSS1MapEntry> > SvxCSS1Parser::CSS1Map
private

Definition at line 191 of file svxcss1.hxx.

◆ CSS1Selectors

typedef std::vector<std::unique_ptr<CSS1Selector> > SvxCSS1Parser::CSS1Selectors
private

Definition at line 190 of file svxcss1.hxx.

Constructor & Destructor Documentation

◆ SvxCSS1Parser()

SvxCSS1Parser::SvxCSS1Parser ( SfxItemPool rPool,
OUString  aBaseURL,
sal_uInt16 const *  pWhichIds,
sal_uInt16  nWhichIds 
)

◆ ~SvxCSS1Parser()

SvxCSS1Parser::~SvxCSS1Parser ( )
overridevirtual

Definition at line 766 of file svxcss1.cxx.

References m_pSheetItemSet, and m_pSheetPropInfo.

Member Function Documentation

◆ DeclarationParsed()

void SvxCSS1Parser::DeclarationParsed ( const OUString &  rProperty,
std::unique_ptr< CSS1Expression pExpr 
)
overrideprotectedvirtual

Will be called for every parsed Property.

Adds the item to the pItemSet. Derived classes should not override this method!

Reimplemented from CSS1Parser.

Definition at line 3129 of file svxcss1.cxx.

References aCSS1PropFnTab, CSS1PropEntryFindCompare(), m_pItemSet, and m_pPropInfo.

◆ GetBaseURL()

const OUString & SvxCSS1Parser::GetBaseURL ( ) const
inline

Definition at line 307 of file svxcss1.hxx.

References m_sBaseURL.

Referenced by ParseCSS1_background().

◆ GetClass()

const SvxCSS1MapEntry * SvxCSS1Parser::GetClass ( const OUString &  rClass) const

Definition at line 792 of file svxcss1.cxx.

References m_Classes.

Referenced by SwCSS1Parser::GetChrFormat(), and SwCSS1Parser::GetTextFormatColl().

◆ GetDfltEncoding()

rtl_TextEncoding SvxCSS1Parser::GetDfltEncoding ( ) const
inline

◆ GetEnum()

bool SvxCSS1Parser::GetEnum ( const CSS1PropertyEnum pPropTable,
std::u16string_view  rValue,
sal_uInt16 &  rEnum 
)
static

◆ GetFontHeight()

sal_uInt32 SvxCSS1Parser::GetFontHeight ( sal_uInt16  nSize) const
virtual

Reimplemented in SwCSS1Parser.

Definition at line 899 of file svxcss1.cxx.

Referenced by ParseCSS1_font_size().

◆ GetFontList()

const FontList * SvxCSS1Parser::GetFontList ( ) const
virtual

Reimplemented in SwCSS1Parser.

Definition at line 918 of file svxcss1.cxx.

Referenced by ParseCSS1_font_family().

◆ GetId()

const SvxCSS1MapEntry * SvxCSS1Parser::GetId ( const OUString &  rId) const

Definition at line 779 of file svxcss1.cxx.

References m_Ids.

◆ GetMinFixLineSpace()

static sal_uInt16 SvxCSS1Parser::GetMinFixLineSpace ( )
inlinestatic

Definition at line 302 of file svxcss1.hxx.

References gnMinFixLineSpace.

Referenced by ParseCSS1_line_height().

◆ GetPage()

SvxCSS1MapEntry * SvxCSS1Parser::GetPage ( const OUString &  rPage,
bool  bPseudo 
)

Definition at line 809 of file svxcss1.cxx.

References m_Pages.

Referenced by SwCSS1Parser::ParseStyleSheet().

◆ GetTag()

SvxCSS1MapEntry * SvxCSS1Parser::GetTag ( const OUString &  rTag)

Definition at line 826 of file svxcss1.cxx.

References m_Tags.

Referenced by SwCSS1Parser::SetLinkCharFormats(), and SwCSS1Parser::SetTableTextColl().

◆ GetWhichMap()

const WhichRangesContainer & SvxCSS1Parser::GetWhichMap ( ) const
inline

Definition at line 270 of file svxcss1.hxx.

References m_aWhichMap.

◆ InsertClass()

void SvxCSS1Parser::InsertClass ( const OUString &  rClass,
const SfxItemSet rItemSet,
const SvxCSS1PropertyInfo rProp 
)

Definition at line 785 of file svxcss1.cxx.

References InsertMapEntry(), and m_Classes.

Referenced by SwCSS1Parser::StyleParsed().

◆ InsertId()

void SvxCSS1Parser::InsertId ( const OUString &  rId,
const SfxItemSet rItemSet,
const SvxCSS1PropertyInfo rProp 
)

Definition at line 772 of file svxcss1.cxx.

References InsertMapEntry(), and m_Ids.

Referenced by SwCSS1Parser::StyleParsed().

◆ InsertMapEntry()

void SvxCSS1Parser::InsertMapEntry ( const OUString &  rKey,
const SfxItemSet rItemSet,
const SvxCSS1PropertyInfo rProp,
CSS1Map rMap 
)
static

Definition at line 923 of file svxcss1.cxx.

References inserted(), MergeStyles(), and p.

Referenced by InsertClass(), InsertId(), InsertPage(), and InsertTag().

◆ InsertPage()

void SvxCSS1Parser::InsertPage ( const OUString &  rPage,
bool  bPseudo,
const SfxItemSet rItemSet,
const SvxCSS1PropertyInfo rProp 
)

Definition at line 798 of file svxcss1.cxx.

References InsertMapEntry(), and m_Pages.

Referenced by SwCSS1Parser::StyleParsed().

◆ InsertTag()

void SvxCSS1Parser::InsertTag ( const OUString &  rTag,
const SfxItemSet rItemSet,
const SvxCSS1PropertyInfo rProp 
)

Definition at line 819 of file svxcss1.cxx.

References InsertMapEntry(), and m_Tags.

Referenced by SwCSS1Parser::StyleParsed().

◆ IsIgnoreFontFamily()

bool SvxCSS1Parser::IsIgnoreFontFamily ( ) const
inline

Definition at line 248 of file svxcss1.hxx.

References m_bIgnoreFontFamily.

Referenced by ParseCSS1_font_family().

◆ MergeStyles()

void SvxCSS1Parser::MergeStyles ( const SfxItemSet rSrcSet,
const SvxCSS1PropertyInfo rSrcInfo,
SfxItemSet rTargetSet,
SvxCSS1PropertyInfo rTargetInfo,
bool  bSmart 
)
static

◆ ParseStyleOption() [1/2]

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

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

References CSS1Parser::GetNextChar(), and CSS1Parser::m_cNextCh.

◆ ParseStyleOption() [2/2]

void SvxCSS1Parser::ParseStyleOption ( const OUString &  rIn,
SfxItemSet rItemSet,
SvxCSS1PropertyInfo rPropInfo 
)

◆ ParseStyleSheet() [1/3]

void CSS1Parser::ParseStyleSheet ( )
protected

Definition at line 221 of file parcss1.cxx.

Referenced by SwCSS1Parser::ParseStyleSheet().

◆ ParseStyleSheet() [2/3]

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

References CSS1Parser::GetNextChar(), CSS1Parser::m_bWhiteSpace, and CSS1Parser::m_cNextCh.

◆ ParseStyleSheet() [3/3]

bool SvxCSS1Parser::ParseStyleSheet ( const OUString &  rIn)
virtual

◆ PixelToTwip()

void SvxCSS1Parser::PixelToTwip ( tools::Long nWidth,
tools::Long nHeight 
)
static

◆ SelectorParsed()

void SvxCSS1Parser::SelectorParsed ( std::unique_ptr< CSS1Selector pSelector,
bool  bFirst 
)
overrideprotectedvirtual

Will be called when a Selector is parsed.

If bFirst is true, the content of the aItemSet will be copied into all recently created Styles. Derived classes should not override this method!

Reimplemented from CSS1Parser.

Definition at line 683 of file svxcss1.cxx.

References m_pSheetItemSet, m_pSheetPropInfo, m_Selectors, and StyleParsed().

◆ SetDfltEncoding()

void SvxCSS1Parser::SetDfltEncoding ( rtl_TextEncoding  eEnc)
virtual

Reimplemented in SwCSS1Parser.

Definition at line 986 of file svxcss1.cxx.

References m_eDefaultEnc.

Referenced by SwCSS1Parser::SetDfltEncoding().

◆ SetIgnoreFontFamily()

void SvxCSS1Parser::SetIgnoreFontFamily ( bool  bSet)
inline

Definition at line 249 of file svxcss1.hxx.

References m_bIgnoreFontFamily.

◆ StyleParsed()

void SvxCSS1Parser::StyleParsed ( const CSS1Selector pSelector,
SfxItemSet rItemSet,
SvxCSS1PropertyInfo rPropInfo 
)
protectedvirtual

Reimplemented in SwCSS1Parser.

Definition at line 676 of file svxcss1.cxx.

Referenced by ParseStyleSheet(), and SelectorParsed().

Member Data Documentation

◆ gnMinFixLineSpace

constexpr sal_uInt16 SvxCSS1Parser::gnMinFixLineSpace = o3tl::toTwips(25, o3tl::Length::mm10)
staticconstexprprivate

Definition at line 208 of file svxcss1.hxx.

Referenced by GetMinFixLineSpace().

◆ m_aWhichMap

WhichRangesContainer SvxCSS1Parser::m_aWhichMap
private

Definition at line 212 of file svxcss1.hxx.

Referenced by GetWhichMap(), and SvxCSS1Parser().

◆ m_bIgnoreFontFamily

bool SvxCSS1Parser::m_bIgnoreFontFamily
private

Definition at line 211 of file svxcss1.hxx.

Referenced by IsIgnoreFontFamily(), and SetIgnoreFontFamily().

◆ m_Classes

CSS1Map SvxCSS1Parser::m_Classes
private

Definition at line 195 of file svxcss1.hxx.

Referenced by GetClass(), and InsertClass().

◆ m_eDefaultEnc

rtl_TextEncoding SvxCSS1Parser::m_eDefaultEnc
private

Definition at line 210 of file svxcss1.hxx.

Referenced by GetDfltEncoding(), and SetDfltEncoding().

◆ m_Ids

CSS1Map SvxCSS1Parser::m_Ids
private

Definition at line 194 of file svxcss1.hxx.

Referenced by GetId(), and InsertId().

◆ m_Pages

CSS1Map SvxCSS1Parser::m_Pages
private

Definition at line 196 of file svxcss1.hxx.

Referenced by GetPage(), and InsertPage().

◆ m_pItemSet

SfxItemSet* SvxCSS1Parser::m_pItemSet
private

Definition at line 202 of file svxcss1.hxx.

Referenced by DeclarationParsed(), ParseStyleOption(), and ParseStyleSheet().

◆ m_pPropInfo

SvxCSS1PropertyInfo* SvxCSS1Parser::m_pPropInfo
private

Definition at line 205 of file svxcss1.hxx.

Referenced by DeclarationParsed(), ParseStyleOption(), and ParseStyleSheet().

◆ m_pSheetItemSet

std::unique_ptr<SfxItemSet> SvxCSS1Parser::m_pSheetItemSet
private

Definition at line 201 of file svxcss1.hxx.

Referenced by ParseStyleSheet(), SelectorParsed(), SvxCSS1Parser(), and ~SvxCSS1Parser().

◆ m_pSheetPropInfo

std::unique_ptr<SvxCSS1PropertyInfo> SvxCSS1Parser::m_pSheetPropInfo
private

Definition at line 204 of file svxcss1.hxx.

Referenced by ParseStyleSheet(), SelectorParsed(), SvxCSS1Parser(), and ~SvxCSS1Parser().

◆ m_sBaseURL

OUString SvxCSS1Parser::m_sBaseURL
private

Definition at line 199 of file svxcss1.hxx.

Referenced by GetBaseURL().

◆ m_Selectors

CSS1Selectors SvxCSS1Parser::m_Selectors
private

Definition at line 192 of file svxcss1.hxx.

Referenced by ParseStyleSheet(), and SelectorParsed().

◆ m_Tags

CSS1Map SvxCSS1Parser::m_Tags
private

Definition at line 197 of file svxcss1.hxx.

Referenced by GetTag(), and InsertTag().


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