fix toolbar import
[ooovba.git] / package / source / xstor / xstorage.hxx
blobfda623b67186225356f95d9dd0aadaa26bc86e58
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 <cppuhelper/weak.hxx>
58 #include <cppuhelper/interfacecontainer.h>
60 #include "mutexholder.hxx"
63 #define PACKAGE_STORAGE 0
64 #define ZIP_STORAGE 1
65 #define OFOPXML_STORAGE 2
67 #define RELINFO_NO_INIT 1
68 #define RELINFO_READ 2
69 #define RELINFO_CHANGED 3
70 #define RELINFO_CHANGED_STREAM 4
71 #define RELINFO_CHANGED_STREAM_READ 5
72 #define RELINFO_BROKEN 6
73 #define RELINFO_CHANGED_BROKEN 7
75 #define STOR_MESS_PRECOMMIT 1
76 #define STOR_MESS_COMMITED 2
77 #define STOR_MESS_PREREVERT 3
78 #define STOR_MESS_REVERTED 4
80 namespace cppu
82 class OTypeCollection;
85 //================================================
86 // a common implementation for an entry
88 struct StorInternalData_Impl;
89 struct OStorage_Impl;
90 struct OWriteStream_Impl;
92 struct SotElement_Impl
94 ::rtl::OUString m_aName;
95 ::rtl::OUString m_aOriginalName;
96 sal_Bool m_bIsRemoved;
97 sal_Bool m_bIsInserted;
98 sal_Bool m_bIsStorage;
100 OStorage_Impl* m_pStorage;
101 OWriteStream_Impl* m_pStream;
103 public:
104 SotElement_Impl( const ::rtl::OUString& rName, sal_Bool bStor, sal_Bool bNew );
105 ~SotElement_Impl();
108 #include <list>
109 typedef ::std::list< SotElement_Impl* > SotElementList_Impl;
111 //=========================================================================
112 // Main storage implementation
114 class OStorage;
116 struct StorageHolder_Impl
118 OStorage* m_pPointer;
119 ::com::sun::star::uno::WeakReference< ::com::sun::star::embed::XStorage > m_xWeakRef;
121 StorageHolder_Impl( OStorage* pStorage )
122 : m_pPointer( pStorage )
123 , m_xWeakRef( ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >(
124 (::com::sun::star::embed::XStorage*)pStorage ) )
128 StorageHolder_Impl( const StorageHolder_Impl& aSH )
129 : m_pPointer( aSH.m_pPointer )
130 , m_xWeakRef( aSH.m_xWeakRef )
135 typedef ::std::list< StorageHolder_Impl > OStorageList_Impl;
137 class SwitchablePersistenceStream;
138 struct OStorage_Impl
140 SotMutexHolderRef m_rMutexRef;
142 OStorage* m_pAntiImpl; // only valid if external references exists
143 OStorageList_Impl m_aReadOnlyWrapList; // only valid if readonly external reference exists
145 sal_Int32 m_nStorageMode; // open mode ( read/write/trunc/nocreate )
146 sal_Bool m_bIsModified; // only modified elements will be sent to the original content
147 sal_Bool m_bBroadcastModified; // will be set if notification is required
148 sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package
150 sal_Bool m_bIsRoot; // marks this storage as root storages that manages all commits and reverts
151 sal_Bool m_bListCreated;
154 SotElementList_Impl m_aChildrenList;
155 SotElementList_Impl m_aDeletedList;
157 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xPackageFolder;
159 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > m_xPackage;
160 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
162 // valid only for root storage
163 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; // ??? may be stored in properties
164 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; // ??? may be stored in properties
165 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_xProperties;
166 sal_Bool m_bHasCommonPassword;
167 ::rtl::OUString m_aCommonPassword;
169 // must be empty in case of root storage
170 OStorage_Impl* m_pParent;
172 sal_Bool m_bControlMediaType;
173 ::rtl::OUString m_aMediaType;
174 sal_Bool m_bMTFallbackUsed;
176 sal_Bool m_bControlVersion;
177 ::rtl::OUString m_aVersion;
179 SwitchablePersistenceStream* m_pSwitchStream;
181 sal_Int16 m_nStorageType; // the mode in wich the storage is used
183 // the _rels substorage that is handled in a special way in OFOPXML_STORAGE
184 SotElement_Impl* m_pRelStorElement;
185 ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage;
186 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo;
187 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream;
188 sal_Int16 m_nRelInfoStatus;
190 //////////////////////////////////////////
191 // Constructors
193 OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
194 sal_Int32 nMode,
195 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
196 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
197 sal_Int16 nStorageType );
199 OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
200 sal_Int32 nMode,
201 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
202 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
203 sal_Int16 nStorageType );
205 // constructor for a substorage
206 OStorage_Impl( OStorage_Impl* pParent,
207 sal_Int32 nMode,
208 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder,
209 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage,
210 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
211 sal_Int16 nStorageType );
213 ~OStorage_Impl();
215 void SetReadOnlyWrap( OStorage& aStorage );
216 void RemoveReadOnlyWrap( OStorage& aStorage );
218 void OpenOwnPackage();
219 void ReadContents();
220 void ReadRelInfoIfNecessary();
222 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory();
223 SotElementList_Impl& GetChildrenList();
224 void GetStorageProperties();
226 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
227 void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor );
228 void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor,
229 const ::rtl::OUString& aPass );
231 void InsertIntoPackageFolder(
232 const ::rtl::OUString& aName,
233 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xParentPackageFolder );
235 void Commit();
236 void Revert();
238 ::rtl::OUString GetCommonRootPass() throw ( ::com::sun::star::packages::NoEncryptionException );
240 void CopyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
241 sal_Bool bDirect );
242 void CopyStorageElement( SotElement_Impl* pElement,
243 ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xDest,
244 ::rtl::OUString aName,
245 sal_Bool bDirect );
247 void SetModified( sal_Bool bModified );
249 SotElement_Impl* FindElement( const ::rtl::OUString& rName );
252 SotElement_Impl* InsertStream( ::rtl::OUString aName, sal_Bool bEncr );
253 SotElement_Impl* InsertRawStream( ::rtl::OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
255 OStorage_Impl* CreateNewStorageImpl( sal_Int32 nStorageMode );
256 SotElement_Impl* InsertStorage( ::rtl::OUString aName, sal_Int32 nStorageMode );
257 SotElement_Impl* InsertElement( ::rtl::OUString aName, sal_Bool bIsStorage );
259 void OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorageMode );
260 void OpenSubStream( SotElement_Impl* pElement );
262 ::com::sun::star::uno::Sequence< ::rtl::OUString > GetElementNames();
264 void RemoveElement( SotElement_Impl* pElement );
265 void ClearElement( SotElement_Impl* pElement );
266 void DisposeChildren();
268 void CloneStreamElement(
269 const ::rtl::OUString& aStreamName,
270 sal_Bool bPassProvided,
271 const ::rtl::OUString& aPass,
272 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
273 throw ( ::com::sun::star::embed::InvalidStorageException,
274 ::com::sun::star::lang::IllegalArgumentException,
275 ::com::sun::star::packages::WrongPasswordException,
276 ::com::sun::star::io::IOException,
277 ::com::sun::star::embed::StorageWrappedTargetException,
278 ::com::sun::star::uno::RuntimeException );
280 void RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName );
281 void CreateRelStorage();
282 void CommitStreamRelInfo( SotElement_Impl* pStreamElement );
283 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetRelInfoStreamForName( const ::rtl::OUString& aName );
284 void CommitRelInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xNewPackageFolder );
286 static void completeStorageStreamCopy_Impl(
287 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSource,
288 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDest,
289 sal_Int16 nStorageType,
290 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aRelInfo );
295 class OStorage : public ::com::sun::star::lang::XTypeProvider
296 , public ::com::sun::star::embed::XStorage
297 , public ::com::sun::star::embed::XStorageRawAccess
298 , public ::com::sun::star::embed::XTransactedObject
299 , public ::com::sun::star::embed::XTransactionBroadcaster
300 , public ::com::sun::star::util::XModifiable
301 // , public ::com::sun::star::container::XNameAccess
302 // , public ::com::sun::star::lang::XComponent
303 , public ::com::sun::star::embed::XEncryptionProtectedSource
304 , public ::com::sun::star::beans::XPropertySet
305 , public ::com::sun::star::embed::XOptimizedStorage
306 , public ::com::sun::star::embed::XRelationshipAccess
307 , public ::com::sun::star::embed::XHierarchicalStorageAccess
308 , public ::cppu::OWeakObject
310 OStorage_Impl* m_pImpl;
311 StorInternalData_Impl* m_pData;
313 protected:
315 void Commit_Impl();
317 SotElement_Impl* OpenStreamElement_Impl( const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, sal_Bool bEncr );
319 void BroadcastModifiedIfNecessary();
321 void BroadcastTransaction( sal_Int8 nMessage );
323 void MakeLinkToSubComponent_Impl(
324 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComponent );
326 public:
328 OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
329 sal_Int32 nMode,
330 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
331 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
332 sal_Int16 nStorageType );
334 OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
335 sal_Int32 nMode,
336 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
337 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
338 sal_Int16 nStorageType );
340 OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap );
342 virtual ~OStorage();
344 void SAL_CALL InternalDispose( sal_Bool bNotifyImpl );
346 void ChildIsDisposed( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xChild );
348 sal_Int32 GetRefCount_Impl() { return m_refCount; }
350 //____________________________________________________________________________________________________
351 // XInterface
352 //____________________________________________________________________________________________________
354 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
355 throw( ::com::sun::star::uno::RuntimeException );
357 virtual void SAL_CALL acquire() throw();
359 virtual void SAL_CALL release() throw();
361 //____________________________________________________________________________________________________
362 // XTypeProvider
363 //____________________________________________________________________________________________________
365 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
366 throw( ::com::sun::star::uno::RuntimeException );
368 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
369 throw( ::com::sun::star::uno::RuntimeException );
371 //____________________________________________________________________________________________________
372 // XStorage
373 //____________________________________________________________________________________________________
375 virtual void SAL_CALL copyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest )
376 throw ( ::com::sun::star::embed::InvalidStorageException,
377 ::com::sun::star::lang::IllegalArgumentException,
378 ::com::sun::star::io::IOException,
379 ::com::sun::star::embed::StorageWrappedTargetException,
380 ::com::sun::star::uno::RuntimeException );
382 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openStreamElement(
383 const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode )
384 throw ( ::com::sun::star::embed::InvalidStorageException,
385 ::com::sun::star::lang::IllegalArgumentException,
386 ::com::sun::star::packages::WrongPasswordException,
387 ::com::sun::star::io::IOException,
388 ::com::sun::star::embed::StorageWrappedTargetException,
389 ::com::sun::star::uno::RuntimeException );
391 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStreamElement(
392 const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, const ::rtl::OUString& aPass )
393 throw ( ::com::sun::star::embed::InvalidStorageException,
394 ::com::sun::star::lang::IllegalArgumentException,
395 ::com::sun::star::packages::NoEncryptionException,
396 ::com::sun::star::packages::WrongPasswordException,
397 ::com::sun::star::io::IOException,
398 ::com::sun::star::embed::StorageWrappedTargetException,
399 ::com::sun::star::uno::RuntimeException );
401 virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL openStorageElement(
402 const ::rtl::OUString& aStorName, sal_Int32 nStorageMode )
403 throw ( ::com::sun::star::embed::InvalidStorageException,
404 ::com::sun::star::lang::IllegalArgumentException,
405 ::com::sun::star::io::IOException,
406 ::com::sun::star::embed::StorageWrappedTargetException,
407 ::com::sun::star::uno::RuntimeException );
409 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneStreamElement(
410 const ::rtl::OUString& aStreamName )
411 throw ( ::com::sun::star::embed::InvalidStorageException,
412 ::com::sun::star::lang::IllegalArgumentException,
413 ::com::sun::star::packages::WrongPasswordException,
414 ::com::sun::star::io::IOException,
415 ::com::sun::star::embed::StorageWrappedTargetException,
416 ::com::sun::star::uno::RuntimeException );
418 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStreamElement(
419 const ::rtl::OUString& aStreamName, const ::rtl::OUString& aPass )
420 throw ( ::com::sun::star::embed::InvalidStorageException,
421 ::com::sun::star::lang::IllegalArgumentException,
422 ::com::sun::star::packages::NoEncryptionException,
423 ::com::sun::star::packages::WrongPasswordException,
424 ::com::sun::star::io::IOException,
425 ::com::sun::star::embed::StorageWrappedTargetException,
426 ::com::sun::star::uno::RuntimeException );
428 virtual void SAL_CALL copyLastCommitTo(
429 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage )
430 throw ( ::com::sun::star::embed::InvalidStorageException,
431 ::com::sun::star::lang::IllegalArgumentException,
432 ::com::sun::star::io::IOException,
433 ::com::sun::star::embed::StorageWrappedTargetException,
434 ::com::sun::star::uno::RuntimeException );
436 virtual void SAL_CALL copyStorageElementLastCommitTo(
437 const ::rtl::OUString& aStorName,
438 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage )
439 throw ( ::com::sun::star::embed::InvalidStorageException,
440 ::com::sun::star::lang::IllegalArgumentException,
441 ::com::sun::star::io::IOException,
442 ::com::sun::star::embed::StorageWrappedTargetException,
443 ::com::sun::star::uno::RuntimeException );
445 virtual sal_Bool SAL_CALL isStreamElement( const ::rtl::OUString& aElementName )
446 throw ( ::com::sun::star::container::NoSuchElementException,
447 ::com::sun::star::lang::IllegalArgumentException,
448 ::com::sun::star::embed::InvalidStorageException,
449 ::com::sun::star::uno::RuntimeException );
451 virtual sal_Bool SAL_CALL isStorageElement( const ::rtl::OUString& aElementName )
452 throw ( ::com::sun::star::container::NoSuchElementException,
453 ::com::sun::star::lang::IllegalArgumentException,
454 ::com::sun::star::embed::InvalidStorageException,
455 ::com::sun::star::uno::RuntimeException );
457 virtual void SAL_CALL removeElement( const ::rtl::OUString& aElementName )
458 throw ( ::com::sun::star::embed::InvalidStorageException,
459 ::com::sun::star::lang::IllegalArgumentException,
460 ::com::sun::star::container::NoSuchElementException,
461 ::com::sun::star::io::IOException,
462 ::com::sun::star::embed::StorageWrappedTargetException,
463 ::com::sun::star::uno::RuntimeException );
465 virtual void SAL_CALL renameElement( const ::rtl::OUString& rEleName, const ::rtl::OUString& rNewName )
466 throw ( ::com::sun::star::embed::InvalidStorageException,
467 ::com::sun::star::lang::IllegalArgumentException,
468 ::com::sun::star::container::NoSuchElementException,
469 ::com::sun::star::container::ElementExistException,
470 ::com::sun::star::io::IOException,
471 ::com::sun::star::embed::StorageWrappedTargetException,
472 ::com::sun::star::uno::RuntimeException );
474 virtual void SAL_CALL copyElementTo( const ::rtl::OUString& aElementName,
475 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
476 const ::rtl::OUString& aNewName )
477 throw ( ::com::sun::star::embed::InvalidStorageException,
478 ::com::sun::star::lang::IllegalArgumentException,
479 ::com::sun::star::container::NoSuchElementException,
480 ::com::sun::star::container::ElementExistException,
481 ::com::sun::star::io::IOException,
482 ::com::sun::star::embed::StorageWrappedTargetException,
483 ::com::sun::star::uno::RuntimeException );
485 virtual void SAL_CALL moveElementTo( const ::rtl::OUString& aElementName,
486 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
487 const ::rtl::OUString& rNewName )
488 throw ( ::com::sun::star::embed::InvalidStorageException,
489 ::com::sun::star::lang::IllegalArgumentException,
490 ::com::sun::star::container::NoSuchElementException,
491 ::com::sun::star::container::ElementExistException,
492 ::com::sun::star::io::IOException,
493 ::com::sun::star::embed::StorageWrappedTargetException,
494 ::com::sun::star::uno::RuntimeException );
496 //____________________________________________________________________________________________________
497 // XStorageRawAccess
498 //____________________________________________________________________________________________________
500 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getPlainRawStreamElement(
501 const ::rtl::OUString& sStreamName )
502 throw ( ::com::sun::star::embed::InvalidStorageException,
503 ::com::sun::star::lang::IllegalArgumentException,
504 ::com::sun::star::container::NoSuchElementException,
505 ::com::sun::star::io::IOException,
506 ::com::sun::star::embed::StorageWrappedTargetException,
507 ::com::sun::star::uno::RuntimeException );
509 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawEncrStreamElement(
510 const ::rtl::OUString& sStreamName )
511 throw ( ::com::sun::star::embed::InvalidStorageException,
512 ::com::sun::star::lang::IllegalArgumentException,
513 ::com::sun::star::packages::NoEncryptionException,
514 ::com::sun::star::container::NoSuchElementException,
515 ::com::sun::star::io::IOException,
516 ::com::sun::star::embed::StorageWrappedTargetException,
517 ::com::sun::star::uno::RuntimeException );
519 virtual void SAL_CALL insertRawEncrStreamElement( const ::rtl::OUString& aStreamName,
520 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
521 throw ( ::com::sun::star::embed::InvalidStorageException,
522 ::com::sun::star::lang::IllegalArgumentException,
523 ::com::sun::star::packages::NoRawFormatException,
524 ::com::sun::star::container::ElementExistException,
525 ::com::sun::star::io::IOException,
526 ::com::sun::star::embed::StorageWrappedTargetException,
527 ::com::sun::star::uno::RuntimeException);
529 //____________________________________________________________________________________________________
530 // XTransactedObject
531 //____________________________________________________________________________________________________
533 virtual void SAL_CALL commit()
534 throw ( ::com::sun::star::io::IOException,
535 ::com::sun::star::embed::StorageWrappedTargetException,
536 ::com::sun::star::uno::RuntimeException );
538 virtual void SAL_CALL revert()
539 throw ( ::com::sun::star::io::IOException,
540 ::com::sun::star::embed::StorageWrappedTargetException,
541 ::com::sun::star::uno::RuntimeException );
543 //____________________________________________________________________________________________________
544 // XTransactionBroadcaster
545 //____________________________________________________________________________________________________
547 virtual void SAL_CALL addTransactionListener(
548 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener )
549 throw ( ::com::sun::star::uno::RuntimeException );
551 virtual void SAL_CALL removeTransactionListener(
552 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener )
553 throw ( ::com::sun::star::uno::RuntimeException );
555 //____________________________________________________________________________________________________
556 // XModifiable
557 //____________________________________________________________________________________________________
559 virtual sal_Bool SAL_CALL isModified()
560 throw ( ::com::sun::star::uno::RuntimeException );
562 virtual void SAL_CALL setModified( sal_Bool bModified )
563 throw ( ::com::sun::star::beans::PropertyVetoException,
564 ::com::sun::star::uno::RuntimeException );
566 virtual void SAL_CALL addModifyListener(
567 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
568 throw ( ::com::sun::star::uno::RuntimeException );
570 virtual void SAL_CALL removeModifyListener(
571 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
572 throw ( ::com::sun::star::uno::RuntimeException );
574 //____________________________________________________________________________________________________
575 // XNameAccess
576 //____________________________________________________________________________________________________
578 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
579 throw ( ::com::sun::star::container::NoSuchElementException,
580 ::com::sun::star::lang::WrappedTargetException,
581 ::com::sun::star::uno::RuntimeException );
583 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
584 throw ( ::com::sun::star::uno::RuntimeException );
586 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
587 throw ( ::com::sun::star::uno::RuntimeException );
589 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
590 throw ( ::com::sun::star::uno::RuntimeException );
592 virtual sal_Bool SAL_CALL hasElements()
593 throw ( ::com::sun::star::uno::RuntimeException );
595 //____________________________________________________________________________________________________
596 // XComponent
597 //____________________________________________________________________________________________________
599 virtual void SAL_CALL dispose()
600 throw ( ::com::sun::star::uno::RuntimeException );
602 virtual void SAL_CALL addEventListener(
603 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
604 throw ( ::com::sun::star::uno::RuntimeException );
606 virtual void SAL_CALL removeEventListener(
607 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
608 throw ( ::com::sun::star::uno::RuntimeException );
610 //____________________________________________________________________________________________________
611 // XEncryptionProtectedSource
612 //____________________________________________________________________________________________________
614 virtual void SAL_CALL setEncryptionPassword( const ::rtl::OUString& aPass )
615 throw ( ::com::sun::star::uno::RuntimeException,
616 ::com::sun::star::io::IOException );
618 virtual void SAL_CALL removeEncryption()
619 throw ( ::com::sun::star::uno::RuntimeException,
620 ::com::sun::star::io::IOException );
622 //____________________________________________________________________________________________________
623 // XPropertySet
624 //____________________________________________________________________________________________________
626 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
627 throw ( ::com::sun::star::uno::RuntimeException );
629 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
630 throw ( ::com::sun::star::beans::UnknownPropertyException,
631 ::com::sun::star::beans::PropertyVetoException,
632 ::com::sun::star::lang::IllegalArgumentException,
633 ::com::sun::star::lang::WrappedTargetException,
634 ::com::sun::star::uno::RuntimeException );
636 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
637 throw ( ::com::sun::star::beans::UnknownPropertyException,
638 ::com::sun::star::lang::WrappedTargetException,
639 ::com::sun::star::uno::RuntimeException );
641 virtual void SAL_CALL addPropertyChangeListener(
642 const ::rtl::OUString& aPropertyName,
643 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
644 throw ( ::com::sun::star::beans::UnknownPropertyException,
645 ::com::sun::star::lang::WrappedTargetException,
646 ::com::sun::star::uno::RuntimeException );
648 virtual void SAL_CALL removePropertyChangeListener(
649 const ::rtl::OUString& aPropertyName,
650 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
651 throw ( ::com::sun::star::beans::UnknownPropertyException,
652 ::com::sun::star::lang::WrappedTargetException,
653 ::com::sun::star::uno::RuntimeException );
655 virtual void SAL_CALL addVetoableChangeListener(
656 const ::rtl::OUString& PropertyName,
657 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
658 throw ( ::com::sun::star::beans::UnknownPropertyException,
659 ::com::sun::star::lang::WrappedTargetException,
660 ::com::sun::star::uno::RuntimeException );
662 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
663 throw ( ::com::sun::star::beans::UnknownPropertyException,
664 ::com::sun::star::lang::WrappedTargetException,
665 ::com::sun::star::uno::RuntimeException );
667 //____________________________________________________________________________________________________
668 // XOptimizedStorage
669 //____________________________________________________________________________________________________
670 virtual void SAL_CALL insertRawNonEncrStreamElementDirect( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
671 throw ( ::com::sun::star::embed::InvalidStorageException,
672 ::com::sun::star::lang::IllegalArgumentException,
673 ::com::sun::star::packages::NoRawFormatException,
674 ::com::sun::star::container::ElementExistException,
675 ::com::sun::star::io::IOException,
676 ::com::sun::star::embed::StorageWrappedTargetException,
677 ::com::sun::star::uno::RuntimeException );
679 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 )
680 throw ( ::com::sun::star::embed::InvalidStorageException,
681 ::com::sun::star::lang::IllegalArgumentException,
682 ::com::sun::star::container::ElementExistException,
683 ::com::sun::star::io::IOException,
684 ::com::sun::star::embed::StorageWrappedTargetException,
685 ::com::sun::star::uno::RuntimeException );
687 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 )
688 throw ( ::com::sun::star::embed::InvalidStorageException,
689 ::com::sun::star::lang::IllegalArgumentException,
690 ::com::sun::star::container::NoSuchElementException,
691 ::com::sun::star::container::ElementExistException,
692 ::com::sun::star::io::IOException,
693 ::com::sun::star::embed::StorageWrappedTargetException,
694 ::com::sun::star::uno::RuntimeException );
696 virtual void SAL_CALL writeAndAttachToStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream )
697 throw ( ::com::sun::star::embed::InvalidStorageException,
698 ::com::sun::star::lang::IllegalArgumentException,
699 ::com::sun::star::io::IOException,
700 ::com::sun::star::embed::StorageWrappedTargetException,
701 ::com::sun::star::uno::RuntimeException );
703 virtual void SAL_CALL attachToURL( const ::rtl::OUString& sURL, sal_Bool bReadOnly )
704 throw ( ::com::sun::star::embed::InvalidStorageException,
705 ::com::sun::star::lang::IllegalArgumentException,
706 ::com::sun::star::io::IOException,
707 ::com::sun::star::embed::StorageWrappedTargetException,
708 ::com::sun::star::uno::RuntimeException );
710 virtual ::com::sun::star::uno::Any SAL_CALL getElementPropertyValue( const ::rtl::OUString& sElementName, const ::rtl::OUString& sPropertyName )
711 throw ( ::com::sun::star::embed::InvalidStorageException,
712 ::com::sun::star::lang::IllegalArgumentException,
713 ::com::sun::star::container::NoSuchElementException,
714 ::com::sun::star::io::IOException,
715 ::com::sun::star::beans::UnknownPropertyException,
716 ::com::sun::star::beans::PropertyVetoException,
717 ::com::sun::star::embed::StorageWrappedTargetException,
718 ::com::sun::star::uno::RuntimeException);
720 virtual void SAL_CALL copyStreamElementData( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
721 throw ( ::com::sun::star::embed::InvalidStorageException,
722 ::com::sun::star::lang::IllegalArgumentException,
723 ::com::sun::star::packages::WrongPasswordException,
724 ::com::sun::star::io::IOException,
725 ::com::sun::star::embed::StorageWrappedTargetException,
726 ::com::sun::star::uno::RuntimeException );
728 //____________________________________________________________________________________________________
729 // XRelationshipAccess
730 //____________________________________________________________________________________________________
732 virtual ::sal_Bool SAL_CALL hasByID( const ::rtl::OUString& sID )
733 throw ( ::com::sun::star::io::IOException,
734 ::com::sun::star::uno::RuntimeException);
736 virtual ::rtl::OUString SAL_CALL getTargetByID( const ::rtl::OUString& sID )
737 throw ( ::com::sun::star::container::NoSuchElementException,
738 ::com::sun::star::io::IOException,
739 ::com::sun::star::uno::RuntimeException);
741 virtual ::rtl::OUString SAL_CALL getTypeByID( const ::rtl::OUString& sID )
742 throw ( ::com::sun::star::container::NoSuchElementException,
743 ::com::sun::star::io::IOException,
744 ::com::sun::star::uno::RuntimeException);
746 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > SAL_CALL getRelationshipByID( const ::rtl::OUString& sID )
747 throw ( ::com::sun::star::container::NoSuchElementException,
748 ::com::sun::star::io::IOException,
749 ::com::sun::star::uno::RuntimeException);
751 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getRelationshipsByType( const ::rtl::OUString& sType )
752 throw ( ::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 getAllRelationships( )
756 throw ( ::com::sun::star::io::IOException,
757 ::com::sun::star::uno::RuntimeException);
759 virtual void SAL_CALL insertRelationshipByID( const ::rtl::OUString& sID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aEntry, ::sal_Bool bReplace )
760 throw ( ::com::sun::star::container::ElementExistException,
761 ::com::sun::star::io::IOException,
762 ::com::sun::star::uno::RuntimeException);
764 virtual void SAL_CALL removeRelationshipByID( const ::rtl::OUString& sID )
765 throw ( ::com::sun::star::container::NoSuchElementException,
766 ::com::sun::star::io::IOException,
767 ::com::sun::star::uno::RuntimeException);
769 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 )
770 throw ( ::com::sun::star::container::ElementExistException,
771 ::com::sun::star::io::IOException,
772 ::com::sun::star::uno::RuntimeException);
774 virtual void SAL_CALL clearRelationships( )
775 throw ( ::com::sun::star::io::IOException,
776 ::com::sun::star::uno::RuntimeException);
778 //____________________________________________________________________________________________________
779 // XHierarchicalStorageAccess
780 //____________________________________________________________________________________________________
782 virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode )
783 throw ( ::com::sun::star::embed::InvalidStorageException,
784 ::com::sun::star::lang::IllegalArgumentException,
785 ::com::sun::star::packages::WrongPasswordException,
786 ::com::sun::star::io::IOException,
787 ::com::sun::star::embed::StorageWrappedTargetException,
788 ::com::sun::star::uno::RuntimeException);
790 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 )
791 throw ( ::com::sun::star::embed::InvalidStorageException,
792 ::com::sun::star::lang::IllegalArgumentException,
793 ::com::sun::star::packages::NoEncryptionException,
794 ::com::sun::star::packages::WrongPasswordException,
795 ::com::sun::star::io::IOException,
796 ::com::sun::star::embed::StorageWrappedTargetException,
797 ::com::sun::star::uno::RuntimeException);
799 virtual void SAL_CALL removeStreamElementByHierarchicalName( const ::rtl::OUString& sElementPath )
800 throw ( ::com::sun::star::embed::InvalidStorageException,
801 ::com::sun::star::lang::IllegalArgumentException,
802 ::com::sun::star::container::NoSuchElementException,
803 ::com::sun::star::io::IOException,
804 ::com::sun::star::embed::StorageWrappedTargetException,
805 ::com::sun::star::uno::RuntimeException);
810 #endif