1*08421ca6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*08421ca6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*08421ca6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*08421ca6SAndrew Rist  * distributed with this work for additional information
6*08421ca6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*08421ca6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*08421ca6SAndrew Rist  * "License"); you may not use this file except in compliance
9*08421ca6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*08421ca6SAndrew Rist  *
11*08421ca6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*08421ca6SAndrew Rist  *
13*08421ca6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*08421ca6SAndrew Rist  * software distributed under the License is distributed on an
15*08421ca6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*08421ca6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*08421ca6SAndrew Rist  * specific language governing permissions and limitations
18*08421ca6SAndrew Rist  * under the License.
19*08421ca6SAndrew Rist  *
20*08421ca6SAndrew Rist  *************************************************************/
21*08421ca6SAndrew Rist 
22*08421ca6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _INC_OLEEMBOBJ_HXX_
25cdf0e10cSrcweir #define _INC_OLEEMBOBJ_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
28cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
29cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
30cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
31cdf0e10cSrcweir #include <com/sun/star/embed/XInplaceObject.hpp>
32cdf0e10cSrcweir #include <com/sun/star/embed/XVisualObject.hpp>
33cdf0e10cSrcweir #include <com/sun/star/embed/XEmbedPersist.hpp>
34cdf0e10cSrcweir #include <com/sun/star/embed/XLinkageSupport.hpp>
35cdf0e10cSrcweir #include <com/sun/star/embed/XClassifiedObject.hpp>
36cdf0e10cSrcweir #include <com/sun/star/embed/XComponentSupplier.hpp>
37cdf0e10cSrcweir #include <com/sun/star/embed/VerbDescriptor.hpp>
38cdf0e10cSrcweir #include <com/sun/star/document/XEventBroadcaster.hpp>
39cdf0e10cSrcweir #include <com/sun/star/container/XChild.hpp>
40cdf0e10cSrcweir #include <com/sun/star/util/XCloseable.hpp>
41cdf0e10cSrcweir #include <com/sun/star/util/XCloseListener.hpp>
42cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #include <osl/thread.h>
45cdf0e10cSrcweir 
46cdf0e10cSrcweir namespace cppu {
47cdf0e10cSrcweir 	class OMultiTypeInterfaceContainerHelper;
48cdf0e10cSrcweir }
49cdf0e10cSrcweir 
50cdf0e10cSrcweir class VerbExecutionController
51cdf0e10cSrcweir {
52cdf0e10cSrcweir 	// the following mutex is allowed to be locked only for variables initialization, so no deadlock can be caused
53cdf0e10cSrcweir 	::osl::Mutex	m_aVerbExecutionMutex;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	sal_Bool m_bVerbExecutionInProgress;
56cdf0e10cSrcweir 	oslThreadIdentifier m_nVerbExecutionThreadIdentifier;
57cdf0e10cSrcweir 	sal_Bool m_bChangedOnVerbExecution;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	sal_Bool m_bWasEverActive;
60cdf0e10cSrcweir 	sal_Int32 m_nNotificationLock;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir public:
63cdf0e10cSrcweir 
VerbExecutionController()64cdf0e10cSrcweir 	VerbExecutionController()
65cdf0e10cSrcweir 	: m_bVerbExecutionInProgress( sal_False )
66cdf0e10cSrcweir 	, m_nVerbExecutionThreadIdentifier( 0 )
67cdf0e10cSrcweir 	, m_bChangedOnVerbExecution( sal_False )
68cdf0e10cSrcweir 	, m_bWasEverActive( sal_False )
69cdf0e10cSrcweir 	, m_nNotificationLock( 0 )
70cdf0e10cSrcweir 	{}
71cdf0e10cSrcweir #ifdef WNT
72cdf0e10cSrcweir 	void StartControlExecution();
73cdf0e10cSrcweir 	sal_Bool EndControlExecution_WasModified();
74cdf0e10cSrcweir 	void ModificationNotificationIsDone();
75cdf0e10cSrcweir #endif
76cdf0e10cSrcweir 	void LockNotification();
77cdf0e10cSrcweir 	void UnlockNotification();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	// no need to lock anything to check the value of the numeric members
CanDoNotification()80cdf0e10cSrcweir 	sal_Bool CanDoNotification() { return ( !m_bVerbExecutionInProgress && !m_bWasEverActive && !m_nNotificationLock ); }
81cdf0e10cSrcweir 	// ... or to change it
ObjectIsActive()82cdf0e10cSrcweir 	void ObjectIsActive() { m_bWasEverActive = sal_True; }
83cdf0e10cSrcweir };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir class VerbExecutionControllerGuard
86cdf0e10cSrcweir {
87cdf0e10cSrcweir 	VerbExecutionController& m_rController;
88cdf0e10cSrcweir public:
89cdf0e10cSrcweir 
VerbExecutionControllerGuard(VerbExecutionController & rController)90cdf0e10cSrcweir 	VerbExecutionControllerGuard( VerbExecutionController& rController )
91cdf0e10cSrcweir 	: m_rController( rController )
92cdf0e10cSrcweir 	{
93cdf0e10cSrcweir 		m_rController.LockNotification();
94cdf0e10cSrcweir 	}
95cdf0e10cSrcweir 
~VerbExecutionControllerGuard()96cdf0e10cSrcweir 	~VerbExecutionControllerGuard()
97cdf0e10cSrcweir 	{
98cdf0e10cSrcweir 		m_rController.UnlockNotification();
99cdf0e10cSrcweir 	}
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir class OleComponent;
104cdf0e10cSrcweir class OwnView_Impl;
105cdf0e10cSrcweir class OleEmbeddedObject : public ::cppu::WeakImplHelper5
106cdf0e10cSrcweir 						< ::com::sun::star::embed::XEmbeddedObject
107cdf0e10cSrcweir 						, ::com::sun::star::embed::XEmbedPersist
108cdf0e10cSrcweir 						, ::com::sun::star::embed::XLinkageSupport
109cdf0e10cSrcweir                         , ::com::sun::star::embed::XInplaceObject
110cdf0e10cSrcweir                         , ::com::sun::star::container::XChild >
111cdf0e10cSrcweir {
112cdf0e10cSrcweir 	friend class OleComponent;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	::osl::Mutex	m_aMutex;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 	OleComponent*	m_pOleComponent;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	sal_Bool m_bReadOnly;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	sal_Int32 m_bDisposed;
123cdf0e10cSrcweir 	sal_Int32 m_nObjectState;
124cdf0e10cSrcweir 	sal_Int32 m_nTargetState;
125cdf0e10cSrcweir 	sal_Int32 m_nUpdateMode;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< sal_Int8 > m_aClassID;
130cdf0e10cSrcweir 	::rtl::OUString m_aClassName;
131cdf0e10cSrcweir 
132cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	::rtl::OUString m_aContainerName;
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener > m_xClosePreventer;
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 	sal_Bool m_bWaitSaveCompleted;
139cdf0e10cSrcweir 	sal_Bool m_bNewVisReplInStream;
140cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xNewCachedVisRepl;
141cdf0e10cSrcweir 	::rtl::OUString m_aNewEntryName;
142cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
143cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xNewObjectStream;
144cdf0e10cSrcweir 	sal_Bool m_bStoreLoaded;
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xCachedVisualRepresentation;
147cdf0e10cSrcweir 	sal_Bool m_bVisReplInitialized;
148cdf0e10cSrcweir 	sal_Bool m_bVisReplInStream;
149cdf0e10cSrcweir 	sal_Bool m_bStoreVisRepl;
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 	sal_Bool m_bIsLink;
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	// TODO/LATER: may need to cache more than one aspect in future
154cdf0e10cSrcweir 	sal_Bool m_bHasCachedSize; // the object has cached size
155cdf0e10cSrcweir 	::com::sun::star::awt::Size m_aCachedSize;
156cdf0e10cSrcweir 	sal_Int64 m_nCachedAspect;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 	sal_Bool m_bHasSizeToSet;  // the object has cached size that should be set to OLE component
159cdf0e10cSrcweir 	::com::sun::star::awt::Size m_aSizeToSet; // this size might be different from the cached one ( scaling is applied )
160cdf0e10cSrcweir 	sal_Int64 m_nAspectToSet;
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 	// cache the status of the object
164cdf0e10cSrcweir 	// TODO/LATER: may need to cache more than one aspect in future
165cdf0e10cSrcweir 	sal_Bool m_bGotStatus;
166cdf0e10cSrcweir 	sal_Int64 m_nStatus;
167cdf0e10cSrcweir 	sal_Int64 m_nStatusAspect;
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 	// embedded object related stuff
170cdf0e10cSrcweir 	::rtl::OUString m_aEntryName;
171cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
172cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xObjectStream;
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 	// link related stuff
175cdf0e10cSrcweir 	::rtl::OUString m_aLinkURL; // ???
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	// points to own view provider if the the object has no server
178cdf0e10cSrcweir 	OwnView_Impl*	m_pOwnView;
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 	// whether the object should be initialized from clipboard in case of default initialization
181cdf0e10cSrcweir 	sal_Bool m_bFromClipboard;
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	::rtl::OUString m_aTempURL;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	::rtl::OUString m_aTempDumpURL;
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 	// STAMPIT solution
188cdf0e10cSrcweir 	// the following member is used during verb execution to detect whether the verb execution modifies the object
189cdf0e10cSrcweir 	VerbExecutionController m_aVerbExecutionController;
190cdf0e10cSrcweir 
191cdf0e10cSrcweir     // if the following member is set, the object works in wrapper mode
192cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > m_xWrappedObject;
193cdf0e10cSrcweir     sal_Bool m_bTriedConversion;
194cdf0e10cSrcweir 
195cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
196cdf0e10cSrcweir 
197cdf0e10cSrcweir protected:
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > TryToGetAcceptableFormat_Impl(
200cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream )
201cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception );
202cdf0e10cSrcweir 
203cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetNewFilledTempStream_Impl(
204cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
205cdf0e10cSrcweir 		throw( ::com::sun::star::io::IOException );
206cdf0e10cSrcweir #ifdef WNT
207cdf0e10cSrcweir 	void SwitchComponentToRunningState_Impl();
208cdf0e10cSrcweir #endif
209cdf0e10cSrcweir 	void MakeEventListenerNotification_Impl( const ::rtl::OUString& aEventName );
210cdf0e10cSrcweir #ifdef WNT
211cdf0e10cSrcweir 	void StateChangeNotification_Impl( sal_Bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState );
212cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > GetStreamForSaving();
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< sal_Int32 > GetIntermediateVerbsSequence_Impl( sal_Int32 nNewState );
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< sal_Int32 > GetReachableStatesList_Impl(
218cdf0e10cSrcweir 						const ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor >& aVerbList );
219cdf0e10cSrcweir #endif
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 	void CloseComponent();
222cdf0e10cSrcweir 	void Dispose();
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 	void SwitchOwnPersistence(
225cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
226cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xNewObjectStream,
227cdf0e10cSrcweir 				const ::rtl::OUString& aNewName );
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	void SwitchOwnPersistence(
230cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
231cdf0e10cSrcweir 				const ::rtl::OUString& aNewName );
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 	void GetRidOfComponent();
234cdf0e10cSrcweir 
235cdf0e10cSrcweir 	void StoreToLocation_Impl(
236cdf0e10cSrcweir 							const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
237cdf0e10cSrcweir 							const ::rtl::OUString& sEntName,
238cdf0e10cSrcweir 							const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
239cdf0e10cSrcweir 							const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs,
240cdf0e10cSrcweir 							sal_Bool bSaveAs )
241cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception );
242cdf0e10cSrcweir #ifdef WNT
243cdf0e10cSrcweir 	void StoreObjectToStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutStream )
244cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception );
245cdf0e10cSrcweir #endif
246cdf0e10cSrcweir 	void InsertVisualCache_Impl(
247cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream,
248cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xCachedVisualRepresentation )
249cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception );
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 	void RemoveVisualCache_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
252cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception );
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 	void SetVisReplInStream( sal_Bool bExists );
255cdf0e10cSrcweir 	sal_Bool HasVisReplInStream();
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 	::com::sun::star::embed::VisualRepresentation GetVisualRepresentationInNativeFormat_Impl(
258cdf0e10cSrcweir 					const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xCachedVisRepr )
259cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception );
260cdf0e10cSrcweir 
261cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > TryToRetrieveCachedVisualRepresentation_Impl(
262cdf0e10cSrcweir 					const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream,
263cdf0e10cSrcweir 					sal_Bool bAllowRepair50 = sal_False )
264cdf0e10cSrcweir 		throw ();
265cdf0e10cSrcweir #ifdef WNT
266cdf0e10cSrcweir 	sal_Bool SaveObject_Impl();
267cdf0e10cSrcweir 	sal_Bool OnShowWindow_Impl( sal_Bool bShow );
268cdf0e10cSrcweir 	void CreateOleComponent_Impl( OleComponent* pOleComponent = NULL );
269cdf0e10cSrcweir 	void CreateOleComponentAndLoad_Impl( OleComponent* pOleComponent = NULL );
270cdf0e10cSrcweir 	void CreateOleComponentFromClipboard_Impl( OleComponent* pOleComponent = NULL );
271cdf0e10cSrcweir #endif
SetObjectIsLink_Impl(sal_Bool bIsLink)272cdf0e10cSrcweir 	void SetObjectIsLink_Impl( sal_Bool bIsLink ) { m_bIsLink = bIsLink; }
273cdf0e10cSrcweir 
274cdf0e10cSrcweir #ifdef WNT
275cdf0e10cSrcweir 	::rtl::OUString CreateTempURLEmpty_Impl();
276cdf0e10cSrcweir 	::rtl::OUString GetTempURL_Impl();
277cdf0e10cSrcweir #endif
GetContainerName_Impl()278cdf0e10cSrcweir 	::rtl::OUString GetContainerName_Impl() { return m_aContainerName; }
279cdf0e10cSrcweir 
280cdf0e10cSrcweir     // the following 4 methods are related to switch to wrapping mode
281cdf0e10cSrcweir     void MoveListeners();
282cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > CreateTemporarySubstorage( ::rtl::OUString& o_aStorageName );
283cdf0e10cSrcweir     ::rtl::OUString MoveToTemporarySubstream();
284cdf0e10cSrcweir     sal_Bool TryToConvertToOOo();
285cdf0e10cSrcweir 
286cdf0e10cSrcweir public:
287cdf0e10cSrcweir 	// in case a new object must be created the class ID must be specified
288cdf0e10cSrcweir 	OleEmbeddedObject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
289cdf0e10cSrcweir 						const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID,
290cdf0e10cSrcweir 						const ::rtl::OUString& aClassName );
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	// in case object will be loaded from a persistent entry or from a file the class ID will be detected on loading
293cdf0e10cSrcweir 	// factory can do it for OOo objects, but for OLE objects OS dependent code is required
294cdf0e10cSrcweir 	OleEmbeddedObject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
295cdf0e10cSrcweir 						sal_Bool bLink );
296cdf0e10cSrcweir #ifdef WNT
297cdf0e10cSrcweir 	// this constructor let object be initialized from clipboard
298cdf0e10cSrcweir 	OleEmbeddedObject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
299cdf0e10cSrcweir #endif
300cdf0e10cSrcweir 
301cdf0e10cSrcweir     virtual ~OleEmbeddedObject();
302cdf0e10cSrcweir 
303cdf0e10cSrcweir #ifdef WNT
304cdf0e10cSrcweir     void OnIconChanged_Impl();
305cdf0e10cSrcweir     void OnViewChanged_Impl();
306cdf0e10cSrcweir     void OnClosed_Impl();
307cdf0e10cSrcweir #endif
308cdf0e10cSrcweir 
309cdf0e10cSrcweir // XEmbeddedObject
310cdf0e10cSrcweir 
311cdf0e10cSrcweir     virtual void SAL_CALL changeState( sal_Int32 nNewState )
312cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::UnreachableStateException,
313cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
314cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
315cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
316cdf0e10cSrcweir 
317cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
318cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
319cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
320cdf0e10cSrcweir 
321cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getCurrentState()
322cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
323cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
324cdf0e10cSrcweir 
325cdf0e10cSrcweir     virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
326cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
327cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
328cdf0e10cSrcweir 				::com::sun::star::embed::UnreachableStateException,
329cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
330cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
331cdf0e10cSrcweir 
332cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
333cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
334cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
335cdf0e10cSrcweir 
336cdf0e10cSrcweir     virtual void SAL_CALL setClientSite(
337cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
338cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
339cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
342cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
343cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
344cdf0e10cSrcweir 
345cdf0e10cSrcweir     virtual void SAL_CALL update()
346cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
347cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
348cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
349cdf0e10cSrcweir 
350cdf0e10cSrcweir     virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
351cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
352cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
353cdf0e10cSrcweir 
354cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
355cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
356cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
357cdf0e10cSrcweir 
358cdf0e10cSrcweir     virtual void SAL_CALL setContainerName( const ::rtl::OUString& sName )
359cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 
362cdf0e10cSrcweir // XVisualObject
363cdf0e10cSrcweir 
364cdf0e10cSrcweir     virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
365cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
366cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
367cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
368cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
369cdf0e10cSrcweir 
370cdf0e10cSrcweir     virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
371cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
372cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
373cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
374cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
375cdf0e10cSrcweir 
376cdf0e10cSrcweir     virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
377cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
378cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
379cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
380cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
381cdf0e10cSrcweir 
382cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
383cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception,
384cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException);
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 
387cdf0e10cSrcweir // XEmbedPersist
388cdf0e10cSrcweir 
389cdf0e10cSrcweir     virtual void SAL_CALL setPersistentEntry(
390cdf0e10cSrcweir 					const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
391cdf0e10cSrcweir 					const ::rtl::OUString& sEntName,
392cdf0e10cSrcweir 					sal_Int32 nEntryConnectionMode,
393cdf0e10cSrcweir 					const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
394cdf0e10cSrcweir 					const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
395cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
396cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
397cdf0e10cSrcweir 				::com::sun::star::io::IOException,
398cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
399cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
400cdf0e10cSrcweir 
401cdf0e10cSrcweir     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 )
402cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
403cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
404cdf0e10cSrcweir 				::com::sun::star::io::IOException,
405cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
406cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
407cdf0e10cSrcweir 
408cdf0e10cSrcweir     virtual void SAL_CALL storeAsEntry(
409cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
410cdf0e10cSrcweir 				const ::rtl::OUString& sEntName,
411cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
412cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
413cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
414cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
415cdf0e10cSrcweir 				::com::sun::star::io::IOException,
416cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
417cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
418cdf0e10cSrcweir 
419cdf0e10cSrcweir     virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
420cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
421cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
422cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
423cdf0e10cSrcweir 
424cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasEntry()
425cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
426cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
427cdf0e10cSrcweir 
428cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getEntryName()
429cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
430cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
431cdf0e10cSrcweir 
432cdf0e10cSrcweir // XLinkageSupport
433cdf0e10cSrcweir 
434cdf0e10cSrcweir 	virtual void SAL_CALL breakLink( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
435cdf0e10cSrcweir 									 const ::rtl::OUString& sEntName )
436cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
437cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
438cdf0e10cSrcweir 				::com::sun::star::io::IOException,
439cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
440cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
441cdf0e10cSrcweir 
442cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isLink()
443cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
444cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException);
445cdf0e10cSrcweir 
446cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getLinkURL()
447cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
448cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
449cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException);
450cdf0e10cSrcweir 
451cdf0e10cSrcweir // XCommonEmbedPersist
452cdf0e10cSrcweir     virtual void SAL_CALL storeOwn()
453cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
454cdf0e10cSrcweir 				::com::sun::star::io::IOException,
455cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
456cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
457cdf0e10cSrcweir 
458cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isReadonly()
459cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
460cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
461cdf0e10cSrcweir 
462cdf0e10cSrcweir     virtual void SAL_CALL reload(
463cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
464cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
465cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
466cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
467cdf0e10cSrcweir 				::com::sun::star::io::IOException,
468cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
469cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
470cdf0e10cSrcweir 
471cdf0e10cSrcweir // XClassifiedObject
472cdf0e10cSrcweir 
473cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
474cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
475cdf0e10cSrcweir 
476cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getClassName()
477cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
478cdf0e10cSrcweir 
479cdf0e10cSrcweir     virtual void SAL_CALL setClassInfo(
480cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName )
481cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::NoSupportException,
482cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
483cdf0e10cSrcweir 
484cdf0e10cSrcweir // XStateChangeBroadcaster
485cdf0e10cSrcweir     virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
486cdf0e10cSrcweir     virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
487cdf0e10cSrcweir 
488cdf0e10cSrcweir 
489cdf0e10cSrcweir // XComponentSupplier
490cdf0e10cSrcweir 
491cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
492cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
493cdf0e10cSrcweir 
494cdf0e10cSrcweir // XCloseable
495cdf0e10cSrcweir 
496cdf0e10cSrcweir     virtual void SAL_CALL close( sal_Bool DeliverOwnership )
497cdf0e10cSrcweir 		throw ( ::com::sun::star::util::CloseVetoException,
498cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
499cdf0e10cSrcweir 
500cdf0e10cSrcweir     virtual void SAL_CALL addCloseListener(
501cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
502cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
503cdf0e10cSrcweir 
504cdf0e10cSrcweir     virtual void SAL_CALL removeCloseListener(
505cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
506cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
507cdf0e10cSrcweir 
508cdf0e10cSrcweir // XEventBroadcaster
509cdf0e10cSrcweir     virtual void SAL_CALL addEventListener(
510cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
511cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
512cdf0e10cSrcweir 
513cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener(
514cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
515cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
516cdf0e10cSrcweir 
517cdf0e10cSrcweir // XInplaceObject ( only for wrapping scenario here )
518cdf0e10cSrcweir 
519cdf0e10cSrcweir     virtual void SAL_CALL setObjectRectangles( const ::com::sun::star::awt::Rectangle& aPosRect,
520cdf0e10cSrcweir                                           const ::com::sun::star::awt::Rectangle& aClipRect )
521cdf0e10cSrcweir         throw ( ::com::sun::star::embed::WrongStateException,
522cdf0e10cSrcweir                 ::com::sun::star::uno::Exception,
523cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
524cdf0e10cSrcweir 
525cdf0e10cSrcweir     virtual void SAL_CALL enableModeless( sal_Bool bEnable )
526cdf0e10cSrcweir         throw ( ::com::sun::star::embed::WrongStateException,
527cdf0e10cSrcweir                 ::com::sun::star::uno::Exception,
528cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
529cdf0e10cSrcweir 
530cdf0e10cSrcweir     virtual void SAL_CALL translateAccelerators(
531cdf0e10cSrcweir                     const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyEvent >& aKeys )
532cdf0e10cSrcweir         throw ( ::com::sun::star::embed::WrongStateException,
533cdf0e10cSrcweir                 ::com::sun::star::uno::RuntimeException );
534cdf0e10cSrcweir 
535cdf0e10cSrcweir     // XChild ( only for wrapping scenario here )
536cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  ) throw (::com::sun::star::uno::RuntimeException);
537cdf0e10cSrcweir     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);
538cdf0e10cSrcweir 
539cdf0e10cSrcweir };
540cdf0e10cSrcweir 
541cdf0e10cSrcweir #endif
542cdf0e10cSrcweir 
543