20#include <com/sun/star/embed/EmbedStates.hpp>
21#include <com/sun/star/embed/UnreachableStateException.hpp>
22#include <com/sun/star/embed/WrongStateException.hpp>
23#include <com/sun/star/embed/XEmbeddedClient.hpp>
24#include <com/sun/star/embed/Aspects.hpp>
25#include <com/sun/star/embed/EmbedMapUnits.hpp>
26#include <com/sun/star/embed/EntryInitModes.hpp>
27#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
28#include <com/sun/star/io/IOException.hpp>
29#include <com/sun/star/lang/DisposedException.hpp>
30#include <com/sun/star/lang/IllegalArgumentException.hpp>
31#include <com/sun/star/lang/NoSupportException.hpp>
35#include <osl/diagnose.h>
45 throw lang::DisposedException();
48 throw embed::WrongStateException(
"The object has no persistence!",
55 throw lang::DisposedException();
58 throw uno::RuntimeException(
"The object has no persistence!",
71 document::EventObject
aEvent;
72 aEvent.EventName = aEventName;
82 static_cast<document::XEventListener *
>(aIt.
next())->notifyEvent(
aEvent );
84 catch(
const uno::RuntimeException& )
103 ::osl::MutexGuard aGuard(
m_aMutex );
106 if ( nNewState == embed::EmbedStates::LOADED )
109 throw embed::UnreachableStateException();
115 ::osl::MutexGuard aGuard(
m_aMutex );
118 return { embed::EmbedStates::LOADED };
124 ::osl::MutexGuard aGuard(
m_aMutex );
133 ::osl::MutexGuard aGuard(
m_aMutex );
142 ::osl::MutexGuard aGuard(
m_aMutex );
145 return uno::Sequence< embed::VerbDescriptor >();
150 const uno::Reference< embed::XEmbeddedClient >& xClient )
152 ::osl::MutexGuard aGuard(
m_aMutex );
161 ::osl::MutexGuard aGuard(
m_aMutex );
170 ::osl::MutexGuard aGuard(
m_aMutex );
177 ::osl::MutexGuard aGuard(
m_aMutex );
184 ::osl::MutexGuard aGuard(
m_aMutex );
193 ::osl::MutexGuard aGuard(
m_aMutex );
200 ::osl::MutexGuard aGuard(
m_aMutex );
203 OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON,
"For iconified objects no graphical replacement is required!" );
204 if ( nAspect == embed::Aspects::MSOLE_ICON )
206 throw embed::WrongStateException(
"Illegal call!",
217 ::osl::MutexGuard aGuard(
m_aMutex );
220 OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON,
"For iconified objects no graphical replacement is required!" );
221 if ( nAspect == embed::Aspects::MSOLE_ICON )
223 throw embed::WrongStateException(
"Illegal call!",
227 throw embed::NoVisualAreaSizeException(
228 "No size available!",
237 ::osl::MutexGuard aGuard(
m_aMutex );
240 OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON,
"For iconified objects no graphical replacement is required!" );
241 if ( nAspect == embed::Aspects::MSOLE_ICON )
243 throw embed::WrongStateException(
"Illegal call!",
246 return embed::EmbedMapUnits::ONE_100TH_MM;
252 ::osl::MutexGuard aGuard(
m_aMutex );
256 throw embed::WrongStateException(
"Illegal call!",
262 const uno::Reference< embed::XStorage >& xStorage,
263 const OUString& sEntName,
264 sal_Int32 nEntryConnectionMode,
265 const uno::Sequence< beans::PropertyValue >& ,
266 const uno::Sequence< beans::PropertyValue >& )
268 ::osl::MutexGuard aGuard(
m_aMutex );
270 throw lang::DisposedException();
272 if ( !xStorage.is() )
273 throw lang::IllegalArgumentException(
"No parent storage is provided!",
277 if ( sEntName.isEmpty() )
278 throw lang::IllegalArgumentException(
"Empty element name is provided!",
282 if ( (
m_nObjectState != -1 || nEntryConnectionMode == embed::EntryInitModes::NO_INIT )
283 && (
m_nObjectState == -1 || nEntryConnectionMode != embed::EntryInitModes::NO_INIT ) )
285 throw embed::WrongStateException(
286 "Can't change persistent representation of activated object!",
292 if ( nEntryConnectionMode != embed::EntryInitModes::NO_INIT )
293 throw embed::WrongStateException(
294 "The object waits for saveCompleted() call!",
301 if ( nEntryConnectionMode != embed::EntryInitModes::DEFAULT_INIT
302 && nEntryConnectionMode != embed::EntryInitModes::NO_INIT )
303 throw lang::IllegalArgumentException(
"Wrong connection mode is provided!",
307 if ( !xStorage->hasByName( sEntName ) )
308 throw lang::IllegalArgumentException(
"Wrong entry is provided!",
319 const OUString& sEntName,
320 const uno::Sequence< beans::PropertyValue >& ,
321 const uno::Sequence< beans::PropertyValue >& )
323 ::osl::MutexGuard aGuard(
m_aMutex );
327 throw embed::WrongStateException(
328 "The object waits for saveCompleted() call!",
336 const OUString& sEntName,
337 const uno::Sequence< beans::PropertyValue >& ,
338 const uno::Sequence< beans::PropertyValue >& )
340 ::osl::MutexGuard aGuard(
m_aMutex );
344 throw embed::WrongStateException(
345 "The object waits for saveCompleted() call!",
360 ::osl::MutexGuard aGuard(
m_aMutex );
369 throw io::IOException();
373 throw uno::RuntimeException();
391 ::osl::MutexGuard aGuard(
m_aMutex );
395 throw embed::WrongStateException(
396 "The object waits for saveCompleted() call!",
408 ::osl::MutexGuard aGuard(
m_aMutex );
412 throw embed::WrongStateException(
413 "The object waits for saveCompleted() call!",
422 ::osl::MutexGuard aGuard(
m_aMutex );
426 throw embed::WrongStateException(
427 "The object waits for saveCompleted() call!",
436 ::osl::MutexGuard aGuard(
m_aMutex );
440 throw embed::WrongStateException(
441 "The object waits for saveCompleted() call!",
450 const uno::Sequence< beans::PropertyValue >& ,
451 const uno::Sequence< beans::PropertyValue >& )
453 ::osl::MutexGuard aGuard(
m_aMutex );
457 throw embed::WrongStateException(
458 "The object waits for saveCompleted() call!",
467 ::osl::MutexGuard aGuard(
m_aMutex );
472 return uno::Sequence< sal_Int8 >();
478 ::osl::MutexGuard aGuard(
m_aMutex );
480 throw lang::DisposedException();
487 const uno::Sequence< sal_Int8 >& ,
const OUString& )
489 throw lang::NoSupportException();
495 ::osl::MutexGuard aGuard(
m_aMutex );
498 return uno::Reference< util::XCloseable >();
504 ::osl::MutexGuard aGuard(
m_aMutex );
517 const uno::Reference< embed::XStateChangeListener >& xListener )
519 ::osl::MutexGuard aGuard(
m_aMutex );
528 ::osl::MutexGuard aGuard(
m_aMutex );
530 throw lang::DisposedException();
532 uno::Reference< uno::XInterface > xSelfHold(
static_cast< ::
cppu::OWeakObject*
>(
this ) );
539 if ( pContainer !=
nullptr )
546 static_cast<util::XCloseListener*
>(pIterator.
next())->queryClosing( aSource, bDeliverOwnership );
548 catch(
const uno::RuntimeException& )
557 if ( pContainer !=
nullptr )
564 static_cast<util::XCloseListener*
>(pCloseIterator.
next())->notifyClosing( aSource );
566 catch(
const uno::RuntimeException& )
582 ::osl::MutexGuard aGuard(
m_aMutex );
595 ::osl::MutexGuard aGuard(
m_aMutex );
604 ::osl::MutexGuard aGuard(
m_aMutex );
617 ::osl::MutexGuard aGuard(
m_aMutex );
625 return "com.sun.star.comp.embed.ODummyEmbeddedObject";
635 return {
"com.sun.star.comp.embed.ODummyEmbeddedObject" };
std::unique_ptr< comphelper::OMultiTypeInterfaceContainerHelper2 > m_pInterfaceContainer
virtual css::uno::Reference< css::util::XCloseable > SAL_CALL getComponent() override
void PostEvent_Impl(const OUString &aEventName)
css::uno::Reference< css::embed::XEmbeddedClient > m_xClientSite
virtual void SAL_CALL addStateChangeListener(const css::uno::Reference< css::embed::XStateChangeListener > &xListener) override
virtual void SAL_CALL close(sal_Bool DeliverOwnership) override
virtual void SAL_CALL changeState(sal_Int32 nNewState) override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL storeAsEntry(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &sEntName, const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Sequence< css::beans::PropertyValue > &lObjArgs) override
virtual void SAL_CALL setClassInfo(const css::uno::Sequence< sal_Int8 > &aClassID, const OUString &aClassName) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getClassID() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::document::XEventListener > &Listener) override
virtual sal_Int64 SAL_CALL getStatus(sal_Int64 nAspect) override
void CheckInit_WrongState()
css::uno::Reference< css::embed::XStorage > m_xParentStorage
virtual void SAL_CALL addCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
virtual void SAL_CALL doVerb(sal_Int32 nVerbID) override
sal_Int64 m_nCachedAspect
virtual void SAL_CALL storeToEntry(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &sEntName, const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Sequence< css::beans::PropertyValue > &lObjArgs) override
virtual void SAL_CALL setVisualAreaSize(sal_Int64 nAspect, const css::awt::Size &aSize) override
virtual void SAL_CALL saveCompleted(sal_Bool bUseNew) override
virtual void SAL_CALL setContainerName(const OUString &sName) override
virtual sal_Int32 SAL_CALL getMapUnit(sal_Int64 nAspect) override
bool m_bWaitSaveCompleted
virtual void SAL_CALL storeOwn() override
css::uno::Reference< css::embed::XStorage > m_xNewParentStorage
virtual css::uno::Reference< css::embed::XEmbeddedClient > SAL_CALL getClientSite() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::document::XEventListener > &Listener) override
virtual void SAL_CALL setClientSite(const css::uno::Reference< css::embed::XEmbeddedClient > &xClient) override
virtual void SAL_CALL removeStateChangeListener(const css::uno::Reference< css::embed::XStateChangeListener > &xListener) override
virtual sal_Bool SAL_CALL isReadonly() override
virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation(::sal_Int64 nAspect) override
virtual void SAL_CALL update() override
virtual void SAL_CALL setUpdateMode(sal_Int32 nMode) override
virtual OUString SAL_CALL getEntryName() override
virtual css::awt::Size SAL_CALL getVisualAreaSize(sal_Int64 nAspect) override
virtual sal_Int32 SAL_CALL getCurrentState() override
virtual void SAL_CALL removeCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< css::embed::VerbDescriptor > SAL_CALL getSupportedVerbs() override
virtual OUString SAL_CALL getClassName() override
virtual void SAL_CALL setPersistentEntry(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &sEntName, sal_Int32 nEntryConnectionMode, const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Sequence< css::beans::PropertyValue > &lObjArgs) override
virtual sal_Bool SAL_CALL hasEntry() override
css::awt::Size m_aCachedSize
virtual void SAL_CALL reload(const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Sequence< css::beans::PropertyValue > &lObjArgs) override
sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual ~ODummyEmbeddedObject() override
css::uno::XInterface * next()
bool hasMoreElements() const
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)