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 _WRITESTREAM_HXX_ 29 #define _WRITESTREAM_HXX_ 30 31 #include <com/sun/star/io/XInputStream.hpp> 32 #include <com/sun/star/io/XOutputStream.hpp> 33 #include <com/sun/star/io/XStream.hpp> 34 #include <com/sun/star/io/XSeekable.hpp> 35 #include <com/sun/star/io/XTruncate.hpp> 36 #include <com/sun/star/packages/XDataSinkEncrSupport.hpp> 37 #include <com/sun/star/packages/NoEncryptionException.hpp> 38 #include <com/sun/star/lang/XEventListener.hpp> 39 #include <com/sun/star/lang/XSingleServiceFactory.hpp> 40 #include <com/sun/star/lang/XComponent.hpp> 41 #include <com/sun/star/embed/XEncryptionProtectedSource2.hpp> 42 #include <com/sun/star/embed/XStorage.hpp> 43 #include <com/sun/star/embed/XRelationshipAccess.hpp> 44 #include <com/sun/star/embed/XExtendedStorageStream.hpp> 45 #include <com/sun/star/embed/XTransactedObject.hpp> 46 #include <com/sun/star/embed/XTransactionBroadcaster.hpp> 47 #include <com/sun/star/container/XNameContainer.hpp> 48 #include <com/sun/star/beans/StringPair.hpp> 49 #include <com/sun/star/logging/XSimpleLogRing.hpp> 50 51 52 #include <cppuhelper/implbase1.hxx> 53 #include <cppuhelper/weak.hxx> 54 #include <cppuhelper/interfacecontainer.h> 55 56 #include <comphelper/sequenceashashmap.hxx> 57 58 #include <list> 59 60 #include "ocompinstream.hxx" 61 #include "mutexholder.hxx" 62 63 64 struct PreCreationStruct 65 { 66 SotMutexHolderRef m_rMutexRef; 67 68 PreCreationStruct() 69 : m_rMutexRef( new SotMutexHolder ) 70 {} 71 72 }; 73 74 namespace cppu { 75 class OTypeCollection; 76 } 77 78 namespace package { 79 void StaticAddLog( const ::rtl::OUString& aMessage ); 80 bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 ); 81 } 82 83 struct WSInternalData_Impl 84 { 85 SotMutexHolderRef m_rSharedMutexRef; 86 ::cppu::OTypeCollection* m_pTypeCollection; 87 ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners 88 sal_Int32 m_nStorageType; 89 90 // the mutex reference MUST NOT be empty 91 WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int32 nStorageType ) 92 : m_rSharedMutexRef( rMutexRef ) 93 , m_pTypeCollection( NULL ) 94 , m_aListenersContainer( rMutexRef->GetMutex() ) 95 , m_nStorageType( nStorageType ) 96 {} 97 }; 98 99 typedef ::std::list< OInputCompStream* > InputStreamsList_Impl; 100 101 struct OStorage_Impl; 102 class OWriteStream; 103 104 struct OWriteStream_Impl : public PreCreationStruct 105 { 106 friend struct OStorage_Impl; 107 friend class OWriteStream; 108 friend class OInputCompStream; 109 110 OWriteStream* m_pAntiImpl; 111 ::rtl::OUString m_aTempURL; 112 113 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xCacheStream; 114 ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xCacheSeek; 115 116 InputStreamsList_Impl m_aInputStreamsList; 117 118 sal_Bool m_bHasDataToFlush; // only modified elements will be sent to the original content 119 sal_Bool m_bFlushed; // sending the streams is coordinated by the root storage of the package 120 121 ::com::sun::star::uno::Reference< ::com::sun::star::packages::XDataSinkEncrSupport > m_xPackageStream; 122 ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing > m_xLogRing; 123 124 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; 125 126 OStorage_Impl* m_pParent; 127 128 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aProps; 129 130 sal_Bool m_bForceEncrypted; 131 132 sal_Bool m_bUseCommonEncryption; 133 sal_Bool m_bHasCachedEncryptionData; 134 ::comphelper::SequenceAsHashMap m_aEncryptionData; 135 136 sal_Bool m_bCompressedSetExplicit; 137 138 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > m_xPackage; 139 140 sal_Bool m_bHasInsertedStreamOptimization; 141 142 sal_Int32 m_nStorageType; 143 144 // Relations info related data, stored in *.rels file in OFOPXML format 145 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xOrigRelInfoStream; 146 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aOrigRelInfo; 147 sal_Bool m_bOrigRelInfoBroken; 148 149 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aNewRelInfo; 150 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream; 151 sal_Int16 m_nRelInfoStatus; 152 sal_Int32 m_nRelId; 153 154 155 private: 156 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory(); 157 158 ::rtl::OUString GetFilledTempFileIfNo( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream ); 159 ::rtl::OUString FillTempGetFileName(); 160 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetTempFileAsStream(); 161 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetTempFileAsInputStream(); 162 163 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStream_Impl( sal_Int32 nStreamMode, 164 sal_Bool bHierarchyAccess ); 165 166 ::comphelper::SequenceAsHashMap GetCommonRootEncryptionData() throw ( ::com::sun::star::packages::NoEncryptionException ); 167 168 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > ReadPackageStreamProperties(); 169 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > InsertOwnProps( 170 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, 171 sal_Bool bUseCommonEncryption ); 172 173 public: 174 OWriteStream_Impl( 175 OStorage_Impl* pParent, 176 const ::com::sun::star::uno::Reference< ::com::sun::star::packages::XDataSinkEncrSupport >& xPackageStream, 177 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >& xPackage, 178 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, 179 sal_Bool bForceEncrypted, 180 sal_Int32 nStorageType, 181 sal_Bool bDefaultCompress, 182 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xRelInfoStream = 183 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >() ); 184 185 ~OWriteStream_Impl(); 186 187 void CleanCacheStream(); 188 189 void AddLog( const ::rtl::OUString& aMessage ); 190 191 sal_Bool UsesCommonEncryption_Impl() { return m_bUseCommonEncryption; } 192 sal_Bool HasTempFile_Impl() { return ( m_aTempURL.getLength() != 0 ); } 193 sal_Bool IsTransacted(); 194 195 sal_Bool HasWriteOwner_Impl() { return ( m_pAntiImpl != NULL ); } 196 197 void InsertIntoPackageFolder( 198 const ::rtl::OUString& aName, 199 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xParentPackageFolder ); 200 201 void SetToBeCommited() { m_bFlushed = sal_True; } 202 203 sal_Bool HasCachedEncryptionData() { return m_bHasCachedEncryptionData; } 204 ::comphelper::SequenceAsHashMap& GetCachedEncryptionData() { return m_aEncryptionData; } 205 206 sal_Bool IsModified() { return m_bHasDataToFlush || m_bFlushed; } 207 208 sal_Bool IsEncrypted(); 209 void SetDecrypted(); 210 void SetEncrypted( const ::comphelper::SequenceAsHashMap& aEncryptionData ); 211 212 void DisposeWrappers(); 213 214 void InsertStreamDirectly( 215 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, 216 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps ); 217 218 void Commit(); 219 void Revert(); 220 221 void Free( sal_Bool bMust ); // allows to try to disconnect from the temporary stream 222 // in case bMust is set to sal_True the method 223 // will throw exception in case the file is still busy 224 225 void SetModified(); // can be done only by parent storage after renaming 226 227 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetStreamProperties(); 228 229 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny(); 230 231 void CopyInternallyTo_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDestStream, 232 const ::comphelper::SequenceAsHashMap& aEncryptionData ); 233 void CopyInternallyTo_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDestStream ); 234 235 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStream( 236 sal_Int32 nStreamMode, 237 const ::comphelper::SequenceAsHashMap& aEncryptionData, 238 sal_Bool bHierarchyAccess ); 239 240 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStream( 241 sal_Int32 nStreamMode, 242 sal_Bool bHierarchyAccess ); 243 244 245 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetRawInStream(); 246 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetPlainRawInStream(); 247 248 void InputStreamDisposed( OInputCompStream* pStream ); 249 250 void CreateReadonlyCopyBasedOnData( 251 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xDataToCopy, 252 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, 253 sal_Bool bUseCommonEncryption, 254 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream ); 255 256 void GetCopyOfLastCommit( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream ); 257 void GetCopyOfLastCommit( 258 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream, 259 const ::comphelper::SequenceAsHashMap& aEncryptionData ); 260 261 262 void CommitStreamRelInfo( 263 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xRelStorage, 264 const ::rtl::OUString& aOrigStreamName, 265 const ::rtl::OUString& aNewStreamName ); 266 267 void ReadRelInfoIfNecessary(); 268 269 sal_Int32 GetNewRelId() { return m_nRelId ++; } 270 }; 271 272 class OWriteStream : ::com::sun::star::lang::XTypeProvider 273 , public ::com::sun::star::io::XInputStream 274 , public ::com::sun::star::io::XOutputStream 275 , public ::com::sun::star::embed::XExtendedStorageStream 276 , public ::com::sun::star::io::XSeekable 277 , public ::com::sun::star::io::XTruncate 278 , public ::com::sun::star::embed::XEncryptionProtectedSource2 279 , public ::com::sun::star::embed::XRelationshipAccess 280 , public ::com::sun::star::embed::XTransactedObject 281 , public ::com::sun::star::embed::XTransactionBroadcaster 282 , public ::com::sun::star::beans::XPropertySet 283 , public ::cppu::OWeakObject 284 { 285 friend struct OWriteStream_Impl; 286 287 protected: 288 ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > m_xInStream; 289 ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > m_xOutStream; 290 ::com::sun::star::uno::Reference < ::com::sun::star::io::XSeekable > m_xSeekable; 291 292 OWriteStream_Impl* m_pImpl; 293 WSInternalData_Impl* m_pData; 294 295 sal_Bool m_bInStreamDisconnected; 296 sal_Bool m_bInitOnDemand; 297 sal_Int64 m_nInitPosition; 298 299 sal_Bool m_bTransacted; 300 301 OWriteStream( OWriteStream_Impl* pImpl, sal_Bool bTransacted ); 302 OWriteStream( OWriteStream_Impl* pImpl, ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, sal_Bool bTransacted ); 303 304 void CloseOutput_Impl(); 305 306 void CopyToStreamInternally_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream ); 307 308 void ModifyParentUnlockMutex_Impl( ::osl::ResettableMutexGuard& aGuard ); 309 310 void BroadcastTransaction( sal_Int8 nMessage ); 311 312 public: 313 314 virtual ~OWriteStream(); 315 316 void CheckInitOnDemand(); 317 void DeInit(); 318 319 // XInterface 320 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) 321 throw( ::com::sun::star::uno::RuntimeException ); 322 virtual void SAL_CALL acquire() throw(); 323 virtual void SAL_CALL release() throw(); 324 325 // XTypeProvider 326 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() 327 throw( ::com::sun::star::uno::RuntimeException ); 328 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 329 throw( ::com::sun::star::uno::RuntimeException ); 330 331 // XInputStream 332 virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) 333 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 334 virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 335 virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) 336 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 337 virtual sal_Int32 SAL_CALL available( ) 338 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 339 virtual void SAL_CALL closeInput( ) 340 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 341 342 // XOutputStream 343 virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 344 virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 345 virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 346 347 //XSeekable 348 virtual void SAL_CALL seek( sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 349 virtual sal_Int64 SAL_CALL getPosition() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 350 virtual sal_Int64 SAL_CALL getLength() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 351 352 //XStream 353 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException); 354 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException); 355 356 // XTruncate 357 virtual void SAL_CALL truncate() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 358 359 //XComponent 360 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); 361 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 362 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); 363 364 //XEncryptionProtectedSource 365 virtual void SAL_CALL setEncryptionPassword( const ::rtl::OUString& aPass ) 366 throw ( ::com::sun::star::uno::RuntimeException, 367 ::com::sun::star::io::IOException ); 368 virtual void SAL_CALL removeEncryption() 369 throw ( ::com::sun::star::uno::RuntimeException, 370 ::com::sun::star::io::IOException ); 371 372 //XEncryptionProtectedSource2 373 virtual void SAL_CALL setEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 374 375 //XRelationshipAccess 376 virtual ::sal_Bool SAL_CALL hasByID( const ::rtl::OUString& sID ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 377 virtual ::rtl::OUString SAL_CALL getTargetByID( const ::rtl::OUString& sID ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 378 virtual ::rtl::OUString SAL_CALL getTypeByID( const ::rtl::OUString& sID ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 379 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > SAL_CALL getRelationshipByID( const ::rtl::OUString& sID ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 380 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getRelationshipsByType( const ::rtl::OUString& sType ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 381 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getAllRelationships( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 382 virtual void SAL_CALL insertRelationshipByID( const ::rtl::OUString& sID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aEntry, ::sal_Bool bReplace ) throw (::com::sun::star::container::ElementExistException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 383 virtual void SAL_CALL removeRelationshipByID( const ::rtl::OUString& sID ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 384 virtual void SAL_CALL insertRelationships( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aEntries, ::sal_Bool bReplace ) throw (::com::sun::star::container::ElementExistException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 385 virtual void SAL_CALL clearRelationships( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 386 387 //XPropertySet 388 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw ( ::com::sun::star::uno::RuntimeException ); 389 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 390 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 391 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 392 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 393 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 394 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 395 396 // XTransactedObject 397 virtual void SAL_CALL commit() 398 throw ( ::com::sun::star::io::IOException, 399 ::com::sun::star::embed::StorageWrappedTargetException, 400 ::com::sun::star::uno::RuntimeException ); 401 virtual void SAL_CALL revert() 402 throw ( ::com::sun::star::io::IOException, 403 ::com::sun::star::embed::StorageWrappedTargetException, 404 ::com::sun::star::uno::RuntimeException ); 405 406 // XTransactionBroadcaster 407 virtual void SAL_CALL addTransactionListener( 408 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener ) 409 throw ( ::com::sun::star::uno::RuntimeException ); 410 virtual void SAL_CALL removeTransactionListener( 411 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener ) 412 throw ( ::com::sun::star::uno::RuntimeException ); 413 414 }; 415 416 #endif 417 418