31#include <oox/token/namespaces.hxx>
32#include <oox/token/tokens.hxx>
42class FillStyleListContext :
public ContextHandler2
46 virtual ContextHandlerRef onCreateContext( sal_Int32 nElement,
const AttributeList& rAttribs )
override;
60 : ContextHandler2(rParent)
66ContextHandlerRef FillStyleListContext::onCreateContext( sal_Int32 nElement,
const AttributeList& rAttribs )
70 case A_TOKEN( noFill ):
71 case A_TOKEN( solidFill ):
72 case A_TOKEN( gradFill ):
73 case A_TOKEN( blipFill ):
74 case A_TOKEN( pattFill ):
75 case A_TOKEN( grpFill ):
79 return FillPropertiesContext::createFillContext(*
this, nElement, rAttribs, *
mrFillStyleList.back(), pFillStyle);
88class BackgroundFillStyleListContext :
public FillStyleListContext
92 : FillStyleListContext(rParent, rFillStyleList, rFormatScheme)
106class LineStyleListContext :
public ContextHandler2
110 virtual ContextHandlerRef onCreateContext( sal_Int32 nElement,
const AttributeList& rAttribs )
override;
120 : ContextHandler2(rParent)
126ContextHandlerRef LineStyleListContext::onCreateContext( sal_Int32 nElement,
const AttributeList& rAttribs )
134 return new LinePropertiesContext(*
this, rAttribs, *
mrLineStyleList.back(), pLineStyle);
142class EffectStyleListContext :
public ContextHandler2
146 virtual ContextHandlerRef onCreateContext( sal_Int32 nElement,
const AttributeList& rAttribs )
override;
157 : ContextHandler2(rParent)
164ContextHandlerRef EffectStyleListContext::onCreateContext( sal_Int32 nElement,
const AttributeList& )
168 case A_TOKEN( effectStyle ):
174 case A_TOKEN( effectLst ):
187class FontSchemeContext :
public ContextHandler2
190 FontSchemeContext(ContextHandler2Helper
const & rParent,
const AttributeList& rAttribs,
FontScheme& rFontScheme,
191 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>>& rSupplementalFontMap,
193 ~FontSchemeContext();
194 virtual ContextHandlerRef onCreateContext( sal_Int32 nElement,
const AttributeList& rAttribs )
override;
195 virtual void onEndElement()
override;
208FontSchemeContext::FontSchemeContext(ContextHandler2Helper
const & rParent,
const AttributeList& rAttribs,
FontScheme& rFontScheme,
209 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>>& rSupplementalFontMap,
211 : ContextHandler2(rParent)
219FontSchemeContext::~FontSchemeContext()
227void fillThemeFont(
model::ThemeFont& rThemeFont,
const AttributeList& rAttribs)
229 rThemeFont.
maTypeface = rAttribs.getStringDefaulted(XML_typeface);
230 rThemeFont.
maPanose = rAttribs.getStringDefaulted(XML_panose);
232 sal_Int32 nPitchFamily = rAttribs.getInteger(XML_pitchFamily, 0);
233 TextFont::resolvePitch(nPitchFamily, rThemeFont.
maPitch, rThemeFont.
maFamily);
238ContextHandlerRef FontSchemeContext::onCreateContext( sal_Int32 nElement,
const AttributeList& rAttribs )
242 case A_TOKEN( majorFont ):
247 case A_TOKEN( minorFont ):
252 case A_TOKEN( latin ):
258 fillThemeFont(aThemeFont, rAttribs);
268 mxCharProps->maAsianFont.setAttributes( rAttribs );
270 fillThemeFont(aThemeFont, rAttribs);
280 mxCharProps->maComplexFont.setAttributes( rAttribs );
282 fillThemeFont(aThemeFont, rAttribs);
291 OUString aScript = rAttribs.getStringDefaulted(XML_script);
292 OUString aTypeface = rAttribs.getStringDefaulted(XML_typeface);
304void FontSchemeContext::onEndElement()
306 switch( getCurrentElement() )
308 case A_TOKEN( majorFont ):
309 case A_TOKEN( minorFont ):
315ThemeElementsContext::ThemeElementsContext(ContextHandler2Helper
const & rParent,
Theme& rOoxTheme,
model::Theme& rTheme)
317 , mrOoxTheme(rOoxTheme)
327 case A_TOKEN( clrScheme ):
335 case A_TOKEN( fontScheme ):
343 case A_TOKEN( fmtScheme ):
350 case A_TOKEN( fillStyleLst ):
352 case A_TOKEN( lnStyleLst ):
354 case A_TOKEN( effectStyleLst ):
356 case A_TOKEN( bgFillStyleLst ):
void setMajorAsian(ThemeFont const &aMajor)
void setMinorComplex(ThemeFont const &aMinor)
void setMajorLatin(ThemeFont const &aMajor)
void setMinorAsian(ThemeFont const &aMinor)
void setMinorLatin(ThemeFont const &aMinor)
void addMinorSupplementalFont(ThemeSupplementalFont const &rfont)
void addMajorSupplementalFont(ThemeSupplementalFont const &rfont)
void setMajorComplex(ThemeFont const &aMajor)
std::shared_ptr< model::ColorSet > const & getColorSet() const
void setFontScheme(FontScheme const &rFontScheme)
void setColorSet(std::shared_ptr< model::ColorSet > const &pColorSet)
FormatScheme const & getFormatScheme() const
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
bool hasAttribute(sal_Int32 nAttrToken) const
Returns true, if the specified attribute is present.
void SetName(const OUString &rName)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const ::oox::AttributeList &rAttribs) override
void setFormatSchemeName(OUString const &rName)
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > & getSupplementalFontMap()
FillStyleList & getFillStyleList()
LineStyleList & getLineStyleList()
EffectStyleList & getEffectStyleList()
ClrScheme & getClrScheme()
FillStyleList & getBgFillStyleList()
FontScheme & getFontScheme()
void setFontSchemeName(OUString const &rName)
std::shared_ptr< T > make_shared(Args &&... args)
::rtl::Reference< ContextHandler > ContextHandlerRef
RefVector< LineProperties > LineStyleList
RefVector< FillProperties > FillStyleList
std::shared_ptr< TextCharacterProperties > TextCharacterPropertiesPtr
RefMap< sal_Int32, TextCharacterProperties > FontScheme
RefVector< EffectProperties > EffectStyleList
const sal_uInt8 WINDOWS_CHARSET_DEFAULT
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > & mrSupplementalFontMap
model::FontScheme maFontScheme
FillStyleList & mrFillStyleList
model::EffectStyle * mpEffectStyle
EffectStyleList & mrEffectStyleList
model::FormatScheme & mrFormatScheme
LineStyleList & mrLineStyleList
FontScheme & mrFontScheme
TextCharacterPropertiesPtr mxCharProps