LibreOffice Module sw (master) 1
|
#include <svxcss1.hxx>
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 FontList * | GetFontList () const |
const WhichRangesContainer & | GetWhichMap () const |
void | InsertId (const OUString &rId, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
const SvxCSS1MapEntry * | GetId (const OUString &rId) const |
void | InsertClass (const OUString &rClass, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
const SvxCSS1MapEntry * | GetClass (const OUString &rClass) const |
void | InsertPage (const OUString &rPage, bool bPseudo, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
SvxCSS1MapEntry * | GetPage (const OUString &rPage, bool bPseudo) |
void | InsertTag (const OUString &rTag, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
SvxCSS1MapEntry * | GetTag (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< SfxItemSet > | m_pSheetItemSet |
SfxItemSet * | m_pItemSet |
std::unique_ptr< SvxCSS1PropertyInfo > | m_pSheetPropInfo |
SvxCSS1PropertyInfo * | m_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) |
Definition at line 188 of file svxcss1.hxx.
|
private |
Definition at line 191 of file svxcss1.hxx.
|
private |
Definition at line 190 of file svxcss1.hxx.
SvxCSS1Parser::SvxCSS1Parser | ( | SfxItemPool & | rPool, |
OUString | aBaseURL, | ||
sal_uInt16 const * | pWhichIds, | ||
sal_uInt16 | nWhichIds | ||
) |
Definition at line 703 of file svxcss1.cxx.
References aItemIds, SfxItemPool::GetTrueWhich(), i, m_aWhichMap, m_pSheetItemSet, m_pSheetPropInfo, WhichRangesContainer::MergeRange(), RES_MARGIN_FIRSTLINE(), RES_MARGIN_RIGHT(), and RES_MARGIN_TEXTLEFT().
|
overridevirtual |
Definition at line 766 of file svxcss1.cxx.
References m_pSheetItemSet, and m_pSheetPropInfo.
|
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.
|
inline |
Definition at line 307 of file svxcss1.hxx.
References m_sBaseURL.
Referenced by ParseCSS1_background().
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().
|
inline |
Definition at line 305 of file svxcss1.hxx.
References m_eDefaultEnc.
Referenced by SwCSS1Parser::GetCharFormatFromPool(), SwCSS1Parser::GetTextCollFromPool(), SwCSS1Parser::GetTextFormatColl(), ParseCSS1_font_family(), and SwCSS1Parser::SetDfltEncoding().
|
static |
Definition at line 869 of file svxcss1.cxx.
References o3tl::equalsIgnoreAsciiCase(), CSS1PropertyEnum::nEnum, and CSS1PropertyEnum::pName.
Referenced by ParseCSS1_background(), ParseCSS1_border_style(), ParseCSS1_border_xxx(), ParseCSS1_border_xxx_width(), ParseCSS1_direction(), ParseCSS1_float(), ParseCSS1_font(), ParseCSS1_font_size(), ParseCSS1_font_style(), ParseCSS1_font_variant(), ParseCSS1_font_weight(), ParseCSS1_list_style_type(), ParseCSS1_page_break_xxx(), ParseCSS1_position(), ParseCSS1_size(), ParseCSS1_text_align(), and ParseCSS1_text_transform().
|
virtual |
Reimplemented in SwCSS1Parser.
Definition at line 899 of file svxcss1.cxx.
Referenced by ParseCSS1_font_size().
|
virtual |
Reimplemented in SwCSS1Parser.
Definition at line 918 of file svxcss1.cxx.
Referenced by ParseCSS1_font_family().
const SvxCSS1MapEntry * SvxCSS1Parser::GetId | ( | const OUString & | rId | ) | const |
Definition at line 779 of file svxcss1.cxx.
References m_Ids.
|
inlinestatic |
Definition at line 302 of file svxcss1.hxx.
References gnMinFixLineSpace.
Referenced by ParseCSS1_line_height().
SvxCSS1MapEntry * SvxCSS1Parser::GetPage | ( | const OUString & | rPage, |
bool | bPseudo | ||
) |
Definition at line 809 of file svxcss1.cxx.
References m_Pages.
Referenced by SwCSS1Parser::ParseStyleSheet().
SvxCSS1MapEntry * SvxCSS1Parser::GetTag | ( | const OUString & | rTag | ) |
Definition at line 826 of file svxcss1.cxx.
References m_Tags.
Referenced by SwCSS1Parser::SetLinkCharFormats(), and SwCSS1Parser::SetTableTextColl().
|
inline |
Definition at line 270 of file svxcss1.hxx.
References m_aWhichMap.
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().
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().
|
static |
Definition at line 923 of file svxcss1.cxx.
References inserted(), MergeStyles(), and p.
Referenced by InsertClass(), InsertId(), InsertPage(), and InsertTag().
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().
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().
|
inline |
Definition at line 248 of file svxcss1.hxx.
References m_bIgnoreFontFamily.
Referenced by ParseCSS1_font_family().
|
static |
Definition at line 939 of file svxcss1.cxx.
References aItemIds, copy(), SfxItemSet::Get(), SvxULSpaceItem::GetLower(), SvxULSpaceItem::GetUpper(), SvxCSS1PropertyInfo::m_bBottomMargin, SvxCSS1PropertyInfo::m_bLeftMargin, SvxCSS1PropertyInfo::m_bRightMargin, SvxCSS1PropertyInfo::m_bTextIndent, SvxCSS1PropertyInfo::m_bTopMargin, SvxCSS1PropertyInfo::Merge(), SfxItemSet::Put(), RES_MARGIN_FIRSTLINE(), RES_MARGIN_RIGHT(), RES_MARGIN_TEXTLEFT(), SvxULSpaceItem::SetLower(), and SvxULSpaceItem::SetUpper().
Referenced by InsertMapEntry(), and SwHTMLParser::ParseStyleOptions().
|
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.
rIn | the style option as string |
Definition at line 240 of file parcss1.cxx.
References CSS1Parser::GetNextChar(), and CSS1Parser::m_cNextCh.
void SvxCSS1Parser::ParseStyleOption | ( | const OUString & | rIn, |
SfxItemSet & | rItemSet, | ||
SvxCSS1PropertyInfo & | rPropInfo | ||
) |
Definition at line 855 of file svxcss1.cxx.
References aItemIds, SfxItemSet::ClearItem(), m_pItemSet, m_pPropInfo, and CSS1Parser::ParseStyleOption().
|
protected |
Definition at line 221 of file parcss1.cxx.
Referenced by SwCSS1Parser::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 230 of file parcss1.cxx.
References CSS1Parser::GetNextChar(), CSS1Parser::m_bWhiteSpace, and CSS1Parser::m_cNextCh.
|
virtual |
Reimplemented in SwCSS1Parser, and SwCSS1Parser.
Definition at line 832 of file svxcss1.cxx.
References m_pItemSet, m_pPropInfo, m_pSheetItemSet, m_pSheetPropInfo, m_Selectors, CSS1Parser::ParseStyleSheet(), and StyleParsed().
|
static |
Definition at line 886 of file svxcss1.cxx.
References Application::GetDefaultDevice(), Size::Height(), OutputDevice::PixelToLogic(), and Size::Width().
Referenced by HTMLTable::InitCtor(), SwHTMLParser::InsertHorzRule(), SwHTMLParser::InsertImage(), ParseCSS1_border_xxx(), ParseCSS1_border_xxx_width(), ParseCSS1_font_size(), ParseCSS1_length(), ParseCSS1_letter_spacing(), ParseCSS1_line_height(), ParseCSS1_margin(), ParseCSS1_margin_bottom(), ParseCSS1_margin_left(), ParseCSS1_margin_right(), ParseCSS1_margin_top(), ParseCSS1_padding_xxx(), ParseCSS1_size(), and ParseCSS1_text_indent().
|
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().
|
virtual |
Reimplemented in SwCSS1Parser.
Definition at line 986 of file svxcss1.cxx.
References m_eDefaultEnc.
Referenced by SwCSS1Parser::SetDfltEncoding().
|
inline |
Definition at line 249 of file svxcss1.hxx.
References m_bIgnoreFontFamily.
|
protectedvirtual |
Reimplemented in SwCSS1Parser.
Definition at line 676 of file svxcss1.cxx.
Referenced by ParseStyleSheet(), and SelectorParsed().
|
staticconstexprprivate |
Definition at line 208 of file svxcss1.hxx.
Referenced by GetMinFixLineSpace().
|
private |
Definition at line 212 of file svxcss1.hxx.
Referenced by GetWhichMap(), and SvxCSS1Parser().
|
private |
Definition at line 211 of file svxcss1.hxx.
Referenced by IsIgnoreFontFamily(), and SetIgnoreFontFamily().
|
private |
Definition at line 195 of file svxcss1.hxx.
Referenced by GetClass(), and InsertClass().
|
private |
Definition at line 210 of file svxcss1.hxx.
Referenced by GetDfltEncoding(), and SetDfltEncoding().
|
private |
Definition at line 194 of file svxcss1.hxx.
Referenced by GetId(), and InsertId().
|
private |
Definition at line 196 of file svxcss1.hxx.
Referenced by GetPage(), and InsertPage().
|
private |
Definition at line 202 of file svxcss1.hxx.
Referenced by DeclarationParsed(), ParseStyleOption(), and ParseStyleSheet().
|
private |
Definition at line 205 of file svxcss1.hxx.
Referenced by DeclarationParsed(), ParseStyleOption(), and ParseStyleSheet().
|
private |
Definition at line 201 of file svxcss1.hxx.
Referenced by ParseStyleSheet(), SelectorParsed(), SvxCSS1Parser(), and ~SvxCSS1Parser().
|
private |
Definition at line 204 of file svxcss1.hxx.
Referenced by ParseStyleSheet(), SelectorParsed(), SvxCSS1Parser(), and ~SvxCSS1Parser().
|
private |
Definition at line 199 of file svxcss1.hxx.
Referenced by GetBaseURL().
|
private |
Definition at line 192 of file svxcss1.hxx.
Referenced by ParseStyleSheet(), and SelectorParsed().
|
private |
Definition at line 197 of file svxcss1.hxx.
Referenced by GetTag(), and InsertTag().