summaryrefslogtreecommitdiff
path: root/embeddedobj/source/inc
diff options
context:
space:
mode:
Diffstat (limited to 'embeddedobj/source/inc')
-rw-r--r--embeddedobj/source/inc/closepreventer.hxx41
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx505
-rw-r--r--embeddedobj/source/inc/docholder.hxx216
-rw-r--r--embeddedobj/source/inc/dummyobject.hxx300
-rw-r--r--embeddedobj/source/inc/intercept.hxx170
-rw-r--r--embeddedobj/source/inc/oleembobj.hxx547
-rw-r--r--embeddedobj/source/inc/specialobject.hxx93
-rw-r--r--embeddedobj/source/inc/targetstatecontrol.hxx51
-rw-r--r--embeddedobj/source/inc/xcreator.hxx94
9 files changed, 2017 insertions, 0 deletions
diff --git a/embeddedobj/source/inc/closepreventer.hxx b/embeddedobj/source/inc/closepreventer.hxx
new file mode 100644
index 000000000000..f1a54dc8a5e5
--- /dev/null
+++ b/embeddedobj/source/inc/closepreventer.hxx
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: closepreventer.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/util/XCloseListener.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+class OClosePreventer : public ::cppu::WeakImplHelper1 < ::com::sun::star::util::XCloseListener >
+{
+ virtual void SAL_CALL queryClosing( const ::com::sun::star::lang::EventObject& Source, sal_Bool GetsOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL notifyClosing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+};
+
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx
new file mode 100644
index 000000000000..5a2827de3aa6
--- /dev/null
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -0,0 +1,505 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: commonembobj.hxx,v $
+ * $Revision: 1.22 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _INC_COMMONEMBOBJ_HXX_
+#define _INC_COMMONEMBOBJ_HXX_
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XVisualObject.hpp>
+#include <com/sun/star/embed/XEmbedPersist.hpp>
+#include <com/sun/star/embed/XLinkageSupport.hpp>
+#include <com/sun/star/embed/XClassifiedObject.hpp>
+#include <com/sun/star/embed/XComponentSupplier.hpp>
+#include <com/sun/star/embed/XInplaceObject.hpp>
+#include <com/sun/star/embed/XStateChangeBroadcaster.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
+#include <cppuhelper/weak.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace embed {
+ class XStorage;
+ }
+ namespace frame {
+ class XModel;
+ class XFrame;
+ }
+ namespace lang {
+ class XMultiServiceFactory;
+ }
+ namespace util {
+ class XCloseListener;
+ }
+ namespace beans {
+ struct PropertyValue;
+ struct NamedValue;
+ }
+}}}
+
+namespace cppu {
+ class OMultiTypeInterfaceContainerHelper;
+}
+
+#define NUM_SUPPORTED_STATES 5
+// #define NUM_SUPPORTED_VERBS 5
+
+#include "docholder.hxx"
+
+class Interceptor;
+
+class OCommonEmbeddedObject : public ::com::sun::star::embed::XEmbeddedObject
+ , public ::com::sun::star::embed::XEmbedPersist
+ , public ::com::sun::star::embed::XLinkageSupport
+ , public ::com::sun::star::embed::XInplaceObject
+ , public ::com::sun::star::container::XChild
+ , public ::com::sun::star::chart2::XDefaultSizeTransmitter
+ , public ::cppu::OWeakObject
+{
+protected:
+ ::osl::Mutex m_aMutex;
+
+ DocumentHolder* m_pDocHolder;
+
+ ::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
+
+ sal_Bool m_bReadOnly;
+
+ sal_Bool m_bDisposed;
+ sal_Bool m_bClosed;
+
+ sal_Int32 m_nObjectState;
+ sal_Int32 m_nTargetState; // should be -1 exept during state changing
+ sal_Int32 m_nUpdateMode;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aDocMediaDescriptor;
+
+ ::com::sun::star::uno::Sequence< sal_Int8 > m_aClassID;
+ ::rtl::OUString m_aClassName;
+
+ ::rtl::OUString m_aDocServiceName;
+ ::rtl::OUString m_aPresetFilterName;
+
+ sal_Int64 m_nMiscStatus;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > m_aObjectVerbs;
+
+ ::com::sun::star::uno::Sequence< sal_Int32 > m_aAcceptedStates;
+ ::com::sun::star::uno::Sequence< sal_Int32 > m_pIntermediateStatesSeqs[NUM_SUPPORTED_STATES][NUM_SUPPORTED_STATES];
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > > m_aVerbTable;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
+
+ ::rtl::OUString m_aContainerName;
+ ::rtl::OUString m_aDefaultParentBaseURL;
+ ::rtl::OUString m_aModuleName;
+ sal_Bool m_bEmbeddedScriptSupport;
+
+ Interceptor* m_pInterceptor;
+
+ // following information will be used between SaveAs and SaveCompleted
+ sal_Bool m_bWaitSaveCompleted;
+ ::rtl::OUString m_aNewEntryName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewObjectStorage;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aNewDocMediaDescriptor;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xClientWindow; // ???
+ ::com::sun::star::awt::Rectangle m_aOwnRectangle;
+ ::com::sun::star::awt::Rectangle m_aClipRectangle;
+
+ sal_Bool m_bIsLink;
+
+ // embedded object related stuff
+ ::rtl::OUString m_aEntryName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xObjectStorage;
+
+ // link related stuff
+ ::rtl::OUString m_aLinkURL;
+ ::rtl::OUString m_aLinkFilterName;
+ sal_Bool m_bLinkHasPassword;
+ ::rtl::OUString m_aLinkPassword;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
+
+ sal_Bool m_bHasClonedSize; // the object has cached size
+ ::com::sun::star::awt::Size m_aClonedSize;
+ sal_Int32 m_nClonedMapUnit;
+ ::com::sun::star::awt::Size m_aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member
+
+private:
+ void CommonInit_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
+
+ void LinkInit_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aObjectDescr );
+
+
+ void SwitchOwnPersistence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewObjectStorage,
+ const ::rtl::OUString& aNewName );
+
+ void SwitchOwnPersistence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
+ const ::rtl::OUString& aNewName );
+
+ ::rtl::OUString GetDocumentServiceName() { return m_aDocServiceName; }
+ ::rtl::OUString GetPresetFilterName() { return m_aPresetFilterName; }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ StoreDocumentToTempStream_Impl( sal_Int32 nStorageFormat,
+ const ::rtl::OUString& aBaseURL,
+ const ::rtl::OUString& aHierarchName );
+
+ sal_Int32 ConvertVerbToState_Impl( sal_Int32 nVerb );
+
+ void Deactivate();
+
+ void StateChangeNotification_Impl( sal_Bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState,::osl::ResettableMutexGuard& _rGuard );
+
+ void SwitchStateTo_Impl( sal_Int32 nNextState );
+
+ ::com::sun::star::uno::Sequence< sal_Int32 > GetIntermediateStatesSequence_Impl( sal_Int32 nNewState );
+
+ ::rtl::OUString GetFilterName( sal_Int32 nVersion );
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadDocumentFromStorage_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadLink_Impl();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > InitNewDocument_Impl();
+
+ void StoreDocToStorage_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ sal_Int32 nStorageVersion,
+ const ::rtl::OUString& aBaseURL,
+ const ::rtl::OUString& aHierarchName,
+ sal_Bool bAttachToStorage );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateDocFromMediaDescr_Impl(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMedDescr );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateTempDocFromLink_Impl();
+
+ ::rtl::OUString GetBaseURL_Impl();
+ ::rtl::OUString GetBaseURLFrom_Impl(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs );
+
+public:
+ OCommonEmbeddedObject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
+
+ // no persistance for linked objects, so the descriptors are provided in constructor
+ OCommonEmbeddedObject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aObjectDescr );
+
+ virtual ~OCommonEmbeddedObject();
+
+ void SaveObject_Impl();
+
+ void requestPositioning( const ::com::sun::star::awt::Rectangle& aRect );
+
+ // not a real listener and should not be
+ void PostEvent_Impl( const ::rtl::OUString& aEventName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xSource =
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() );
+
+// XInterface
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
+ throw( ::com::sun::star::uno::RuntimeException ) ;
+
+ virtual void SAL_CALL acquire()
+ throw();
+
+ virtual void SAL_CALL release()
+ throw();
+
+// XTypeProvider
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
+ throw( ::com::sun::star::uno::RuntimeException ) ;
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
+ throw( ::com::sun::star::uno::RuntimeException ) ;
+
+// XEmbeddedObject
+
+ virtual void SAL_CALL changeState( sal_Int32 nNewState )
+ throw ( ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getCurrentState()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setClientSite(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL update()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setContainerName( const ::rtl::OUString& sName )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+
+// XVisualObject
+
+ virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
+ throw ( ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException);
+
+// XEmbedPersist
+
+ virtual void SAL_CALL setPersistentEntry(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName,
+ sal_Int32 nEntryConnectionMode,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL storeToEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL storeAsEntry(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL hasEntry()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getEntryName()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+// XLinkageSupport
+
+ virtual void SAL_CALL breakLink( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isLink()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL getLinkURL()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException);
+
+
+// XCommonEmbedPersist
+
+ virtual void SAL_CALL storeOwn()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isReadonly()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL reload(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+
+// XInplaceObject
+
+ virtual void SAL_CALL setObjectRectangles( const ::com::sun::star::awt::Rectangle& aPosRect,
+ const ::com::sun::star::awt::Rectangle& aClipRect )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL enableModeless( sal_Bool bEnable )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL translateAccelerators(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyEvent >& aKeys )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+// XClassifiedObject
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getClassName()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setClassInfo(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName )
+ throw ( ::com::sun::star::lang::NoSupportException,
+ ::com::sun::star::uno::RuntimeException );
+
+
+// XComponentSupplier
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+// XStateChangeBroadcaster
+ virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+// XCloseable
+
+ virtual void SAL_CALL close( sal_Bool DeliverOwnership )
+ throw ( ::com::sun::star::util::CloseVetoException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addCloseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeCloseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+// XEventBroadcaster
+ virtual void SAL_CALL addEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XDefaultSizeTransmitter
+ //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+ virtual void SAL_CALL setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
diff --git a/embeddedobj/source/inc/docholder.hxx b/embeddedobj/source/inc/docholder.hxx
new file mode 100644
index 000000000000..e4cc26b679b0
--- /dev/null
+++ b/embeddedobj/source/inc/docholder.hxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: docholder.hxx,v $
+ * $Revision: 1.15 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _DOCHOLDER_HXX_
+#define _DOCHOLDER_HXX_
+
+#include <com/sun/star/util/XCloseListener.hpp>
+#include <com/sun/star/frame/XTerminateListener.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#include <com/sun/star/frame/XBorderResizeListener.hpp>
+#ifndef _COM_SUN_STAR_FRAME_XBORDERWIDTHS_HPP_
+#include <com/sun/star/frame/BorderWidths.hpp>
+#endif
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/embed/XHatchWindowController.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <cppuhelper/implbase6.hxx>
+
+class OCommonEmbeddedObject;
+class Interceptor;
+
+class DocumentHolder :
+ public ::cppu::WeakImplHelper6<
+ ::com::sun::star::util::XCloseListener,
+ ::com::sun::star::frame::XTerminateListener,
+ ::com::sun::star::util::XModifyListener,
+ ::com::sun::star::document::XEventListener,
+ ::com::sun::star::frame::XBorderResizeListener,
+ ::com::sun::star::embed::XHatchWindowController >
+{
+private:
+
+ OCommonEmbeddedObject* m_pEmbedObj;
+
+ Interceptor* m_pInterceptor;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > m_xOutplaceInterceptor;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > m_xComponent;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xOwnWindow; // set for inplace objects
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xHatchWindow; // set for inplace objects
+
+ ::com::sun::star::awt::Rectangle m_aObjRect;
+ ::com::sun::star::frame::BorderWidths m_aBorderWidths;
+
+ ::rtl::OUString m_aContainerName;
+ ::rtl::OUString m_aDocumentNamePart;
+
+ sal_Bool m_bReadOnly;
+
+ sal_Bool m_bWaitForClose;
+ sal_Bool m_bAllowClosing;
+ sal_Bool m_bDesktopTerminated;
+
+ sal_Int32 m_nNoBorderResizeReact;
+ sal_Int32 m_nNoResizeReact;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XDockingAreaAcceptor > m_xCachedDocAreaAcc;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aOutplaceFrameProps;
+
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetDocFrame();
+ sal_Bool LoadDocToFrame( sal_Bool );
+
+ ::com::sun::star::awt::Rectangle CalculateBorderedArea( const ::com::sun::star::awt::Rectangle& aRect );
+ ::com::sun::star::awt::Rectangle AddBorderToArea( const ::com::sun::star::awt::Rectangle& aRect );
+
+ void ResizeWindows_Impl( const ::com::sun::star::awt::Rectangle& aHatchRect );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > RetrieveOwnMenu_Impl();
+ sal_Bool MergeMenues_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xOwnLM,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContLM,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContDisp,
+ const ::rtl::OUString& aContModuleName );
+
+public:
+
+ static void FindConnectPoints(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xMenu,
+ sal_Int32 nConnectPoints[2] )
+ throw ( ::com::sun::star::uno::Exception );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > MergeMenuesForInplace(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xContMenu,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContDisp,
+ const ::rtl::OUString& aContModuleName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xOwnMenu,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xOwnDisp )
+ throw ( ::com::sun::star::uno::Exception );
+
+
+ DocumentHolder( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ OCommonEmbeddedObject* pEmbObj );
+ ~DocumentHolder();
+
+ OCommonEmbeddedObject* GetEmbedObject() { return m_pEmbedObj; }
+
+ void SetComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable >& xDoc, sal_Bool bReadOnly );
+ void ResizeHatchWindow();
+ void LockOffice();
+ void FreeOffice();
+
+ void CloseDocument( sal_Bool bDeliverOwnership, sal_Bool bWaitForClose );
+ void CloseFrame();
+
+ rtl::OUString GetTitle() const
+ {
+ return m_aContainerName + ::rtl::OUString::createFromAscii( " - " ) + m_aDocumentNamePart;
+ }
+
+ rtl::OUString GetContainerName() const { return m_aContainerName; }
+
+ void SetOutplaceFrameProperties( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aProps )
+ { m_aOutplaceFrameProps = aProps; }
+
+ void PlaceFrame( const ::com::sun::star::awt::Rectangle& aNewRect );
+
+ sal_Bool SetFrameLMVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ sal_Bool bVisible );
+
+ sal_Bool ShowInplace( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent,
+ const ::com::sun::star::awt::Rectangle& aRectangleToShow,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContainerDP );
+
+ sal_Bool ShowUI(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContainerLM,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContainerDP,
+ const ::rtl::OUString& aContModuleName );
+ sal_Bool HideUI(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContainerLM );
+
+ void Show();
+
+ // sal_Bool SetVisArea( sal_Int64 nAspect, const ::com::sun::star::awt::Rectangle& aRect );
+ // sal_Bool GetVisArea( sal_Int64 nAspect, ::com::sun::star::awt::Rectangle *pRect );
+ sal_Bool SetExtent( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize );
+ sal_Bool GetExtent( sal_Int64 nAspect, ::com::sun::star::awt::Size *pSize );
+
+ sal_Int32 GetMapUnit( sal_Int64 nAspect );
+
+ void SetOutplaceDispatchInterceptor(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >&
+ xOutplaceInterceptor )
+ {
+ m_xOutplaceInterceptor = xOutplaceInterceptor;
+ }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > GetComponent() { return m_xComponent; }
+
+// XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+// XCloseListener
+ virtual void SAL_CALL queryClosing( const ::com::sun::star::lang::EventObject& Source, sal_Bool GetsOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL notifyClosing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+// XTerminateListener
+ virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+// XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw ( ::com::sun::star::uno::RuntimeException );
+
+// XEventListener
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+// XBorderResizeListener
+ virtual void SAL_CALL borderWidthsChanged( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& aObject, const ::com::sun::star::frame::BorderWidths& aNewSize ) throw (::com::sun::star::uno::RuntimeException);
+
+// XHatchWindowController
+ virtual void SAL_CALL requestPositioning( const ::com::sun::star::awt::Rectangle& aRect ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL calcAdjustedRectangle( const ::com::sun::star::awt::Rectangle& aRect ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL activated( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deactivated( ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
diff --git a/embeddedobj/source/inc/dummyobject.hxx b/embeddedobj/source/inc/dummyobject.hxx
new file mode 100644
index 000000000000..dbda9e4b69d7
--- /dev/null
+++ b/embeddedobj/source/inc/dummyobject.hxx
@@ -0,0 +1,300 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dummyobject.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _INC_DUMMYOBJECT_HXX_
+#define _INC_DUMMYOBJECT_HXX_
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XEmbedPersist.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace embed {
+ class XStorage;
+ }
+ namespace frame {
+ class XModel;
+ class XFrame;
+ }
+ namespace lang {
+ class XMultiServiceFactory;
+ }
+ namespace util {
+ class XCloseListener;
+ }
+ namespace beans {
+ struct PropertyValue;
+ struct NamedValue;
+ }
+}}}
+
+namespace cppu {
+ class OMultiTypeInterfaceContainerHelper;
+}
+
+class ODummyEmbeddedObject : public ::cppu::WeakImplHelper2
+ < ::com::sun::star::embed::XEmbeddedObject
+ , ::com::sun::star::embed::XEmbedPersist >
+{
+ ::osl::Mutex m_aMutex;
+ ::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
+ sal_Bool m_bDisposed;
+
+ ::rtl::OUString m_aEntryName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
+ sal_Int32 m_nObjectState;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
+
+ sal_Int64 m_nCachedAspect;
+ ::com::sun::star::awt::Size m_aCachedSize;
+ sal_Bool m_bHasCachedSize;
+
+ // following information will be used between SaveAs and SaveCompleted
+ sal_Bool m_bWaitSaveCompleted;
+ ::rtl::OUString m_aNewEntryName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
+
+protected:
+ void CheckInit();
+ void PostEvent_Impl( const ::rtl::OUString& aEventName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xSource );
+
+public:
+
+ ODummyEmbeddedObject()
+ : m_pInterfaceContainer( NULL )
+ , m_bDisposed( sal_False )
+ , m_nObjectState( -1 )
+ , m_nCachedAspect( 0 )
+ , m_bHasCachedSize( sal_False )
+ , m_bWaitSaveCompleted( sal_False )
+ {}
+
+ ~ODummyEmbeddedObject();
+
+// XEmbeddedObject
+
+ virtual void SAL_CALL changeState( sal_Int32 nNewState )
+ throw ( ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getCurrentState()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setClientSite(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL update()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setContainerName( const ::rtl::OUString& sName )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+
+// XVisualObject
+
+ virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
+ throw ( ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException);
+
+// XEmbedPersist
+
+ virtual void SAL_CALL setPersistentEntry(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName,
+ sal_Int32 nEntryConnectionMode,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL storeToEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL storeAsEntry(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL hasEntry()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getEntryName()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+
+// XCommonEmbedPersist
+
+ virtual void SAL_CALL storeOwn()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isReadonly()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL reload(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+
+// XClassifiedObject
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getClassName()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setClassInfo(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName )
+ throw ( ::com::sun::star::lang::NoSupportException,
+ ::com::sun::star::uno::RuntimeException );
+
+
+// XComponentSupplier
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+// XStateChangeBroadcaster
+ virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+// XCloseable
+
+ virtual void SAL_CALL close( sal_Bool DeliverOwnership )
+ throw ( ::com::sun::star::util::CloseVetoException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addCloseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeCloseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+// XEventBroadcaster
+ virtual void SAL_CALL addEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+};
+
+#endif
+
diff --git a/embeddedobj/source/inc/intercept.hxx b/embeddedobj/source/inc/intercept.hxx
new file mode 100644
index 000000000000..c9400e04948a
--- /dev/null
+++ b/embeddedobj/source/inc/intercept.hxx
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: intercept.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _INTERCEPT_HXX_
+#define _INTERCEPT_HXX_
+
+#include <osl/mutex.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#include <com/sun/star/frame/XInterceptorInfo.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+
+
+class StatusChangeListenerContainer;
+class DocumentHolder;
+
+class Interceptor : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProviderInterceptor,
+ ::com::sun::star::frame::XInterceptorInfo,
+ ::com::sun::star::frame::XDispatch>
+{
+public:
+
+ Interceptor( DocumentHolder* pDocHolder );
+ ~Interceptor();
+
+ void DisconnectDocHolder();
+ // overwritten to release the statuslistner.
+
+ // XComponent
+ virtual void SAL_CALL
+ addEventListener(
+ const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& xListener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL
+ removeEventListener( const com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >& aListener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ //XDispatch
+ virtual void SAL_CALL
+ dispatch(
+ const ::com::sun::star::util::URL& URL,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue >& Arguments )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL
+ addStatusListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XStatusListener >& Control,
+ const ::com::sun::star::util::URL& URL )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+ virtual void SAL_CALL
+ removeStatusListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XStatusListener >& Control,
+ const ::com::sun::star::util::URL& URL )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+ //XInterceptorInfo
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
+ SAL_CALL getInterceptedURLs( )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+ //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XDispatch > SAL_CALL
+ queryDispatch(
+ const ::com::sun::star::util::URL& URL,
+ const ::rtl::OUString& TargetFrameName,
+ sal_Int32 SearchFlags )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+ virtual ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XDispatch > > SAL_CALL
+ queryDispatches(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::frame::DispatchDescriptor >& Requests )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+
+ //XDispatchProviderInterceptor
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XDispatchProvider > SAL_CALL
+ getSlaveDispatchProvider( )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+ virtual void SAL_CALL
+ setSlaveDispatchProvider(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XDispatchProvider >& NewDispatchProvider )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XDispatchProvider > SAL_CALL
+ getMasterDispatchProvider( )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+ virtual void SAL_CALL
+ setMasterDispatchProvider(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XDispatchProvider >& NewSupplier )
+ throw (
+ ::com::sun::star::uno::RuntimeException
+ );
+
+
+private:
+
+ osl::Mutex m_aMutex;
+
+ DocumentHolder* m_pDocHolder;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatchProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatchProvider;
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aInterceptedURL;
+
+ cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
+ StatusChangeListenerContainer* m_pStatCL;
+};
+
+#endif
+
diff --git a/embeddedobj/source/inc/oleembobj.hxx b/embeddedobj/source/inc/oleembobj.hxx
new file mode 100644
index 000000000000..2b0a51d6c1f0
--- /dev/null
+++ b/embeddedobj/source/inc/oleembobj.hxx
@@ -0,0 +1,547 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: oleembobj.hxx,v $
+ * $Revision: 1.30 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _INC_OLEEMBOBJ_HXX_
+#define _INC_OLEEMBOBJ_HXX_
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XInplaceObject.hpp>
+#include <com/sun/star/embed/XVisualObject.hpp>
+#include <com/sun/star/embed/XEmbedPersist.hpp>
+#include <com/sun/star/embed/XLinkageSupport.hpp>
+#include <com/sun/star/embed/XClassifiedObject.hpp>
+#include <com/sun/star/embed/XComponentSupplier.hpp>
+#include <com/sun/star/embed/VerbDescriptor.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/util/XCloseListener.hpp>
+#include <cppuhelper/implbase5.hxx>
+
+#include <osl/thread.h>
+
+namespace cppu {
+ class OMultiTypeInterfaceContainerHelper;
+}
+
+class VerbExecutionController
+{
+ // the following mutex is allowed to be locked only for variables initialization, so no deadlock can be caused
+ ::osl::Mutex m_aVerbExecutionMutex;
+
+ sal_Bool m_bVerbExecutionInProgress;
+ oslThreadIdentifier m_nVerbExecutionThreadIdentifier;
+ sal_Bool m_bChangedOnVerbExecution;
+
+ sal_Bool m_bWasEverActive;
+ sal_Int32 m_nNotificationLock;
+
+public:
+
+ VerbExecutionController()
+ : m_bVerbExecutionInProgress( sal_False )
+ , m_nVerbExecutionThreadIdentifier( 0 )
+ , m_bChangedOnVerbExecution( sal_False )
+ , m_bWasEverActive( sal_False )
+ , m_nNotificationLock( 0 )
+ {}
+#ifdef WNT
+ void StartControlExecution();
+ sal_Bool EndControlExecution_WasModified();
+ void ModificationNotificationIsDone();
+#endif
+ void LockNotification();
+ void UnlockNotification();
+
+ // no need to lock anything to check the value of the numeric members
+ sal_Bool CanDoNotification() { return ( !m_bVerbExecutionInProgress && !m_bWasEverActive && !m_nNotificationLock ); }
+ // ... or to change it
+ void ObjectIsActive() { m_bWasEverActive = sal_True; }
+};
+
+class VerbExecutionControllerGuard
+{
+ VerbExecutionController& m_rController;
+public:
+
+ VerbExecutionControllerGuard( VerbExecutionController& rController )
+ : m_rController( rController )
+ {
+ m_rController.LockNotification();
+ }
+
+ ~VerbExecutionControllerGuard()
+ {
+ m_rController.UnlockNotification();
+ }
+};
+
+
+class OleComponent;
+class OwnView_Impl;
+class OleEmbeddedObject : public ::cppu::WeakImplHelper5
+ < ::com::sun::star::embed::XEmbeddedObject
+ , ::com::sun::star::embed::XEmbedPersist
+ , ::com::sun::star::embed::XLinkageSupport
+ , ::com::sun::star::embed::XInplaceObject
+ , ::com::sun::star::container::XChild >
+{
+ friend class OleComponent;
+
+ ::osl::Mutex m_aMutex;
+
+ OleComponent* m_pOleComponent;
+
+ ::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
+
+ sal_Bool m_bReadOnly;
+
+ sal_Int32 m_bDisposed;
+ sal_Int32 m_nObjectState;
+ sal_Int32 m_nTargetState;
+ sal_Int32 m_nUpdateMode;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+
+ ::com::sun::star::uno::Sequence< sal_Int8 > m_aClassID;
+ ::rtl::OUString m_aClassName;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
+
+ ::rtl::OUString m_aContainerName;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener > m_xClosePreventer;
+
+ sal_Bool m_bWaitSaveCompleted;
+ sal_Bool m_bNewVisReplInStream;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xNewCachedVisRepl;
+ ::rtl::OUString m_aNewEntryName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xNewObjectStream;
+ sal_Bool m_bStoreLoaded;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xCachedVisualRepresentation;
+ sal_Bool m_bVisReplInitialized;
+ sal_Bool m_bVisReplInStream;
+ sal_Bool m_bStoreVisRepl;
+
+ sal_Bool m_bIsLink;
+
+ // TODO/LATER: may need to cache more than one aspect in future
+ sal_Bool m_bHasCachedSize; // the object has cached size
+ ::com::sun::star::awt::Size m_aCachedSize;
+ sal_Int64 m_nCachedAspect;
+
+ sal_Bool m_bHasSizeToSet; // the object has cached size that should be set to OLE component
+ ::com::sun::star::awt::Size m_aSizeToSet; // this size might be different from the cached one ( scaling is applied )
+ sal_Int64 m_nAspectToSet;
+
+
+ // cache the status of the object
+ // TODO/LATER: may need to cache more than one aspect in future
+ sal_Bool m_bGotStatus;
+ sal_Int64 m_nStatus;
+ sal_Int64 m_nStatusAspect;
+
+ // embedded object related stuff
+ ::rtl::OUString m_aEntryName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xObjectStream;
+
+ // link related stuff
+ ::rtl::OUString m_aLinkURL; // ???
+
+ // points to own view provider if the the object has no server
+ OwnView_Impl* m_pOwnView;
+
+ // whether the object should be initialized from clipboard in case of default initialization
+ sal_Bool m_bFromClipboard;
+
+ ::rtl::OUString m_aTempURL;
+
+ // STAMPIT solution
+ // the following member is used during verb execution to detect whether the verb execution modifies the object
+ VerbExecutionController m_aVerbExecutionController;
+
+ // if the following member is set, the object works in wrapper mode
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > m_xWrappedObject;
+ sal_Bool m_bTriedConversion;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
+
+protected:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > TryToGetAcceptableFormat_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream )
+ throw ( ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetNewFilledTempStream_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
+ throw( ::com::sun::star::io::IOException );
+#ifdef WNT
+ void SwitchComponentToRunningState_Impl();
+#endif
+ void MakeEventListenerNotification_Impl( const ::rtl::OUString& aEventName );
+#ifdef WNT
+ void StateChangeNotification_Impl( sal_Bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState );
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > GetStreamForSaving();
+
+
+ ::com::sun::star::uno::Sequence< sal_Int32 > GetIntermediateVerbsSequence_Impl( sal_Int32 nNewState );
+
+ ::com::sun::star::uno::Sequence< sal_Int32 > GetReachableStatesList_Impl(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor >& aVerbList );
+#endif
+
+ void CloseComponent();
+ void Dispose();
+
+ void SwitchOwnPersistence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xNewObjectStream,
+ const ::rtl::OUString& aNewName );
+
+ void SwitchOwnPersistence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
+ const ::rtl::OUString& aNewName );
+
+ void GetRidOfComponent();
+
+ void StoreToLocation_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs,
+ sal_Bool bSaveAs )
+ throw ( ::com::sun::star::uno::Exception );
+#ifdef WNT
+ void StoreObjectToStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutStream )
+ throw ( ::com::sun::star::uno::Exception );
+#endif
+ void InsertVisualCache_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xCachedVisualRepresentation )
+ throw ( ::com::sun::star::uno::Exception );
+
+ void RemoveVisualCache_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
+ throw ( ::com::sun::star::uno::Exception );
+
+ void SetVisReplInStream( sal_Bool bExists );
+ sal_Bool HasVisReplInStream();
+
+ ::com::sun::star::embed::VisualRepresentation GetVisualRepresentationInNativeFormat_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xCachedVisRepr )
+ throw ( ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > TryToRetrieveCachedVisualRepresentation_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream,
+ sal_Bool bAllowRepair50 = sal_False )
+ throw ();
+#ifdef WNT
+ sal_Bool SaveObject_Impl();
+ sal_Bool OnShowWindow_Impl( sal_Bool bShow );
+ void CreateOleComponent_Impl( OleComponent* pOleComponent = NULL );
+ void CreateOleComponentAndLoad_Impl( OleComponent* pOleComponent = NULL );
+ void CreateOleComponentFromClipboard_Impl( OleComponent* pOleComponent = NULL );
+#endif
+ void SetObjectIsLink_Impl( sal_Bool bIsLink ) { m_bIsLink = bIsLink; }
+
+#ifdef WNT
+ ::rtl::OUString CreateTempURLEmpty_Impl();
+ ::rtl::OUString GetTempURL_Impl();
+#endif
+ ::rtl::OUString GetContainerName_Impl() { return m_aContainerName; }
+
+ // the following 4 methods are related to switch to wrapping mode
+ void MoveListeners();
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > CreateTemporarySubstorage( ::rtl::OUString& o_aStorageName );
+ ::rtl::OUString MoveToTemporarySubstream();
+ sal_Bool TryToConvertToOOo();
+
+public:
+ // in case a new object must be created the class ID must be specified
+ OleEmbeddedObject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID,
+ const ::rtl::OUString& aClassName );
+
+ // in case object will be loaded from a persistent entry or from a file the class ID will be detected on loading
+ // factory can do it for OOo objects, but for OLE objects OS dependent code is required
+ OleEmbeddedObject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ sal_Bool bLink );
+#ifdef WNT
+ // this constructor let object be initialized from clipboard
+ OleEmbeddedObject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+#endif
+
+ virtual ~OleEmbeddedObject();
+
+#ifdef WNT
+ void OnIconChanged_Impl();
+ void OnViewChanged_Impl();
+ void OnClosed_Impl();
+#endif
+
+// XEmbeddedObject
+
+ virtual void SAL_CALL changeState( sal_Int32 nNewState )
+ throw ( ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getCurrentState()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setClientSite(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL update()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setContainerName( const ::rtl::OUString& sName )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+
+// XVisualObject
+
+ virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
+ throw ( ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException);
+
+
+// XEmbedPersist
+
+ virtual void SAL_CALL setPersistentEntry(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName,
+ sal_Int32 nEntryConnectionMode,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL storeToEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL storeAsEntry(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL hasEntry()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getEntryName()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+// XLinkageSupport
+
+ virtual void SAL_CALL breakLink( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
+ const ::rtl::OUString& sEntName )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isLink()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL getLinkURL()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException);
+
+// XCommonEmbedPersist
+ virtual void SAL_CALL storeOwn()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isReadonly()
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL reload(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+// XClassifiedObject
+
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getClassName()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setClassInfo(
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName )
+ throw ( ::com::sun::star::lang::NoSupportException,
+ ::com::sun::star::uno::RuntimeException );
+
+// XStateChangeBroadcaster
+ virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+
+// XComponentSupplier
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+// XCloseable
+
+ virtual void SAL_CALL close( sal_Bool DeliverOwnership )
+ throw ( ::com::sun::star::util::CloseVetoException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addCloseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeCloseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+// XEventBroadcaster
+ virtual void SAL_CALL addEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+// XInplaceObject ( only for wrapping scenario here )
+
+ virtual void SAL_CALL setObjectRectangles( const ::com::sun::star::awt::Rectangle& aPosRect,
+ const ::com::sun::star::awt::Rectangle& aClipRect )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL enableModeless( sal_Bool bEnable )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL translateAccelerators(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyEvent >& aKeys )
+ throw ( ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // XChild ( only for wrapping scenario here )
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+};
+
+#endif
+
diff --git a/embeddedobj/source/inc/specialobject.hxx b/embeddedobj/source/inc/specialobject.hxx
new file mode 100644
index 000000000000..02436df1f4b0
--- /dev/null
+++ b/embeddedobj/source/inc/specialobject.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: specialobject.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _INC_SPECIALOBJECT_HXX_
+#define _INC_SPECIALOBJECT_HXX_
+
+#include <com/sun/star/awt/Size.hpp>
+
+#include "commonembobj.hxx"
+
+class OSpecialEmbeddedObject : public OCommonEmbeddedObject
+{
+private:
+ com::sun::star::awt::Size maSize;
+public:
+ OSpecialEmbeddedObject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
+ throw( ::com::sun::star::uno::RuntimeException ) ;
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
+ throw( ::com::sun::star::uno::RuntimeException ) ;
+
+ // XVisualObject
+ virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
+ throw ( ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL changeState( sal_Int32 nNewState )
+ throw ( ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
+ throw ( ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::embed::WrongStateException,
+ ::com::sun::star::embed::UnreachableStateException,
+ ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException );
+};
+
+#endif
+
diff --git a/embeddedobj/source/inc/targetstatecontrol.hxx b/embeddedobj/source/inc/targetstatecontrol.hxx
new file mode 100644
index 000000000000..73c0287e49c6
--- /dev/null
+++ b/embeddedobj/source/inc/targetstatecontrol.hxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: targetstatecontrol.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <sal/types.h>
+#include <osl/diagnose.h>
+
+class TargetStateControl_Impl
+{
+ sal_Int32& m_nTargetStateVariable;
+public:
+ TargetStateControl_Impl( sal_Int32& nVariable, sal_Int32 nValue )
+ : m_nTargetStateVariable( nVariable )
+ {
+ OSL_ENSURE( m_nTargetStateVariable == -1, "The target state variable is not initialized properly!\n" );
+ m_nTargetStateVariable = nValue;
+ }
+
+ ~TargetStateControl_Impl()
+ {
+ m_nTargetStateVariable = -1;
+ }
+};
+
+
diff --git a/embeddedobj/source/inc/xcreator.hxx b/embeddedobj/source/inc/xcreator.hxx
new file mode 100644
index 000000000000..c4e15b12d7ca
--- /dev/null
+++ b/embeddedobj/source/inc/xcreator.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xcreator.hxx,v $
+ * $Revision: 1.10 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __XCREATOR_HXX_
+#define __XCREATOR_HXX_
+
+#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
+#include <com/sun/star/embed/XEmbedObjectFactory.hpp>
+#include <com/sun/star/embed/XLinkCreator.hpp>
+#include <com/sun/star/embed/XLinkFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+
+#include <cppuhelper/implbase5.hxx>
+#include <comphelper/mimeconfighelper.hxx>
+
+class UNOEmbeddedObjectCreator : public ::cppu::WeakImplHelper5<
+ ::com::sun::star::embed::XEmbedObjectCreator,
+ ::com::sun::star::embed::XEmbedObjectFactory,
+ ::com::sun::star::embed::XLinkCreator,
+ ::com::sun::star::embed::XLinkFactory,
+ ::com::sun::star::lang::XServiceInfo >
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+
+ ::comphelper::MimeConfigurationHelper m_aConfigHelper;
+public:
+ UNOEmbeddedObjectCreator(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
+ : m_xFactory( xFactory )
+ , m_aConfigHelper( xFactory )
+ {
+ OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" );
+ }
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames();
+
+ static ::rtl::OUString SAL_CALL impl_staticGetImplementationName();
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ impl_staticCreateSelfInstance(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+
+
+ // XEmbedObjectCreator
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceInitNew( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceInitFromEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMedDescr, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceInitFromMediaDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XEmbedObjectFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& sClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, sal_Int32 nEntryConnectionMode, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aObjectArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XLinkCreator
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLink( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XLinkFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLinkUserInit( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aClassID, const ::rtl::OUString& sClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntryName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aObjectArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+#endif
+