20#ifndef INCLUDED_SVX_XMLGRHLP_HXX
21#define INCLUDED_SVX_XMLGRHLP_HXX
29#include <unordered_map>
31#include <com/sun/star/document/XGraphicObjectResolver.hpp>
32#include <com/sun/star/document/XGraphicStorageHandler.hpp>
33#include <com/sun/star/document/XBinaryStreamResolver.hpp>
34#include <com/sun/star/embed/XStorage.hpp>
44 css::uno::Reference < css::embed::XStorage >
xStorage;
45 css::uno::Reference < css::io::XStream >
xStream;
50 css::document::XGraphicStorageHandler,
51 css::document::XBinaryStreamResolver>
56 std::vector< css::uno::Reference< css::io::XOutputStream > >
59 std::unordered_map<OUString, css::uno::Reference<css::graphic::XGraphic>>
maGraphicObjects;
65 SVX_DLLPRIVATE static bool ImplGetStreamNames(
const OUString& rURLStr,
66 OUString& rPictureStorageName,
67 OUString& rPictureStreamName );
69 ImplGetGraphicStorage(
const OUString& rPictureStorageName );
71 ImplGetGraphicStream(
const OUString& rPictureStorageName,
72 const OUString& rPictureStreamName );
73 SVX_DLLPRIVATE static OUString ImplGetGraphicMimeType( std::u16string_view rFileName );
75 const OUString& rPictureStreamName );
79 void Init(
const css::uno::Reference < css::embed::XStorage >& xXMLStorage,
81 const OUString& rGraphicMimeType = OUString() );
83 SVX_DLLPRIVATE OUString implSaveGraphic(css::uno::Reference<css::graphic::XGraphic>
const & rxGraphic,
84 OUString & rOutMimeType,
85 std::u16string_view rRequestName);
93 const OUString& rMimeType = OUString() );
98 virtual OUString SAL_CALL resolveGraphicObjectURL(
const OUString& aURL )
override;
101 virtual css::uno::Reference<css::graphic::XGraphic> SAL_CALL
102 loadGraphic(OUString
const & aURL)
override;
104 virtual css::uno::Reference<css::graphic::XGraphic> SAL_CALL
105 loadGraphicFromOutputStream(css::uno::Reference<css::io::XOutputStream>
const & rxOutputStream)
override;
107 virtual OUString SAL_CALL
108 saveGraphic(css::uno::Reference<css::graphic::XGraphic>
const & rxGraphic)
override;
110 virtual OUString SAL_CALL
111 saveGraphicByName(css::uno::Reference<css::graphic::XGraphic>
const & rxGraphic, OUString & rOutSavedMimeType, OUString
const & rRequestName)
override;
113 virtual css::uno::Reference<css::io::XInputStream> SAL_CALL
114 createInputStream(css::uno::Reference<css::graphic::XGraphic>
const & rxGraphic)
override;
117 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream(
const OUString& rURL )
override;
118 virtual css::uno::Reference< css::io::XOutputStream > SAL_CALL
createOutputStream( )
override;
119 virtual OUString SAL_CALL resolveOutputStream(
const css::uno::Reference< css::io::XOutputStream >& rxBinaryStream )
override;
std::unordered_map< OUString, css::uno::Reference< css::graphic::XGraphic > > maGraphicObjects
SvXMLGraphicHelperMode meCreateMode
OUString maCurStorageName
OUString maOutputMimeType
std::vector< css::uno::Reference< css::io::XOutputStream > > maGrfStms
static rtl::Reference< SvXMLGraphicHelper > Create(const css::uno::Reference< css::embed::XStorage > &rXMLStorage, SvXMLGraphicHelperMode eCreateMode)
std::unordered_map< Graphic, std::pair< OUString, OUString > > maExportGraphics
css::uno::Reference< css::embed::XStorage > mxRootStorage
void DropUnusedNamedItems(css::uno::Reference< css::uno::XInterface > const &xModel)
Reference< io::XInputStream > createInputStream(std::vector< sal_Int8 > &&rInData)
Reference< io::XOutputStream > createOutputStream(std::vector< sal_Int8 > *pOutData)
css::uno::Reference< css::embed::XStorage > xStorage
css::uno::Reference< css::io::XStream > xStream
#define SVXCORE_DLLPUBLIC