24#include <oox/token/namespaces.hxx>
25#include <oox/token/tokens.hxx>
26#include <unordered_map>
27#include <frozen/bits/defines.h>
28#include <frozen/bits/elsa_std.h>
29#include <frozen/unordered_map.h>
36constexpr frozen::unordered_map<sal_Int32, model::SystemColorType, 30> constSystemColorMap
70constexpr frozen::unordered_map<sal_Int32, model::TransformationType, 28> constTransformTypeMap
107 , mpComplexColor(pComplexColor)
113 switch( getCurrentElement() )
115 case A_TOKEN(scrgbClr):
131 case A_TOKEN(srgbClr):
141 case A_TOKEN(hslClr):
158 case A_TOKEN(sysClr):
161 sal_Int32 nLastColor = rAttribs.
getIntegerHex(XML_lastClr, -1);
167 auto aIterator = constSystemColorMap.find(
nToken);
168 if (aIterator != constSystemColorMap.end())
170 auto const& aPair = *aIterator;
178 case A_TOKEN(schemeClr):
182 std::optional<OUString> sSchemeName = rAttribs.
getString(XML_val);
183 if (sSchemeName.has_value())
203 case A_TOKEN(prstClr):
226 case A_TOKEN(
alpha ):
227 case A_TOKEN( alphaMod ):
228 case A_TOKEN( alphaOff ):
229 case A_TOKEN( blue ):
230 case A_TOKEN( blueMod ):
231 case A_TOKEN( blueOff ):
233 case A_TOKEN( hueMod ):
234 case A_TOKEN( hueOff ):
236 case A_TOKEN( lumMod ):
237 case A_TOKEN( lumOff ):
238 case A_TOKEN( green ):
239 case A_TOKEN( greenMod ):
240 case A_TOKEN( greenOff ):
242 case A_TOKEN( redMod ):
243 case A_TOKEN( redOff ):
245 case A_TOKEN( satMod ):
246 case A_TOKEN( satOff ):
247 case A_TOKEN( shade ):
248 case A_TOKEN( tint ):
252 if (aValue.endsWith(
"%"))
261 case A_TOKEN(
comp ):
262 case A_TOKEN( gamma ):
263 case A_TOKEN( gray ):
265 case A_TOKEN( invGamma ):
272 auto aIterator = constTransformTypeMap.find(getBaseToken(nElement));
273 if (aIterator != constTransformTypeMap.end())
275 auto const& aPair = *aIterator;
280 if (aValueString.endsWith(
"%"))
295 , mpComplexColor(pComplexColor)
304 case A_TOKEN( scrgbClr ):
305 case A_TOKEN( srgbClr ):
306 case A_TOKEN( hslClr ):
307 case A_TOKEN( sysClr ):
308 case A_TOKEN( schemeClr ):
309 case A_TOKEN( prstClr ):
326 case A_TOKEN(scrgbClr):
327 case A_TOKEN(srgbClr):
328 case A_TOKEN(hslClr):
329 case A_TOKEN(sysClr):
330 case A_TOKEN(schemeClr):
331 case A_TOKEN(prstClr):
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
void setSchemeColor(ThemeColorType eType)
void setCRGB(sal_Int32 nR, sal_Int32 nG, sal_Int32 nB)
void setSchemePlaceholder()
std::vector< Transformation > maTransformations
void setHSL(sal_Int32 nH, sal_Int32 nS, sal_Int32 nL)
void setRGB(sal_Int32 nRGB)
void setSystemColor(SystemColorType eSystemColorType, sal_Int32 nRGB)
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...
std::optional< sal_Int32 > getIntegerHex(sal_Int32 nAttrToken) const
Returns the 32-bit signed integer value of the specified attribute (hexadecimal).
std::optional< sal_Int32 > getInteger(sal_Int32 nAttrToken) const
Returns the 32-bit signed integer value of the specified attribute (decimal).
std::optional< OUString > getString(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute.
std::optional< sal_Int32 > getToken(sal_Int32 nAttrToken) const
Returns the token identifier of the value of the specified attribute.
ColorContext(::oox::core::ContextHandler2Helper const &rParent, Color &rColor, model::ComplexColor *pComplexColor=nullptr)
model::ComplexColor * mpComplexColor
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const ::oox::AttributeList &rAttribs) override
Context handler for the different color value elements (a:scrgbClr, a:srgbClr, a:hslClr,...
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const ::oox::AttributeList &rAttribs) override
virtual void onStartElement(const ::oox::AttributeList &rAttribs) override
model::ComplexColor * mpComplexColor
ColorValueContext(::oox::core::ContextHandler2Helper const &rParent, Color &rColor, model::ComplexColor *pComplexColor=nullptr)
void addTransformation(sal_Int32 nElement, sal_Int32 nValue=-1)
Inserts the passed color transformation.
void setPrstClr(sal_Int32 nToken)
Sets a predefined color from the a:prstClr element.
void setScrgbClr(sal_Int32 nR, sal_Int32 nG, sal_Int32 nB)
Sets the percentual RGB values from the a:scrgbClr element.
void setSchemeClr(sal_Int32 nToken)
Sets a scheme color from the a:schemeClr element.
void setHslClr(sal_Int32 nHue, sal_Int32 nSat, sal_Int32 nLum)
Sets the HSL values from the a:hslClr element.
void setSysClr(sal_Int32 nToken, sal_Int32 nLastRgb)
Sets a system color from the a:sysClr element.
::Color getDmlPresetColor(sal_Int32 nToken, ::Color nDefaultRgb)
Returns the RGB value for the passed DrawingML color token, or nDefaultRgb on error.
void setSchemeName(const OUString &sSchemeName)
Sets the scheme name from the a:schemeClr element for interoperability purposes.
void setSrgbClr(sal_Int32 nRgb)
Sets an RGB value (hexadecimal RRGGBB) from the a:srgbClr element.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const ::oox::AttributeList &rAttribs) override
ColorsContext(::oox::core::ContextHandler2Helper const &rParent, std::vector< Color > &rColors)
std::vector< Color > & mrColors
constexpr double alpha[nDetails]
@ GradientInactiveCaption
model::ThemeColorType schemeNameToThemeColorType(OUString const &rSchemeName)
const sal_Int32 PER_PERCENT
const ::Color API_RGB_TRANSPARENT(ColorTransparency, 0xffffffff)
Transparent color for API calls.