22#include <com/sun/star/awt/Gradient2.hpp>
23#include <com/sun/star/beans/NamedValue.hpp>
24#include <com/sun/star/drawing/LineDash.hpp>
25#include <com/sun/star/drawing/Hatch.hpp>
26#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
27#include <com/sun/star/graphic/XGraphic.hpp>
30#include <oox/token/properties.hxx>
62 bool bNamedLineMarker,
bool bNamedLineDash,
bool bNamedFillGradient,
bool bNamedFillBitmap,
bool bNamedFillHatch ) :
63 mrPropertyIds(rnPropertyIds),
64 mbNamedLineMarker( bNamedLineMarker ),
65 mbNamedLineDash( bNamedLineDash ),
66 mbNamedFillGradient( bNamedFillGradient ),
67 mbNamedFillBitmap( bNamedFillBitmap ),
68 mbNamedFillHatch( bNamedFillHatch )
74 maShapePropInfo( rShapePropInfo )
92 if( nPropId < 0 )
return false;
131 NamedValue aNamedMarker;
132 if( (rValue >>= aNamedMarker) && !aNamedMarker.Name.isEmpty() )
139 bool bInserted = !aNamedMarker.Value.has< PolyPolygonBezierCoords >() ||
141 return bInserted &&
setProperty( nPropId, aNamedMarker.Name );
156 return !aDashName.isEmpty() &&
setProperty( nPropId, aDashName );
169 if( rValue.has< awt::Gradient2 >() )
172 return !aGradientName.isEmpty() &&
setProperty( nPropId, aGradientName );
174 else if( rValue.has< awt::Gradient >() )
177 return !aGradientName.isEmpty() &&
setProperty( nPropId, aGradientName );
190 if (rValue.has<drawing::Hatch>())
193 return !aHatchName.isEmpty() &&
setProperty( nPropId, aHatchName );
202 if( rValue.has< awt::Gradient2 >() )
205 return !aGradientName.isEmpty() &&
setProperty( nPropId, aGradientName );
207 else if( rValue.has< awt::Gradient >() )
210 return !aGradientName.isEmpty() &&
setProperty( nPropId, aGradientName );
225 if (rValue.has<uno::Reference<graphic::XGraphic>>())
227 auto xGraphic = rValue.get<uno::Reference<graphic::XGraphic>>();
229 return !aBitmapName.isEmpty() &&
setProperty(nPropId, aBitmapName);
237 if (rValue.has<uno::Reference<graphic::XGraphic>>())
239 auto xGraphic = rValue.get<uno::Reference<graphic::XGraphic>>();
Contains tables for named drawing objects for a document model.
OUString insertFillHatch(const css::drawing::Hatch &rHatch)
OUString insertTransGrandient(const css::awt::Gradient2 &rGradient)
OUString insertLineDash(const css::drawing::LineDash &rDash)
Inserts a new named line dash, returns the line dash name, based on an internal constant name with a ...
OUString insertFillBitmapXGraphic(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic)
Inserts a new named fill graphic, returns the bitmap name, based on an internal constant name with a ...
bool hasLineMarker(const OUString &rMarkerName) const
Returns true, if the model contains a line marker with the passed name.
bool insertLineMarker(const OUString &rMarkerName, const css::drawing::PolyPolygonBezierCoords &rMarker)
Inserts a new named line marker, overwrites an existing line marker with the same name.
OUString insertFillGradient(const css::awt::Gradient2 &rGradient)
Inserts a new named fill gradient, returns the gradient name, based on an internal constant name with...
ShapePropertyMap(ModelObjectHelper &rModelObjHelper, const ShapePropertyInfo &rShapePropInfo=ShapePropertyInfo::DEFAULT)
bool setLineMarker(sal_Int32 nPropId, const css::uno::Any &rValue)
Sets an explicit line marker, or creates a named line marker.
bool setProperty(ShapeProperty ePropId, const Type &rValue)
Sets the specified shape property to the passed value.
bool setFillGradient(sal_Int32 nPropId, const css::uno::Any &rValue)
Sets an explicit fill gradient, or creates a named fill gradient.
bool setAnyProperty(ShapeProperty ePropId, const css::uno::Any &rValue)
Sets the specified shape property to the passed value.
bool supportsProperty(ShapeProperty ePropId) const
Returns true, if the specified property is supported.
bool setGradientTrans(sal_Int32 nPropId, const css::uno::Any &rValue)
Creates a named transparency gradient.
ModelObjectHelper & mrModelObjHelper
bool setFillHatch(sal_Int32 nPropId, const css::uno::Any &rValue)
Sets an explicit fill hatch, or creates a named fill hatch.
bool setFillBitmap(sal_Int32 nPropId, const css::uno::Any &rValue)
Sets an explicit fill bitmap, or creates a named fill bitmap.
bool setLineDash(sal_Int32 nPropId, const css::uno::Any &rValue)
Sets an explicit line dash, or creates a named line dash.
bool hasNamedLineMarkerInTable(const OUString &rMarkerName) const
Returns true, if named line markers are supported, and the specified line marker has already been ins...
ShapePropertyInfo maShapePropInfo
bool setFillBitmapName(const css::uno::Any &rValue)
Sets an explicit fill bitmap and pushes the name to FillBitmapName.
ShapeProperty
Enumeration for various properties related to drawing shape formatting.
@ LineStart
Explicit line start marker or name of a line marker stored in a global container.
@ FillBitmap
Explicit fill bitmap or name of a fill bitmap stored in a global container.
@ FillGradient
Explicit fill gradient or name of a fill gradient stored in a global container.
@ LineEnd
Explicit line end marker or name of a line marker stored in a global container.
@ FillHatch
Explicit fill hatch or name of a fill hatch stored in a global container.
@ LineDash
Explicit line dash or name of a line dash stored in a global container.
o3tl::enumarray< ShapeProperty, sal_Int32 > ShapePropertyIds
bool mbNamedFillBitmap
True = use named fill gradient instead of explicit fill gradient.
bool has(ShapeProperty ePropId) const
ShapePropertyInfo(const ShapePropertyIds &rnPropertyIds, bool bNamedLineMarker, bool bNamedLineDash, bool bNamedFillGradient, bool bNamedFillBitmap, bool bNamedFillHatch)
Default property info (used as default parameter of other methods).
bool mbNamedFillHatch
True = use named fill bitmap instead of explicit fill bitmap.
bool mbNamedLineDash
True = use named line marker instead of explicit line marker.
static ShapePropertyInfo DEFAULT
True = use named fill hatch instead of explicit fill hatch.
bool mbNamedFillGradient
True = use named line dash instead of explicit line dash.
constexpr OUStringLiteral PROP_FillBitmapMode
constexpr OUStringLiteral PROP_FillTransparence
constexpr OUStringLiteral PROP_LineStartCenter
constexpr OUStringLiteral PROP_FillTransparenceGradientName
constexpr OUStringLiteral PROP_ShadowXDistance
constexpr OUStringLiteral PROP_FillBitmapPositionOffsetX
constexpr OUStringLiteral PROP_FillBackground
constexpr OUStringLiteral PROP_LineColor
constexpr OUStringLiteral PROP_FillUseSlideBackground
constexpr OUStringLiteral PROP_LineWidth
constexpr OUStringLiteral PROP_FillBitmapPositionOffsetY
constexpr OUStringLiteral PROP_LineEndWidth
constexpr OUStringLiteral PROP_FillColor
constexpr OUStringLiteral PROP_LineEndName
constexpr OUStringLiteral PROP_FillBitmapName
constexpr OUStringLiteral PROP_FillBitmapRectanglePoint
constexpr OUStringLiteral PROP_LineJoint
constexpr OUStringLiteral PROP_LineStyle
constexpr OUStringLiteral PROP_FillBitmapSizeX
constexpr OUStringLiteral PROP_LineCap
constexpr OUStringLiteral PROP_FillBitmapSizeY
constexpr OUStringLiteral PROP_LineStartWidth
constexpr OUStringLiteral PROP_LineEndCenter
constexpr OUStringLiteral PROP_LineStartName
constexpr OUStringLiteral PROP_LineTransparence
constexpr OUStringLiteral PROP_FillStyle