merge the formfield patch from ooo-build
[ooovba.git] / package / source / xstor / xstorage.hxx
blob91b02ebb881dd1ee6bc204eed3064a4c037b3b8b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xstorage.hxx,v $
10 * $Revision: 1.17 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __XSTORAGE_HXX_
32 #define __XSTORAGE_HXX_
34 #include <com/sun/star/uno/Sequence.hxx>
35 #include <com/sun/star/embed/XStorage.hpp>
36 #include <com/sun/star/embed/XOptimizedStorage.hpp>
37 #include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
38 #include <com/sun/star/embed/XStorageRawAccess.hpp>
39 #include <com/sun/star/embed/XTransactedObject.hpp>
40 #include <com/sun/star/embed/XTransactionBroadcaster.hpp>
41 #include <com/sun/star/embed/XClassifiedObject.hpp>
42 #include <com/sun/star/embed/XEncryptionProtectedSource.hpp>
43 #include <com/sun/star/embed/XRelationshipAccess.hpp>
44 #include <com/sun/star/util/XModifiable.hpp>
45 #include <com/sun/star/container/XNameAccess.hpp>
46 #include <com/sun/star/container/XNameContainer.hpp>
47 #include <com/sun/star/util/XCloseable.hpp>
48 #include <com/sun/star/beans/XPropertySet.hpp>
49 #include <com/sun/star/beans/PropertyValue.hpp>
50 #include <com/sun/star/beans/StringPair.hpp>
51 #include <com/sun/star/io/XStream.hpp>
52 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
53 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
54 #include <com/sun/star/lang/XTypeProvider.hpp>
55 #include <com/sun/star/lang/XComponent.hpp>
56 #include <com/sun/star/packages/NoEncryptionException.hpp>
57 #include <com/sun/star/logging/XSimpleLogRing.hpp>
58 #include <cppuhelper/weak.hxx>
59 #include <cppuhelper/interfacecontainer.h>
61 #include "mutexholder.hxx"
64 #define PACKAGE_STORAGE 0
65 #define ZIP_STORAGE 1
66 #define OFOPXML_STORAGE 2
68 #define RELINFO_NO_INIT 1
69 #define RELINFO_READ 2
70 #define RELINFO_CHANGED 3
71 #define RELINFO_CHANGED_STREAM 4
72 #define RELINFO_CHANGED_STREAM_READ 5
73 #define RELINFO_BROKEN 6
74 #define RELINFO_CHANGED_BROKEN 7
76 #define STOR_MESS_PRECOMMIT 1
77 #define STOR_MESS_COMMITED 2
78 #define STOR_MESS_PREREVERT 3
79 #define STOR_MESS_REVERTED 4
81 namespace cppu
83 class OTypeCollection;
86 //================================================
87 // a common implementation for an entry
89 struct StorInternalData_Impl;
90 struct OStorage_Impl;
91 struct OWriteStream_Impl;
93 struct SotElement_Impl
95 ::rtl::OUString m_aName;
96 ::rtl::OUString m_aOriginalName;
97 sal_Bool m_bIsRemoved;
98 sal_Bool m_bIsInserted;
99 sal_Bool m_bIsStorage;
101 OStorage_Impl* m_pStorage;
102 OWriteStream_Impl* m_pStream;
104 public:
105 SotElement_Impl( const ::rtl::OUString& rName, sal_Bool bStor, sal_Bool bNew );
106 ~SotElement_Impl();
109 #include <list>
110 typedef ::std::list< SotElement_Impl* > SotElementList_Impl;
112 //=========================================================================
113 // Main storage implementation
115 class OStorage;
117 struct StorageHolder_Impl
119 OStorage* m_pPointer;
120 ::com::sun::star::uno::WeakReference< ::com::sun::star::embed::XStorage > m_xWeakRef;
122 StorageHolder_Impl( OStorage* pStorage )
123 : m_pPointer( pStorage )
124 , m_xWeakRef( ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >(
125 (::com::sun::star::embed::XStorage*)pStorage ) )
129 StorageHolder_Impl( const StorageHolder_Impl& aSH )
130 : m_pPointer( aSH.m_pPointer )
131 , m_xWeakRef( aSH.m_xWeakRef )
136 typedef ::std::list< StorageHolder_Impl > OStorageList_Impl;
138 class SwitchablePersistenceStream;
139 struct OStorage_Impl
141 SotMutexHolderRef m_rMutexRef;
143 OStorage* m_pAntiImpl; // only valid if external references exists
144 OStorageList_Impl m_aReadOnlyWrapList; // only valid if readonly external reference exists
146 sal_Int32 m_nStorageMode; // open mode ( read/write/trunc/nocreate )
147 sal_Bool m_bIsModified; // only modified elements will be sent to the original content
148 sal_Bool m_bBroadcastModified; // will be set if notification is required
149 sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package
151 sal_Bool m_bIsRoot; // marks this storage as root storages that manages all commits and reverts
152 sal_Bool m_bListCreated;
155 SotElementList_Impl m_aChildrenList;
156 SotElementList_Impl m_aDeletedList;
158 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xPackageFolder;
159 ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing > m_xLogRing;
161 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > m_xPackage;
162 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
164 // valid only for root storage
165 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; // ??? may be stored in properties
166 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; // ??? may be stored in properties
167 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_xProperties;
168 sal_Bool m_bHasCommonPassword;
169 ::rtl::OUString m_aCommonPassword;
171 // must be empty in case of root storage
172 OStorage_Impl* m_pParent;
174 sal_Bool m_bControlMediaType;
175 ::rtl::OUString m_aMediaType;
176 sal_Bool m_bMTFallbackUsed;
178 sal_Bool m_bControlVersion;
179 ::rtl::OUString m_aVersion;
181 SwitchablePersistenceStream* m_pSwitchStream;
183 sal_Int16 m_nStorageType; // the mode in wich the storage is used
185 // the _rels substorage that is handled in a special way in OFOPXML_STORAGE
186 SotElement_Impl* m_pRelStorElement;
187 ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage;
188 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo;
189 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream;
190 sal_Int16 m_nRelInfoStatus;
192 //////////////////////////////////////////
193 // Constructors
195 OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
196 sal_Int32 nMode,
197 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
198 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
199 sal_Int16 nStorageType );
201 OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
202 sal_Int32 nMode,
203 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
204 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
205 sal_Int16 nStorageType );
207 // constructor for a substorage
208 OStorage_Impl( OStorage_Impl* pParent,
209 sal_Int32 nMode,
210 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder,
211 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage,
212 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
213 sal_Int16 nStorageType );
215 ~OStorage_Impl();
217 void AddLog( const ::rtl::OUString& aMessage );
219 void SetReadOnlyWrap( OStorage& aStorage );
220 void RemoveReadOnlyWrap( OStorage& aStorage );
222 void OpenOwnPackage();
223 void ReadContents();
224 void ReadRelInfoIfNecessary();
226 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory();
227 SotElementList_Impl& GetChildrenList();
228 void GetStorageProperties();
230 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
231 void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor );
232 void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor,
233 const ::rtl::OUString& aPass );
235 void InsertIntoPackageFolder(
236 const ::rtl::OUString& aName,
237 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xParentPackageFolder );
239 void Commit();
240 void Revert();
242 ::rtl::OUString GetCommonRootPass() throw ( ::com::sun::star::packages::NoEncryptionException );
244 void CopyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
245 sal_Bool bDirect );
246 void CopyStorageElement( SotElement_Impl* pElement,
247 ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xDest,
248 ::rtl::OUString aName,
249 sal_Bool bDirect );
251 void SetModified( sal_Bool bModified );
253 SotElement_Impl* FindElement( const ::rtl::OUString& rName );
256 SotElement_Impl* InsertStream( ::rtl::OUString aName, sal_Bool bEncr );
257 SotElement_Impl* InsertRawStream( ::rtl::OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
259 OStorage_Impl* CreateNewStorageImpl( sal_Int32 nStorageMode );
260 SotElement_Impl* InsertStorage( ::rtl::OUString aName, sal_Int32 nStorageMode );
261 SotElement_Impl* InsertElement( ::rtl::OUString aName, sal_Bool bIsStorage );
263 void OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorageMode );
264 void OpenSubStream( SotElement_Impl* pElement );
266 ::com::sun::star::uno::Sequence< ::rtl::OUString > GetElementNames();
268 void RemoveElement( SotElement_Impl* pElement );
269 void ClearElement( SotElement_Impl* pElement );
270 void DisposeChildren();
272 void CloneStreamElement(
273 const ::rtl::OUString& aStreamName,
274 sal_Bool bPassProvided,
275 const ::rtl::OUString& aPass,
276 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
277 throw ( ::com::sun::star::embed::InvalidStorageException,
278 ::com::sun::star::lang::IllegalArgumentException,
279 ::com::sun::star::packages::WrongPasswordException,
280 ::com::sun::star::io::IOException,
281 ::com::sun::star::embed::StorageWrappedTargetException,
282 ::com::sun::star::uno::RuntimeException );
284 void RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName );
285 void CreateRelStorage();
286 void CommitStreamRelInfo( SotElement_Impl* pStreamElement );
287 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetRelInfoStreamForName( const ::rtl::OUString& aName );
288 void CommitRelInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xNewPackageFolder );
290 static void completeStorageStreamCopy_Impl(
291 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSource,
292 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDest,
293 sal_Int16 nStorageType,
294 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aRelInfo );
299 class OStorage : public ::com::sun::star::lang::XTypeProvider
300 , public ::com::sun::star::embed::XStorage
301 , public ::com::sun::star::embed::XStorageRawAccess
302 , public ::com::sun::star::embed::XTransactedObject
303 , public ::com::sun::star::embed::XTransactionBroadcaster
304 , public ::com::sun::star::util::XModifiable
305 // , public ::com::sun::star::container::XNameAccess
306 // , public ::com::sun::star::lang::XComponent
307 , public ::com::sun::star::embed::XEncryptionProtectedSource
308 , public ::com::sun::star::beans::XPropertySet
309 , public ::com::sun::star::embed::XOptimizedStorage
310 , public ::com::sun::star::embed::XRelationshipAccess
311 , public ::com::sun::star::embed::XHierarchicalStorageAccess
312 , public ::cppu::OWeakObject
314 OStorage_Impl* m_pImpl;
315 StorInternalData_Impl* m_pData;
317 protected:
319 void Commit_Impl();
321 SotElement_Impl* OpenStreamElement_Impl( const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, sal_Bool bEncr );
323 void BroadcastModifiedIfNecessary();
325 void BroadcastTransaction( sal_Int8 nMessage );
327 void MakeLinkToSubComponent_Impl(
328 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComponent );
330 public:
332 OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
333 sal_Int32 nMode,
334 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
335 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
336 sal_Int16 nStorageType );
338 OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
339 sal_Int32 nMode,
340 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
341 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
342 sal_Int16 nStorageType );
344 OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap );
346 virtual ~OStorage();
348 void SAL_CALL InternalDispose( sal_Bool bNotifyImpl );
350 void ChildIsDisposed( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xChild );
352 sal_Int32 GetRefCount_Impl() { return m_refCount; }
354 //____________________________________________________________________________________________________
355 // XInterface
356 //____________________________________________________________________________________________________
358 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
359 throw( ::com::sun::star::uno::RuntimeException );
361 virtual void SAL_CALL acquire() throw();
363 virtual void SAL_CALL release() throw();
365 //____________________________________________________________________________________________________
366 // XTypeProvider
367 //____________________________________________________________________________________________________
369 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
370 throw( ::com::sun::star::uno::RuntimeException );
372 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
373 throw( ::com::sun::star::uno::RuntimeException );
375 //____________________________________________________________________________________________________
376 // XStorage
377 //____________________________________________________________________________________________________
379 virtual void SAL_CALL copyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest )
380 throw ( ::com::sun::star::embed::InvalidStorageException,
381 ::com::sun::star::lang::IllegalArgumentException,
382 ::com::sun::star::io::IOException,
383 ::com::sun::star::embed::StorageWrappedTargetException,
384 ::com::sun::star::uno::RuntimeException );
386 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openStreamElement(
387 const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode )
388 throw ( ::com::sun::star::embed::InvalidStorageException,
389 ::com::sun::star::lang::IllegalArgumentException,
390 ::com::sun::star::packages::WrongPasswordException,
391 ::com::sun::star::io::IOException,
392 ::com::sun::star::embed::StorageWrappedTargetException,
393 ::com::sun::star::uno::RuntimeException );
395 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStreamElement(
396 const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, const ::rtl::OUString& aPass )
397 throw ( ::com::sun::star::embed::InvalidStorageException,
398 ::com::sun::star::lang::IllegalArgumentException,
399 ::com::sun::star::packages::NoEncryptionException,
400 ::com::sun::star::packages::WrongPasswordException,
401 ::com::sun::star::io::IOException,
402 ::com::sun::star::embed::StorageWrappedTargetException,
403 ::com::sun::star::uno::RuntimeException );
405 virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL openStorageElement(
406 const ::rtl::OUString& aStorName, sal_Int32 nStorageMode )
407 throw ( ::com::sun::star::embed::InvalidStorageException,
408 ::com::sun::star::lang::IllegalArgumentException,
409 ::com::sun::star::io::IOException,
410 ::com::sun::star::embed::StorageWrappedTargetException,
411 ::com::sun::star::uno::RuntimeException );
413 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneStreamElement(
414 const ::rtl::OUString& aStreamName )
415 throw ( ::com::sun::star::embed::InvalidStorageException,
416 ::com::sun::star::lang::IllegalArgumentException,
417 ::com::sun::star::packages::WrongPasswordException,
418 ::com::sun::star::io::IOException,
419 ::com::sun::star::embed::StorageWrappedTargetException,
420 ::com::sun::star::uno::RuntimeException );
422 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStreamElement(
423 const ::rtl::OUString& aStreamName, const ::rtl::OUString& aPass )
424 throw ( ::com::sun::star::embed::InvalidStorageException,
425 ::com::sun::star::lang::IllegalArgumentException,
426 ::com::sun::star::packages::NoEncryptionException,
427 ::com::sun::star::packages::WrongPasswordException,
428 ::com::sun::star::io::IOException,
429 ::com::sun::star::embed::StorageWrappedTargetException,
430 ::com::sun::star::uno::RuntimeException );
432 virtual void SAL_CALL copyLastCommitTo(
433 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage )
434 throw ( ::com::sun::star::embed::InvalidStorageException,
435 ::com::sun::star::lang::IllegalArgumentException,
436 ::com::sun::star::io::IOException,
437 ::com::sun::star::embed::StorageWrappedTargetException,
438 ::com::sun::star::uno::RuntimeException );
440 virtual void SAL_CALL copyStorageElementLastCommitTo(
441 const ::rtl::OUString& aStorName,
442 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage )
443 throw ( ::com::sun::star::embed::InvalidStorageException,
444 ::com::sun::star::lang::IllegalArgumentException,
445 ::com::sun::star::io::IOException,
446 ::com::sun::star::embed::StorageWrappedTargetException,
447 ::com::sun::star::uno::RuntimeException );
449 virtual sal_Bool SAL_CALL isStreamElement( const ::rtl::OUString& aElementName )
450 throw ( ::com::sun::star::container::NoSuchElementException,
451 ::com::sun::star::lang::IllegalArgumentException,
452 ::com::sun::star::embed::InvalidStorageException,
453 ::com::sun::star::uno::RuntimeException );
455 virtual sal_Bool SAL_CALL isStorageElement( const ::rtl::OUString& aElementName )
456 throw ( ::com::sun::star::container::NoSuchElementException,
457 ::com::sun::star::lang::IllegalArgumentException,
458 ::com::sun::star::embed::InvalidStorageException,
459 ::com::sun::star::uno::RuntimeException );
461 virtual void SAL_CALL removeElement( const ::rtl::OUString& aElementName )
462 throw ( ::com::sun::star::embed::InvalidStorageException,
463 ::com::sun::star::lang::IllegalArgumentException,
464 ::com::sun::star::container::NoSuchElementException,
465 ::com::sun::star::io::IOException,
466 ::com::sun::star::embed::StorageWrappedTargetException,
467 ::com::sun::star::uno::RuntimeException );
469 virtual void SAL_CALL renameElement( const ::rtl::OUString& rEleName, const ::rtl::OUString& rNewName )
470 throw ( ::com::sun::star::embed::InvalidStorageException,
471 ::com::sun::star::lang::IllegalArgumentException,
472 ::com::sun::star::container::NoSuchElementException,
473 ::com::sun::star::container::ElementExistException,
474 ::com::sun::star::io::IOException,
475 ::com::sun::star::embed::StorageWrappedTargetException,
476 ::com::sun::star::uno::RuntimeException );
478 virtual void SAL_CALL copyElementTo( const ::rtl::OUString& aElementName,
479 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
480 const ::rtl::OUString& aNewName )
481 throw ( ::com::sun::star::embed::InvalidStorageException,
482 ::com::sun::star::lang::IllegalArgumentException,
483 ::com::sun::star::container::NoSuchElementException,
484 ::com::sun::star::container::ElementExistException,
485 ::com::sun::star::io::IOException,
486 ::com::sun::star::embed::StorageWrappedTargetException,
487 ::com::sun::star::uno::RuntimeException );
489 virtual void SAL_CALL moveElementTo( const ::rtl::OUString& aElementName,
490 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
491 const ::rtl::OUString& rNewName )
492 throw ( ::com::sun::star::embed::InvalidStorageException,
493 ::com::sun::star::lang::IllegalArgumentException,
494 ::com::sun::star::container::NoSuchElementException,
495 ::com::sun::star::container::ElementExistException,
496 ::com::sun::star::io::IOException,
497 ::com::sun::star::embed::StorageWrappedTargetException,
498 ::com::sun::star::uno::RuntimeException );
500 //____________________________________________________________________________________________________
501 // XStorageRawAccess
502 //____________________________________________________________________________________________________
504 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getPlainRawStreamElement(
505 const ::rtl::OUString& sStreamName )
506 throw ( ::com::sun::star::embed::InvalidStorageException,
507 ::com::sun::star::lang::IllegalArgumentException,
508 ::com::sun::star::container::NoSuchElementException,
509 ::com::sun::star::io::IOException,
510 ::com::sun::star::embed::StorageWrappedTargetException,
511 ::com::sun::star::uno::RuntimeException );
513 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawEncrStreamElement(
514 const ::rtl::OUString& sStreamName )
515 throw ( ::com::sun::star::embed::InvalidStorageException,
516 ::com::sun::star::lang::IllegalArgumentException,
517 ::com::sun::star::packages::NoEncryptionException,
518 ::com::sun::star::container::NoSuchElementException,
519 ::com::sun::star::io::IOException,
520 ::com::sun::star::embed::StorageWrappedTargetException,
521 ::com::sun::star::uno::RuntimeException );
523 virtual void SAL_CALL insertRawEncrStreamElement( const ::rtl::OUString& aStreamName,
524 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
525 throw ( ::com::sun::star::embed::InvalidStorageException,
526 ::com::sun::star::lang::IllegalArgumentException,
527 ::com::sun::star::packages::NoRawFormatException,
528 ::com::sun::star::container::ElementExistException,
529 ::com::sun::star::io::IOException,
530 ::com::sun::star::embed::StorageWrappedTargetException,
531 ::com::sun::star::uno::RuntimeException);
533 //____________________________________________________________________________________________________
534 // XTransactedObject
535 //____________________________________________________________________________________________________
537 virtual void SAL_CALL commit()
538 throw ( ::com::sun::star::io::IOException,
539 ::com::sun::star::embed::StorageWrappedTargetException,
540 ::com::sun::star::uno::RuntimeException );
542 virtual void SAL_CALL revert()
543 throw ( ::com::sun::star::io::IOException,
544 ::com::sun::star::embed::StorageWrappedTargetException,
545 ::com::sun::star::uno::RuntimeException );
547 //____________________________________________________________________________________________________
548 // XTransactionBroadcaster
549 //____________________________________________________________________________________________________
551 virtual void SAL_CALL addTransactionListener(
552 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener )
553 throw ( ::com::sun::star::uno::RuntimeException );
555 virtual void SAL_CALL removeTransactionListener(
556 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener )
557 throw ( ::com::sun::star::uno::RuntimeException );
559 //____________________________________________________________________________________________________
560 // XModifiable
561 //____________________________________________________________________________________________________
563 virtual sal_Bool SAL_CALL isModified()
564 throw ( ::com::sun::star::uno::RuntimeException );
566 virtual void SAL_CALL setModified( sal_Bool bModified )
567 throw ( ::com::sun::star::beans::PropertyVetoException,
568 ::com::sun::star::uno::RuntimeException );
570 virtual void SAL_CALL addModifyListener(
571 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
572 throw ( ::com::sun::star::uno::RuntimeException );
574 virtual void SAL_CALL removeModifyListener(
575 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
576 throw ( ::com::sun::star::uno::RuntimeException );
578 //____________________________________________________________________________________________________
579 // XNameAccess
580 //____________________________________________________________________________________________________
582 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
583 throw ( ::com::sun::star::container::NoSuchElementException,
584 ::com::sun::star::lang::WrappedTargetException,
585 ::com::sun::star::uno::RuntimeException );
587 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
588 throw ( ::com::sun::star::uno::RuntimeException );
590 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
591 throw ( ::com::sun::star::uno::RuntimeException );
593 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
594 throw ( ::com::sun::star::uno::RuntimeException );
596 virtual sal_Bool SAL_CALL hasElements()
597 throw ( ::com::sun::star::uno::RuntimeException );
599 //____________________________________________________________________________________________________
600 // XComponent
601 //____________________________________________________________________________________________________
603 virtual void SAL_CALL dispose()
604 throw ( ::com::sun::star::uno::RuntimeException );
606 virtual void SAL_CALL addEventListener(
607 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
608 throw ( ::com::sun::star::uno::RuntimeException );
610 virtual void SAL_CALL removeEventListener(
611 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
612 throw ( ::com::sun::star::uno::RuntimeException );
614 //____________________________________________________________________________________________________
615 // XEncryptionProtectedSource
616 //____________________________________________________________________________________________________
618 virtual void SAL_CALL setEncryptionPassword( const ::rtl::OUString& aPass )
619 throw ( ::com::sun::star::uno::RuntimeException,
620 ::com::sun::star::io::IOException );
622 virtual void SAL_CALL removeEncryption()
623 throw ( ::com::sun::star::uno::RuntimeException,
624 ::com::sun::star::io::IOException );
626 //____________________________________________________________________________________________________
627 // XPropertySet
628 //____________________________________________________________________________________________________
630 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
631 throw ( ::com::sun::star::uno::RuntimeException );
633 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
634 throw ( ::com::sun::star::beans::UnknownPropertyException,
635 ::com::sun::star::beans::PropertyVetoException,
636 ::com::sun::star::lang::IllegalArgumentException,
637 ::com::sun::star::lang::WrappedTargetException,
638 ::com::sun::star::uno::RuntimeException );
640 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
641 throw ( ::com::sun::star::beans::UnknownPropertyException,
642 ::com::sun::star::lang::WrappedTargetException,
643 ::com::sun::star::uno::RuntimeException );
645 virtual void SAL_CALL addPropertyChangeListener(
646 const ::rtl::OUString& aPropertyName,
647 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
648 throw ( ::com::sun::star::beans::UnknownPropertyException,
649 ::com::sun::star::lang::WrappedTargetException,
650 ::com::sun::star::uno::RuntimeException );
652 virtual void SAL_CALL removePropertyChangeListener(
653 const ::rtl::OUString& aPropertyName,
654 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
655 throw ( ::com::sun::star::beans::UnknownPropertyException,
656 ::com::sun::star::lang::WrappedTargetException,
657 ::com::sun::star::uno::RuntimeException );
659 virtual void SAL_CALL addVetoableChangeListener(
660 const ::rtl::OUString& PropertyName,
661 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
662 throw ( ::com::sun::star::beans::UnknownPropertyException,
663 ::com::sun::star::lang::WrappedTargetException,
664 ::com::sun::star::uno::RuntimeException );
666 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
667 throw ( ::com::sun::star::beans::UnknownPropertyException,
668 ::com::sun::star::lang::WrappedTargetException,
669 ::com::sun::star::uno::RuntimeException );
671 //____________________________________________________________________________________________________
672 // XOptimizedStorage
673 //____________________________________________________________________________________________________
674 virtual void SAL_CALL insertRawNonEncrStreamElementDirect( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
675 throw ( ::com::sun::star::embed::InvalidStorageException,
676 ::com::sun::star::lang::IllegalArgumentException,
677 ::com::sun::star::packages::NoRawFormatException,
678 ::com::sun::star::container::ElementExistException,
679 ::com::sun::star::io::IOException,
680 ::com::sun::star::embed::StorageWrappedTargetException,
681 ::com::sun::star::uno::RuntimeException );
683 virtual void SAL_CALL insertStreamElementDirect( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps )
684 throw ( ::com::sun::star::embed::InvalidStorageException,
685 ::com::sun::star::lang::IllegalArgumentException,
686 ::com::sun::star::container::ElementExistException,
687 ::com::sun::star::io::IOException,
688 ::com::sun::star::embed::StorageWrappedTargetException,
689 ::com::sun::star::uno::RuntimeException );
691 virtual void SAL_CALL copyElementDirectlyTo( const ::rtl::OUString& sSourceName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XOptimizedStorage >& xTargetStorage, const ::rtl::OUString& sTargetName )
692 throw ( ::com::sun::star::embed::InvalidStorageException,
693 ::com::sun::star::lang::IllegalArgumentException,
694 ::com::sun::star::container::NoSuchElementException,
695 ::com::sun::star::container::ElementExistException,
696 ::com::sun::star::io::IOException,
697 ::com::sun::star::embed::StorageWrappedTargetException,
698 ::com::sun::star::uno::RuntimeException );
700 virtual void SAL_CALL writeAndAttachToStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream )
701 throw ( ::com::sun::star::embed::InvalidStorageException,
702 ::com::sun::star::lang::IllegalArgumentException,
703 ::com::sun::star::io::IOException,
704 ::com::sun::star::embed::StorageWrappedTargetException,
705 ::com::sun::star::uno::RuntimeException );
707 virtual void SAL_CALL attachToURL( const ::rtl::OUString& sURL, sal_Bool bReadOnly )
708 throw ( ::com::sun::star::embed::InvalidStorageException,
709 ::com::sun::star::lang::IllegalArgumentException,
710 ::com::sun::star::io::IOException,
711 ::com::sun::star::embed::StorageWrappedTargetException,
712 ::com::sun::star::uno::RuntimeException );
714 virtual ::com::sun::star::uno::Any SAL_CALL getElementPropertyValue( const ::rtl::OUString& sElementName, const ::rtl::OUString& sPropertyName )
715 throw ( ::com::sun::star::embed::InvalidStorageException,
716 ::com::sun::star::lang::IllegalArgumentException,
717 ::com::sun::star::container::NoSuchElementException,
718 ::com::sun::star::io::IOException,
719 ::com::sun::star::beans::UnknownPropertyException,
720 ::com::sun::star::beans::PropertyVetoException,
721 ::com::sun::star::embed::StorageWrappedTargetException,
722 ::com::sun::star::uno::RuntimeException);
724 virtual void SAL_CALL copyStreamElementData( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
725 throw ( ::com::sun::star::embed::InvalidStorageException,
726 ::com::sun::star::lang::IllegalArgumentException,
727 ::com::sun::star::packages::WrongPasswordException,
728 ::com::sun::star::io::IOException,
729 ::com::sun::star::embed::StorageWrappedTargetException,
730 ::com::sun::star::uno::RuntimeException );
732 //____________________________________________________________________________________________________
733 // XRelationshipAccess
734 //____________________________________________________________________________________________________
736 virtual ::sal_Bool SAL_CALL hasByID( const ::rtl::OUString& sID )
737 throw ( ::com::sun::star::io::IOException,
738 ::com::sun::star::uno::RuntimeException);
740 virtual ::rtl::OUString SAL_CALL getTargetByID( const ::rtl::OUString& sID )
741 throw ( ::com::sun::star::container::NoSuchElementException,
742 ::com::sun::star::io::IOException,
743 ::com::sun::star::uno::RuntimeException);
745 virtual ::rtl::OUString SAL_CALL getTypeByID( const ::rtl::OUString& sID )
746 throw ( ::com::sun::star::container::NoSuchElementException,
747 ::com::sun::star::io::IOException,
748 ::com::sun::star::uno::RuntimeException);
750 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > SAL_CALL getRelationshipByID( const ::rtl::OUString& sID )
751 throw ( ::com::sun::star::container::NoSuchElementException,
752 ::com::sun::star::io::IOException,
753 ::com::sun::star::uno::RuntimeException);
755 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getRelationshipsByType( const ::rtl::OUString& sType )
756 throw ( ::com::sun::star::io::IOException,
757 ::com::sun::star::uno::RuntimeException);
759 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getAllRelationships( )
760 throw ( ::com::sun::star::io::IOException,
761 ::com::sun::star::uno::RuntimeException);
763 virtual void SAL_CALL insertRelationshipByID( const ::rtl::OUString& sID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aEntry, ::sal_Bool bReplace )
764 throw ( ::com::sun::star::container::ElementExistException,
765 ::com::sun::star::io::IOException,
766 ::com::sun::star::uno::RuntimeException);
768 virtual void SAL_CALL removeRelationshipByID( const ::rtl::OUString& sID )
769 throw ( ::com::sun::star::container::NoSuchElementException,
770 ::com::sun::star::io::IOException,
771 ::com::sun::star::uno::RuntimeException);
773 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 )
774 throw ( ::com::sun::star::container::ElementExistException,
775 ::com::sun::star::io::IOException,
776 ::com::sun::star::uno::RuntimeException);
778 virtual void SAL_CALL clearRelationships( )
779 throw ( ::com::sun::star::io::IOException,
780 ::com::sun::star::uno::RuntimeException);
782 //____________________________________________________________________________________________________
783 // XHierarchicalStorageAccess
784 //____________________________________________________________________________________________________
786 virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode )
787 throw ( ::com::sun::star::embed::InvalidStorageException,
788 ::com::sun::star::lang::IllegalArgumentException,
789 ::com::sun::star::packages::WrongPasswordException,
790 ::com::sun::star::io::IOException,
791 ::com::sun::star::embed::StorageWrappedTargetException,
792 ::com::sun::star::uno::RuntimeException);
794 virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openEncryptedStreamElementByHierarchicalName( const ::rtl::OUString& sStreamName, ::sal_Int32 nOpenMode, const ::rtl::OUString& sPassword )
795 throw ( ::com::sun::star::embed::InvalidStorageException,
796 ::com::sun::star::lang::IllegalArgumentException,
797 ::com::sun::star::packages::NoEncryptionException,
798 ::com::sun::star::packages::WrongPasswordException,
799 ::com::sun::star::io::IOException,
800 ::com::sun::star::embed::StorageWrappedTargetException,
801 ::com::sun::star::uno::RuntimeException);
803 virtual void SAL_CALL removeStreamElementByHierarchicalName( const ::rtl::OUString& sElementPath )
804 throw ( ::com::sun::star::embed::InvalidStorageException,
805 ::com::sun::star::lang::IllegalArgumentException,
806 ::com::sun::star::container::NoSuchElementException,
807 ::com::sun::star::io::IOException,
808 ::com::sun::star::embed::StorageWrappedTargetException,
809 ::com::sun::star::uno::RuntimeException);
814 #endif