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

#include <swcss1.hxx>

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

Public Member Functions

 SwCSS1Parser (SwDoc *pDoc, sal_uInt32 const aFHeight[7], const OUString &rBaseURL, bool bNewDoc)
 
virtual ~SwCSS1Parser () override
 
virtual bool ParseStyleSheet (const OUString &rIn) override
 
virtual sal_uInt32 GetFontHeight (sal_uInt16 nSize) const override
 
virtual const FontListGetFontList () const override
 
SwCharFormatGetChrFormat (HtmlTokenId nToken, const OUString &rClass) const
 
SwTextFormatCollGetTextFormatColl (sal_uInt16 nTextColl, const OUString &rClass)
 
SwTextFormatCollGetTextCollFromPool (sal_uInt16 nPoolId) const
 
SwCharFormatGetCharFormatFromPool (sal_uInt16 nPoolId) const
 
SwPageDescGetMasterPageDesc ()
 
const SwPageDescGetFirstPageDesc (bool bCreate=false)
 
const SwPageDescGetRightPageDesc (bool bCreate=false)
 
const SwPageDescGetLeftPageDesc (bool bCreate=false)
 
void SetPageDescAttrs (const SvxBrushItem *pBrush, SfxItemSet *pItemSet=nullptr)
 
void ChgPageDesc (const SwPageDesc *pPageDesc, const SwPageDesc &rNewPageDesc)
 
void SetPageDescAttrs (const SwPageDesc *pPageDesc, SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rPropInfo)
 
void FillDropCap (SwFormatDrop &rDrop, SfxItemSet &rItemSet, const OUString *pName=nullptr)
 
bool SetFormatBreak (SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rPropInfo)
 
bool IsBodyBGColorSet () const
 
bool IsBodyBackgroundSet () const
 
bool IsBodyTextSet () const
 
bool IsBodyLinkSet () const
 
bool IsBodyVLinkSet () const
 
bool IsSetFirstPageDesc () const
 
bool IsSetRightPageDesc () const
 
void SetBodyBGColorSet ()
 
void SetBodyBackgroundSet ()
 
void SetBodyTextSet ()
 
void SetBodyLinkSet ()
 
void SetBodyVLinkSet ()
 
std::shared_ptr< SvxBrushItemmakePageDescBackground () const
 
void SetTHTagStyles ()
 
void SetTDTagStyles ()
 
void SetATagStyles ()
 
void SetDelayedStyles ()
 
virtual void SetDfltEncoding (rtl_TextEncoding eEnc) override
 
- Public Member Functions inherited from SvxCSS1Parser
 SvxCSS1Parser (SfxItemPool &rPool, const OUString &rBaseURL, sal_uInt16 const *pWhichIds, sal_uInt16 nWhichIds)
 
virtual ~SvxCSS1Parser () override
 
bool IsIgnoreFontFamily () const
 
void SetIgnoreFontFamily (bool bSet)
 
void ParseStyleOption (const OUString &rIn, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo)
 
const sal_uInt16 * GetWhichMap () 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)
 
rtl_TextEncoding GetDfltEncoding () const
 
const OUString & GetBaseURL () const
 
- Public Member Functions inherited from CSS1Parser
 CSS1Parser ()
 
virtual ~CSS1Parser ()
 

Static Public Member Functions

static void AddClassName (OUString &rFormatName, const OUString &rClass)
 
static bool MayBePositioned (const SvxCSS1PropertyInfo &rPropInfo, bool bAutoWidth=false)
 
static Css1ScriptFlags GetScriptFromClass (OUString &rClass, bool bSubClassOnly=true)
 
- Static Public Member Functions inherited from SvxCSS1Parser
static bool GetEnum (const CSS1PropertyEnum *pPropTable, const OUString &rValue, sal_uInt16 &rEnum)
 
static void PixelToTwip (long &nWidth, 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) override
 
- Protected Member Functions inherited from SvxCSS1Parser
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...
 
- 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...
 

Private Member Functions

const SwPageDescGetPageDesc (sal_uInt16 nPoolId, bool bCreate)
 
void SetTableTextColl (bool bHeader)
 
void SetLinkCharFormats ()
 

Private Attributes

SwDocm_pDoc
 
sal_uLong m_aFontHeights [7]
 
sal_uInt16 m_nDropCapCnt
 
bool const m_bIsNewDoc: 1
 
bool m_bBodyBGColorSet: 1
 
bool m_bBodyBackgroundSet: 1
 
bool m_bBodyTextSet: 1
 
bool m_bBodyLinkSet: 1
 
bool m_bBodyVLinkSet: 1
 
bool m_bSetFirstPageDesc: 1
 
bool m_bSetRightPageDesc: 1
 
bool m_bTableHeaderTextCollSet: 1
 
bool m_bTableTextCollSet: 1
 
bool m_bLinkCharFormatsSet: 1
 

Detailed Description

Definition at line 41 of file swcss1.hxx.

Constructor & Destructor Documentation

SwCSS1Parser::SwCSS1Parser ( SwDoc pDoc,
sal_uInt32 const  aFHeight[7],
const OUString &  rBaseURL,
bool  bNewDoc 
)

Definition at line 93 of file htmlcss1.cxx.

References m_aFontHeights, and SAL_N_ELEMENTS.

SwCSS1Parser::~SwCSS1Parser ( )
overridevirtual

Definition at line 119 of file htmlcss1.cxx.

Member Function Documentation

void SwCSS1Parser::AddClassName ( OUString &  rFormatName,
const OUString &  rClass 
)
static

Definition at line 1446 of file htmlcss1.cxx.

Referenced by GetChrFormat(), GetTextFormatColl(), and StyleParsed().

void SwCSS1Parser::ChgPageDesc ( const SwPageDesc pPageDesc,
const SwPageDesc rNewPageDesc 
)

Definition at line 83 of file htmlcss1.cxx.

References SwDoc::ChgPageDesc(), SwDoc::ContainsPageDesc(), m_pDoc, and pos.

Referenced by GetPageDesc(), and SetPageDescAttrs().

void SwCSS1Parser::FillDropCap ( SwFormatDrop rDrop,
SfxItemSet rItemSet,
const OUString *  pName = nullptr 
)
SwCharFormat * SwCSS1Parser::GetCharFormatFromPool ( sal_uInt16  nPoolId) const
SwCharFormat * SwCSS1Parser::GetChrFormat ( HtmlTokenId  nToken,
const OUString &  rClass 
) const
const SwPageDesc * SwCSS1Parser::GetFirstPageDesc ( bool  bCreate = false)
inline

Definition at line 161 of file swcss1.hxx.

References GetPageDesc(), and RES_POOLPAGE_FIRST.

Referenced by GetPageDesc(), and ParseStyleSheet().

sal_uInt32 SwCSS1Parser::GetFontHeight ( sal_uInt16  nSize) const
overridevirtual

Reimplemented from SvxCSS1Parser.

Definition at line 1107 of file htmlcss1.cxx.

References m_aFontHeights.

const FontList * SwCSS1Parser::GetFontList ( ) const
overridevirtual

Reimplemented from SvxCSS1Parser.

Definition at line 1112 of file htmlcss1.cxx.

References SwDoc::GetDocShell(), SvxFontListItem::GetFontList(), SfxShell::GetItem(), and m_pDoc.

const SwPageDesc * SwCSS1Parser::GetLeftPageDesc ( bool  bCreate = false)
inline

Definition at line 171 of file swcss1.hxx.

References GetPageDesc(), and RES_POOLPAGE_LEFT.

Referenced by GetPageDesc(), ParseStyleSheet(), and SetFormatBreak().

SwPageDesc * SwCSS1Parser::GetMasterPageDesc ( )
const SwPageDesc * SwCSS1Parser::GetPageDesc ( sal_uInt16  nPoolId,
bool  bCreate 
)
private
const SwPageDesc * SwCSS1Parser::GetRightPageDesc ( bool  bCreate = false)
inline

Definition at line 166 of file swcss1.hxx.

References GetPageDesc(), and RES_POOLPAGE_RIGHT.

Referenced by GetPageDesc(), ParseStyleSheet(), and SetFormatBreak().

Css1ScriptFlags SwCSS1Parser::GetScriptFromClass ( OUString &  rClass,
bool  bSubClassOnly = true 
)
static
SwTextFormatColl * SwCSS1Parser::GetTextCollFromPool ( sal_uInt16  nPoolId) const
SwTextFormatColl * SwCSS1Parser::GetTextFormatColl ( sal_uInt16  nTextColl,
const OUString &  rClass 
)
bool SwCSS1Parser::IsBodyBackgroundSet ( ) const
inline

Definition at line 137 of file swcss1.hxx.

References m_bBodyBackgroundSet.

bool SwCSS1Parser::IsBodyBGColorSet ( ) const
inline

Definition at line 136 of file swcss1.hxx.

References m_bBodyBGColorSet.

bool SwCSS1Parser::IsBodyLinkSet ( ) const
inline

Definition at line 139 of file swcss1.hxx.

References m_bBodyLinkSet.

bool SwCSS1Parser::IsBodyTextSet ( ) const
inline

Definition at line 138 of file swcss1.hxx.

References m_bBodyTextSet.

bool SwCSS1Parser::IsBodyVLinkSet ( ) const
inline

Definition at line 140 of file swcss1.hxx.

References m_bBodyVLinkSet.

bool SwCSS1Parser::IsSetFirstPageDesc ( ) const
inline

Definition at line 142 of file swcss1.hxx.

References m_bSetFirstPageDesc.

bool SwCSS1Parser::IsSetRightPageDesc ( ) const
inline

Definition at line 143 of file swcss1.hxx.

References m_bSetRightPageDesc.

std::shared_ptr< SvxBrushItem > SwCSS1Parser::makePageDescBackground ( ) const
bool SwCSS1Parser::MayBePositioned ( const SvxCSS1PropertyInfo rPropInfo,
bool  bAutoWidth = false 
)
static
bool SwCSS1Parser::ParseStyleSheet ( const OUString &  rIn)
overridevirtual
void SwCSS1Parser::SetATagStyles ( )
inline

Definition at line 188 of file swcss1.hxx.

References m_bLinkCharFormatsSet, and SetLinkCharFormats().

Referenced by SetDelayedStyles().

void SwCSS1Parser::SetBodyBackgroundSet ( )
inline

Definition at line 146 of file swcss1.hxx.

References m_bBodyBackgroundSet.

void SwCSS1Parser::SetBodyBGColorSet ( )
inline

Definition at line 145 of file swcss1.hxx.

References m_bBodyBGColorSet.

void SwCSS1Parser::SetBodyLinkSet ( )
inline

Definition at line 148 of file swcss1.hxx.

References m_bBodyLinkSet.

void SwCSS1Parser::SetBodyTextSet ( )
inline

Definition at line 147 of file swcss1.hxx.

References m_bBodyTextSet.

void SwCSS1Parser::SetBodyVLinkSet ( )
inline

Definition at line 149 of file swcss1.hxx.

References m_bBodyVLinkSet.

void SwCSS1Parser::SetDelayedStyles ( )
inline

Definition at line 194 of file swcss1.hxx.

References SetATagStyles(), SetTDTagStyles(), and SetTHTagStyles().

void SwCSS1Parser::SetDfltEncoding ( rtl_TextEncoding  eEnc)
overridevirtual
bool SwCSS1Parser::SetFormatBreak ( SfxItemSet rItemSet,
const SvxCSS1PropertyInfo rPropInfo 
)
void SwCSS1Parser::SetLinkCharFormats ( )
private
void SwCSS1Parser::SetPageDescAttrs ( const SvxBrushItem pBrush,
SfxItemSet pItemSet = nullptr 
)
void SwCSS1Parser::SetPageDescAttrs ( const SwPageDesc pPageDesc,
SfxItemSet rItemSet,
const SvxCSS1PropertyInfo rPropInfo 
)
void SwCSS1Parser::SetTableTextColl ( bool  bHeader)
private
void SwCSS1Parser::SetTDTagStyles ( )
inline

Definition at line 182 of file swcss1.hxx.

References m_bTableTextCollSet, and SetTableTextColl().

Referenced by SetDelayedStyles().

void SwCSS1Parser::SetTHTagStyles ( )
inline

Definition at line 176 of file swcss1.hxx.

References m_bTableHeaderTextCollSet, and SetTableTextColl().

Referenced by SetDelayedStyles().

void SwCSS1Parser::StyleParsed ( const CSS1Selector pSelector,
SfxItemSet rItemSet,
SvxCSS1PropertyInfo rPropInfo 
)
overrideprotectedvirtual

Body has a background color, if it is not "no fill"/"auto fill"

Reimplemented from SvxCSS1Parser.

Definition at line 686 of file htmlcss1.cxx.

References AddClassName(), AllMask, aName, CJK, SfxItemSet::ClearItem(), COL_TRANSPARENT(), CSS1_SELTYPE_CLASS, CSS1_SELTYPE_ELEM_CLASS, CSS1_SELTYPE_ELEMENT, CSS1_SELTYPE_ID, CSS1_SELTYPE_PAGE, CSS1_SELTYPE_PSEUDO, CTL, FillDropCap(), SwDoc::FindCharFormatByName(), SwDoc::FindTextFormatCollByName(), SwFormat::GetAttrSet(), GetCharFormatFromPool(), SwFormatDrop::GetChars(), GetChrFormat(), SvxBrushItem::GetColor(), SwFormat::GetDrop(), SvxBrushItem::GetGraphicPos(), GetHTMLToken(), SfxItemSet::GetItemState(), SwFormat::GetName(), CSS1Selector::GetNext(), GetScriptFromClass(), CSS1Selector::GetString(), GetTextCollFromPool(), GetTextFormatColl(), GetTokenAndClass(), CSS1Selector::GetType(), GPOS_NONE, SvxCSS1Parser::InsertClass(), SvxCSS1Parser::InsertId(), SvxCSS1Parser::InsertPage(), SvxCSS1Parser::InsertTag(), m_bBodyBackgroundSet, m_bBodyBGColorSet, m_bBodyTextSet, m_bIsNewDoc, SvxCSS1PropertyInfo::m_eFloat, m_pDoc, SwDoc::MakeCharFormat(), SwDoc::MakeTextFormatColl(), MIN_BORDER_DIST, OOO_STRING_SVTOOLS_HTML_parabreak, OOO_STRING_SVTOOLS_HTML_sdendnote, OOO_STRING_SVTOOLS_HTML_sdendnote_sym, OOO_STRING_SVTOOLS_HTML_sdfootnote, OOO_STRING_SVTOOLS_HTML_sdfootnote_sym, RemoveScriptItems(), RES_BACKGROUND, RES_BOX, RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT, RES_CHRATR_COLOR, RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT, RES_CHRATR_FONT, RES_CHRATR_LANGUAGE, RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT, RES_POOLCHR_ENDNOTE, RES_POOLCHR_FOOTNOTE, RES_POOLCOLL_ENDNOTE, RES_POOLCOLL_FOOTNOTE, RES_POOLCOLL_HEADLINE1, RES_POOLCOLL_HEADLINE2, RES_POOLCOLL_HEADLINE3, RES_POOLCOLL_HEADLINE4, RES_POOLCOLL_HEADLINE5, RES_POOLCOLL_HEADLINE6, RES_POOLCOLL_HTML_BLOCKQUOTE, RES_POOLCOLL_HTML_DD, RES_POOLCOLL_HTML_DT, RES_POOLCOLL_HTML_PRE, RES_POOLCOLL_SENDADRESS, RES_POOLCOLL_STANDARD, RES_POOLCOLL_TABLE, RES_POOLCOLL_TABLE_HDLN, RES_POOLCOLL_TEXT, SwFormat::SetAuto(), SvxCSS1PropertyInfo::SetBoxItem(), SetCharFormatAttrs(), SwTextFormatColl::SetFormatAttr(), SetPageDescAttrs(), SetTextCollAttrs(), sName, and Western.

Member Data Documentation

sal_uLong SwCSS1Parser::m_aFontHeights[7]
private

Definition at line 45 of file swcss1.hxx.

Referenced by GetFontHeight(), and SwCSS1Parser().

bool SwCSS1Parser::m_bBodyBackgroundSet
private

Definition at line 52 of file swcss1.hxx.

Referenced by IsBodyBackgroundSet(), SetBodyBackgroundSet(), and StyleParsed().

bool SwCSS1Parser::m_bBodyBGColorSet
private

Definition at line 51 of file swcss1.hxx.

Referenced by IsBodyBGColorSet(), SetBodyBGColorSet(), and StyleParsed().

bool SwCSS1Parser::m_bBodyLinkSet
private

Definition at line 54 of file swcss1.hxx.

Referenced by IsBodyLinkSet(), SetBodyLinkSet(), and SetLinkCharFormats().

bool SwCSS1Parser::m_bBodyTextSet
private

Definition at line 53 of file swcss1.hxx.

Referenced by IsBodyTextSet(), SetBodyTextSet(), and StyleParsed().

bool SwCSS1Parser::m_bBodyVLinkSet
private

Definition at line 55 of file swcss1.hxx.

Referenced by IsBodyVLinkSet(), SetBodyVLinkSet(), and SetLinkCharFormats().

bool const SwCSS1Parser::m_bIsNewDoc
private
bool SwCSS1Parser::m_bLinkCharFormatsSet
private

Definition at line 63 of file swcss1.hxx.

Referenced by SetATagStyles(), and SetLinkCharFormats().

bool SwCSS1Parser::m_bSetFirstPageDesc
private

Definition at line 57 of file swcss1.hxx.

Referenced by IsSetFirstPageDesc(), and ParseStyleSheet().

bool SwCSS1Parser::m_bSetRightPageDesc
private

Definition at line 58 of file swcss1.hxx.

Referenced by IsSetRightPageDesc(), and ParseStyleSheet().

bool SwCSS1Parser::m_bTableHeaderTextCollSet
private

Definition at line 60 of file swcss1.hxx.

Referenced by SetTableTextColl(), and SetTHTagStyles().

bool SwCSS1Parser::m_bTableTextCollSet
private

Definition at line 61 of file swcss1.hxx.

Referenced by SetTableTextColl(), and SetTDTagStyles().

sal_uInt16 SwCSS1Parser::m_nDropCapCnt
private

Definition at line 47 of file swcss1.hxx.

Referenced by FillDropCap().

SwDoc* SwCSS1Parser::m_pDoc
private

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