22 #include <com/sun/star/awt/Gradient.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>
31 #include <osl/diagnose.h>
41 mxModelFactory( rxModelFactory ),
45 OSL_ENSURE(
mxModelFactory.is(),
"ObjectContainer::ObjectContainer - missing service factory" );
70 if( bInsertByUnusedName )
88 OSL_ENSURE(
mxContainer.is(),
"ObjectContainer::createContainer - container not found" );
98 maMarkerContainer( rxModelFactory,
"com.sun.star.drawing.MarkerTable" ),
99 maDashContainer( rxModelFactory,
"com.sun.star.drawing.DashTable" ),
100 maGradientContainer( rxModelFactory,
"com.sun.star.drawing.GradientTable" ),
101 maTransGradContainer( rxModelFactory,
"com.sun.star.drawing.TransparencyGradientTable" ),
102 maBitmapUrlContainer( rxModelFactory,
"com.sun.star.drawing.BitmapTable" ),
103 maHatchContainer( rxModelFactory,
"com.sun.star.drawing.HatchTable" )
114 OSL_ENSURE( rMarker.Coordinates.hasElements(),
"ModelObjectHelper::insertLineMarker - line marker without coordinates" );
115 if( rMarker.Coordinates.hasElements() )
137 uno::Reference<awt::XBitmap> xBitmap(rxGraphic, uno::UNO_QUERY);
150 uno::Reference<awt::XBitmap> xBitmap;
152 if (aAny.has<uno::Reference<awt::XBitmap>>())
153 xBitmap = aAny.get<uno::Reference<awt::XBitmap>>();
OUString maServiceName
Service name to create the container.
constexpr OUStringLiteral gaHatchNameBase(u"msFillHatch ")
Base name for all named fill hatches.
constexpr OUStringLiteral gaBitmapUrlNameBase(u"msFillBitmap ")
Base name for all named fill bitmap URLs.
ObjectContainer(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxModelFactory, const OUString &rServiceName)
ModelObjectHelper(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxModelFactory)
constexpr OUStringLiteral gaGradientNameBase(u"msFillGradient ")
Base name for all named fill gradients.
bool hasLineMarker(const OUString &rMarkerName) const
Returns true, if the model contains a line marker with the passed name.
void createContainer() const
ObjectContainer maDashContainer
Contains all named line dashes.
css::uno::Reference< css::awt::XBitmap > getFillBitmap(OUString const &rGraphicName)
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 ...
ObjectContainer maMarkerContainer
Contains all named line markers (line end polygons).
css::uno::Any getObject(const OUString &rObjName) const
bool hasObject(const OUString &rObjName) const
Returns true, if the object with the passed name exists in the container.
sal_Int32 mnIndex
Index to create unique identifiers.
ObjectContainer maGradientContainer
Contains all named fill gradients.
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.
css::uno::Reference< css::container::XNameContainer > mxContainer
Container for the objects.
OUString insertObject(const OUString &rObjName, const css::uno::Any &rObj, bool bInsertByUnusedName)
Inserts the passed object into the container, returns its final name.
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.
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 ...
ObjectContainer maHatchContainer
Contains all named fill hatches.
constexpr OUStringLiteral gaTransGradNameBase(u"msTransGradient ")
Base name for all named fill gradients.
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 insertFillHatch(const css::drawing::Hatch &rHatch)
const OUString maServiceName
OUString insertFillGradient(const css::awt::Gradient &rGradient)
Inserts a new named fill gradient, returns the gradient name, based on an internal constant name with...
ObjectContainer maTransGradContainer
Contains all named transparency Gradients.
constexpr OUStringLiteral gaDashNameBase(u"msLineDash ")
Base name for all named line dashes.
css::uno::Reference< css::lang::XMultiServiceFactory > mxModelFactory
Factory to create the container.
OUString insertTransGrandient(const css::awt::Gradient &rGradient)
ObjectContainer maBitmapUrlContainer
Contains all named fill bitmap URLs.