22#include <com/sun/star/awt/Gradient2.hpp>
23#include <com/sun/star/container/XNameContainer.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/lang/XMultiServiceFactory.hpp>
28#include <com/sun/star/graphic/XGraphic.hpp>
29#include <com/sun/star/awt/XBitmap.hpp>
32#include <osl/diagnose.h>
42 mxModelFactory( rxModelFactory ),
46 OSL_ENSURE(
mxModelFactory.is(),
"ObjectContainer::ObjectContainer - missing service factory" );
71 if( bInsertByUnusedName )
89 OSL_ENSURE(
mxContainer.is(),
"ObjectContainer::createContainer - container not found" );
99 maMarkerContainer( rxModelFactory,
"com.sun.star.drawing.MarkerTable" ),
100 maDashContainer( rxModelFactory,
"com.sun.star.drawing.DashTable" ),
101 maGradientContainer( rxModelFactory,
"com.sun.star.drawing.GradientTable" ),
102 maTransGradContainer( rxModelFactory,
"com.sun.star.drawing.TransparencyGradientTable" ),
103 maBitmapUrlContainer( rxModelFactory,
"com.sun.star.drawing.BitmapTable" ),
104 maHatchContainer( rxModelFactory,
"com.sun.star.drawing.HatchTable" )
115 OSL_ENSURE( rMarker.Coordinates.hasElements(),
"ModelObjectHelper::insertLineMarker - line marker without coordinates" );
116 if( rMarker.Coordinates.hasElements() )
148 uno::Reference<awt::XBitmap> xBitmap(rxGraphic, uno::UNO_QUERY);
161 uno::Reference<awt::XBitmap> xBitmap;
163 if (aAny.has<uno::Reference<awt::XBitmap>>())
164 xBitmap = aAny.get<uno::Reference<awt::XBitmap>>();
const OUString maServiceName
static bool insertByName(const css::uno::Reference< css::container::XNameContainer > &rxNameContainer, const OUString &rName, const css::uno::Any &rObject)
Inserts an object into a name container.
static OUString insertByUnusedName(const css::uno::Reference< css::container::XNameContainer > &rxNameContainer, const OUString &rSuggestedName, sal_Unicode cSeparator, const css::uno::Any &rObject)
Inserts an object into a name container.
OUString insertFillHatch(const css::drawing::Hatch &rHatch)
OUString insertTransGrandient(const css::awt::Gradient2 &rGradient)
ModelObjectHelper(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxModelFactory)
css::uno::Reference< css::awt::XBitmap > getFillBitmap(OUString const &rGraphicName)
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.
ObjectContainer maBitmapUrlContainer
Contains all named fill bitmap URLs.
ObjectContainer maHatchContainer
Contains all named fill hatches.
ObjectContainer maMarkerContainer
Contains all named line markers (line end polygons).
ObjectContainer maDashContainer
Contains all named line dashes.
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.
ObjectContainer maTransGradContainer
Contains all named transparency Gradients.
OUString insertFillGradient(const css::awt::Gradient2 &rGradient)
Inserts a new named fill gradient, returns the gradient name, based on an internal constant name with...
ObjectContainer maGradientContainer
Contains all named fill gradients.
ObjectContainer(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxModelFactory, OUString aServiceName)
void createContainer() const
bool hasObject(const OUString &rObjName) const
Returns true, if the object with the passed name exists in the container.
OUString maServiceName
Service name to create the container.
OUString insertObject(const OUString &rObjName, const css::uno::Any &rObj, bool bInsertByUnusedName)
Inserts the passed object into the container, returns its final name.
css::uno::Reference< css::lang::XMultiServiceFactory > mxModelFactory
Factory to create the container.
css::uno::Reference< css::container::XNameContainer > mxContainer
Container for the objects.
sal_Int32 mnIndex
Index to create unique identifiers.
css::uno::Any getObject(const OUString &rObjName) const
constexpr OUStringLiteral gaBitmapUrlNameBase(u"msFillBitmap ")
Base name for all named fill bitmap URLs.
constexpr OUStringLiteral gaTransGradNameBase(u"msTransGradient ")
Base name for all named fill gradients.
constexpr OUStringLiteral gaHatchNameBase(u"msFillHatch ")
Base name for all named fill hatches.
constexpr OUStringLiteral gaGradientNameBase(u"msFillGradient ")
Base name for all named fill gradients.
constexpr OUStringLiteral gaDashNameBase(u"msLineDash ")
Base name for all named line dashes.