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