21#include <oox/token/tokens.hxx>
23#include <com/sun/star/beans/PropertyValues.hpp>
24#include <com/sun/star/beans/XPropertySet.hpp>
25#include <com/sun/star/drawing/XDrawPage.hpp>
40template<
typename Type >
41const Type* lclGetStyleElement(
const RefVector< Type >& rVector, sal_Int32 nIndex )
43 return (rVector.empty() || (nIndex < 1)) ? nullptr :
44 rVector.get( ::std::min(
static_cast< sal_Int32
>( nIndex - 1 ),
static_cast< sal_Int32
>( rVector.size() - 1 ) ) ).get();
78 if( (rName.size() == 6) && (rName[ 0 ] ==
'+') && (rName[ 3 ] ==
'-') )
80 if( (rName[ 1 ] ==
'm') && (rName[ 2 ] ==
'j') )
82 else if( (rName[ 1 ] ==
'm') && (rName[ 2 ] ==
'n') )
86 if( (rName[ 4 ] ==
'l') && (rName[ 5 ] ==
't') )
88 if( (rName[ 4 ] ==
'e') && (rName[ 5 ] ==
'a') )
90 if( (rName[ 4 ] ==
'c') && (rName[ 5 ] ==
's') )
96 if (rName ==
u"majorHAnsi" || rName ==
u"majorAscii" || rName ==
u"majorBidi" || rName ==
u"majorEastAsia")
98 else if (rName ==
u"minorHAnsi" || rName ==
u"minorAscii" || rName ==
u"minorBidi" || rName ==
u"minorEastAsia")
102 if (rName ==
u"majorAscii" || rName ==
u"majorHAnsi" || rName ==
u"minorAscii" || rName ==
u"minorHAnsi")
104 else if (rName ==
u"minorBidi" || rName ==
u"majorBidi")
106 else if (rName ==
u"minorEastAsia" || rName ==
u"majorEastAsia")
114 auto pTheme = std::make_unique<model::Theme>(
maThemeName);
117 pTheme->SetColorSet(std::move(pColorSet));
124 pCharProps->maLatinFont.fillThemeFont(aMinorLatin);
128 pCharProps->maAsianFont.fillThemeFont(aMinorAsian);
132 pCharProps->maComplexFont.fillThemeFont(aMinorComplex);
139 pCharProps->maLatinFont.fillThemeFont(aMajorLatin);
143 pCharProps->maAsianFont.fillThemeFont(aMajorAsian);
147 pCharProps->maComplexFont.fillThemeFont(aMajorComplex);
153 std::vector<model::ThemeSupplementalFont> aList;
163 std::vector<model::ThemeSupplementalFont> aList;
171 pTheme->setFontScheme(aFontScheme);
176void Theme::addTheme(
const css::uno::Reference<css::drawing::XDrawPage>& xDrawPage)
const
178 SAL_WARN_IF(!xDrawPage.is(),
"oox",
"DrawPage is not set");
182 SAL_WARN_IF(!pPage,
"oox",
"Can't get SdrPage from XDrawPage");
void SetTheme(std::unique_ptr< model::Theme > pTheme)
SdrPageProperties & getSdrPageProperties()
void setMajorAsian(ThemeFont const &aMajor)
void setMinorComplex(ThemeFont const &aMinor)
void setMajorLatin(ThemeFont const &aMajor)
void setMinorSupplementalFontList(std::vector< ThemeSupplementalFont > const &rSupplementalFont)
void setMinorAsian(ThemeFont const &aMinor)
void setMinorLatin(ThemeFont const &aMinor)
void setMajorSupplementalFontList(std::vector< ThemeSupplementalFont > const &rSupplementalFont)
void setMajorComplex(ThemeFont const &aMajor)
mapped_type get(key_type nKey) const
Returns a reference to the object associated to the passed key, or an empty reference on error.
const OUString & GetName() const
void fill(model::ColorSet &rColorSet) const
const EffectProperties * getEffectStyle(sal_Int32 nIndex) const
EffectStyleList maEffectStyleList
const FillProperties * getFillStyle(sal_Int32 nIndex) const
Returns the fill properties of the passed one-based themed style index.
FillStyleList maBgFillStyleList
std::unique_ptr< model::Theme > createSvxTheme() const
const LineProperties * getLineStyle(sal_Int32 nIndex) const
Returns the line properties of the passed one-based themed style index.
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > maSupplementalFontMap
void addTheme(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage) const
const TextCharacterProperties * getFontStyle(sal_Int32 nSchemeType) const
Returns theme font properties by scheme type (major/minor).
LineStyleList maLineStyleList
FillStyleList maFillStyleList
OUString maFontSchemeName
const TextFont * resolveFont(std::u16string_view rName) const
Returns theme font by placeholder name, e.g.
#define SAL_WARN_IF(condition, area, stream)
SVXCORE_DLLPUBLIC SdrPage * GetSdrPageFromXDrawPage(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage) noexcept