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