19#ifndef INCLUDED_COMPHELPER_EMBEDDEDOBJECTCONTAINER_HXX
20#define INCLUDED_COMPHELPER_EMBEDDEDOBJECTCONTAINER_HXX
22#include <com/sun/star/uno/Reference.h>
23#include <com/sun/star/uno/Sequence.h>
26#include <rtl/ustring.hxx>
38 class EmbeddedObjectContainer;
45 virtual css::uno::Reference < css::embed::XStorage >
getStorage()
const = 0;
57 std::unique_ptr<EmbedImpl>
pImpl;
59 css::uno::Reference < css::embed::XEmbeddedObject > Get_Impl(
const OUString&,
60 const css::uno::Reference < css::embed::XEmbeddedObject >& xCopy,
61 OUString
const* pBaseURL);
65 bool StoreEmbeddedObject(
66 const css::uno::Reference<css::embed::XEmbeddedObject>& xObj, OUString& rName,
bool bCopy,
67 const OUString& rSrcShellID,
const OUString& rDestShellID );
70 void AddEmbeddedObject(
const css::uno::Reference < css::embed::XEmbeddedObject >&,
const OUString& );
75 const css::uno::Reference < css::uno::XInterface >& );
78 void SwitchPersistence(
const css::uno::Reference < css::embed::XStorage >& );
79 bool CommitImageSubStorage();
80 void ReleaseImageSubStorage();
82 OUString CreateUniqueObjectName();
85 css::uno::Sequence < OUString > GetObjectNames()
const;
88 bool HasEmbeddedObjects()
const;
91 bool HasEmbeddedObject(
const OUString& );
93 bool HasInstantiatedEmbeddedObject(
const OUString& );
96 OUString GetEmbeddedObjectName(
const css::uno::Reference < css::embed::XEmbeddedObject >& )
const;
99 css::uno::Reference<css::embed::XEmbeddedObject> GetEmbeddedObject(
const OUString&, OUString
const* pBaseURL =
nullptr);
102 css::uno::Reference < css::embed::XEmbeddedObject >
104 OUString
const* pBaseURL =
nullptr );
106 css::uno::Reference < css::embed::XEmbeddedObject >
108 const css::uno::Sequence < css::beans::PropertyValue >&, OUString&,
109 OUString
const* pBaseURL =
nullptr );
116 css::uno::Reference < css::embed::XEmbeddedObject >
117 InsertEmbeddedObject(
const css::uno::Sequence < css::beans::PropertyValue >&, OUString& rName, OUString
const* pBaseURL =
nullptr);
121 css::uno::Reference < css::embed::XEmbeddedObject >
122 InsertEmbeddedLink(
const css::uno::Sequence < css::beans::PropertyValue >&, OUString& );
126 css::uno::Reference < css::embed::XEmbeddedObject >
130 css::uno::Reference <css::embed::XEmbeddedObject> CopyAndGetEmbeddedObject(
132 const OUString& rSrcShellID,
const OUString& rDestShellID );
136 void RemoveEmbeddedObject(
const OUString& rName,
bool bKeepToTempStorage =
true);
137 bool RemoveEmbeddedObject(
const css::uno::Reference < css::embed::XEmbeddedObject >&,
bool bKeepToTempStorage =
true);
140 void CloseEmbeddedObject(
const css::uno::Reference < css::embed::XEmbeddedObject >& );
146 css::uno::Reference < css::io::XInputStream > GetGraphicStream(
const css::uno::Reference < css::embed::XEmbeddedObject >&, OUString* pMediaType=
nullptr );
149 css::uno::Reference < css::io::XInputStream > GetGraphicStream(
const OUString& aName, OUString* pMediaType=
nullptr );
152 bool InsertGraphicStream(
const css::uno::Reference < css::io::XInputStream >& rStream,
const OUString& rObjectName,
const OUString& rMediaType );
155 bool InsertGraphicStreamDirectly(
const css::uno::Reference < css::io::XInputStream >& rStream,
const OUString& rObjectName,
const OUString& rMediaType );
158 void RemoveGraphicStream(
const OUString& rObjectName );
162 const OUString& aOrigName,
163 const OUString& aTargetName );
165 void CloseEmbeddedObjects();
166 bool StoreChildren(
bool _bOasisFormat,
bool _bObjectsOnly);
167 bool StoreAsChildren(
bool _bOasisFormat
168 ,
bool _bCreateEmbedded
169 ,
bool _bAutoSaveEvent
170 ,
const css::uno::Reference < css::embed::XStorage >& _xStorage);
172 static css::uno::Reference< css::io::XInputStream > GetGraphicReplacementStream(
173 sal_Int64 nViewAspect,
174 const css::uno::Reference < css::embed::XEmbeddedObject >&,
175 OUString* pMediaType );
183 bool SetPersistentEntries(
const css::uno::Reference< css::embed::XStorage >& _xStorage,
bool _bClearModifiedFlag =
true);
185 bool getUserAllowsLinkUpdate()
const;
186 void setUserAllowsLinkUpdate(
bool bNew);
css::uno::Reference< css::embed::XEmbeddedObject > InsertEmbeddedObject(const css::uno::Reference< css::io::XInputStream > &, OUString &)
EmbeddedObjectContainer(const css::uno::Reference< css::embed::XStorage > &)
bool HasEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &) const
EmbeddedObjectContainer(const css::uno::Reference< css::embed::XStorage > &, const css::uno::Reference< css::uno::XInterface > &)
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
std::unique_ptr< EmbedImpl > pImpl
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, const css::uno::Sequence< css::beans::PropertyValue > &, OUString &, OUString const *pBaseURL=nullptr)
bool InsertEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &, OUString &)
bool RemoveEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &, bool bKeepToTempStorage=true)
Helper interface to give access to some common object which replace the SfxObjectShell.
virtual bool isEnableSetModified() const =0
virtual EmbeddedObjectContainer & getEmbeddedObjectContainer() const =0
virtual css::uno::Reference< css::task::XInteractionHandler > getInteractionHandler() const =0
virtual css::uno::Reference< css::embed::XStorage > getStorage() const =0
virtual OUString getDocumentBaseURL() const =0
#define COMPHELPER_DLLPUBLIC