1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __XSTORAGE_HXX_
21 #define __XSTORAGE_HXX_
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <com/sun/star/embed/XStorage2.hpp>
25 #include <com/sun/star/embed/XOptimizedStorage.hpp>
26 #include <com/sun/star/embed/XHierarchicalStorageAccess2.hpp>
27 #include <com/sun/star/embed/XStorageRawAccess.hpp>
28 #include <com/sun/star/embed/XTransactedObject.hpp>
29 #include <com/sun/star/embed/XTransactionBroadcaster.hpp>
30 #include <com/sun/star/embed/XClassifiedObject.hpp>
31 #include <com/sun/star/embed/XEncryptionProtectedStorage.hpp>
32 #include <com/sun/star/embed/XRelationshipAccess.hpp>
33 #include <com/sun/star/util/XModifiable.hpp>
34 #include <com/sun/star/container/XNameAccess.hpp>
35 #include <com/sun/star/container/XNameContainer.hpp>
36 #include <com/sun/star/util/XCloseable.hpp>
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/beans/PropertyValue.hpp>
39 #include <com/sun/star/beans/StringPair.hpp>
40 #include <com/sun/star/io/XStream.hpp>
41 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
42 #include <com/sun/star/lang/XTypeProvider.hpp>
43 #include <com/sun/star/lang/XComponent.hpp>
44 #include <com/sun/star/packages/NoEncryptionException.hpp>
45 #include <com/sun/star/logging/XSimpleLogRing.hpp>
47 #include <cppuhelper/weak.hxx>
48 #include <cppuhelper/interfacecontainer.h>
49 #include <comphelper/sequenceashashmap.hxx>
51 #include "mutexholder.hxx"
53 #define RELINFO_NO_INIT 1
54 #define RELINFO_READ 2
55 #define RELINFO_CHANGED 3
56 #define RELINFO_CHANGED_STREAM 4
57 #define RELINFO_CHANGED_STREAM_READ 5
58 #define RELINFO_BROKEN 6
59 #define RELINFO_CHANGED_BROKEN 7
61 #define STOR_MESS_PRECOMMIT 1
62 #define STOR_MESS_COMMITED 2
63 #define STOR_MESS_PREREVERT 3
64 #define STOR_MESS_REVERTED 4
66 //================================================
67 // a common implementation for an entry
69 struct StorInternalData_Impl
;
71 struct OWriteStream_Impl
;
73 struct SotElement_Impl
76 OUString m_aOriginalName
;
77 sal_Bool m_bIsRemoved
;
78 sal_Bool m_bIsInserted
;
79 sal_Bool m_bIsStorage
;
81 OStorage_Impl
* m_pStorage
;
82 OWriteStream_Impl
* m_pStream
;
85 SotElement_Impl( const OUString
& rName
, sal_Bool bStor
, sal_Bool bNew
);
90 typedef ::std::list
< SotElement_Impl
* > SotElementList_Impl
;
92 //=========================================================================
93 // Main storage implementation
97 struct StorageHolder_Impl
100 ::com::sun::star::uno::WeakReference
< ::com::sun::star::embed::XStorage
> m_xWeakRef
;
102 StorageHolder_Impl( OStorage
* pStorage
)
103 : m_pPointer( pStorage
)
104 , m_xWeakRef( ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>(
105 (::com::sun::star::embed::XStorage
*)pStorage
) )
109 StorageHolder_Impl( const StorageHolder_Impl
& aSH
)
110 : m_pPointer( aSH
.m_pPointer
)
111 , m_xWeakRef( aSH
.m_xWeakRef
)
116 typedef ::std::list
< StorageHolder_Impl
> OStorageList_Impl
;
118 class SwitchablePersistenceStream
;
121 SotMutexHolderRef m_rMutexRef
;
123 OStorage
* m_pAntiImpl
; // only valid if external references exists
124 OStorageList_Impl m_aReadOnlyWrapList
; // only valid if readonly external reference exists
126 sal_Int32 m_nStorageMode
; // open mode ( read/write/trunc/nocreate )
127 sal_Bool m_bIsModified
; // only modified elements will be sent to the original content
128 sal_Bool m_bBroadcastModified
; // will be set if notification is required
129 sal_Bool m_bCommited
; // sending the streams is coordinated by the root storage of the package
131 sal_Bool m_bIsRoot
; // marks this storage as root storages that manages all commits and reverts
132 sal_Bool m_bListCreated
;
135 SotElementList_Impl m_aChildrenList
;
136 SotElementList_Impl m_aDeletedList
;
138 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> m_xPackageFolder
;
139 ::com::sun::star::uno::Reference
< ::com::sun::star::logging::XSimpleLogRing
> m_xLogRing
;
141 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XSingleServiceFactory
> m_xPackage
;
142 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
144 // valid only for root storage
145 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> m_xInputStream
; // ??? may be stored in properties
146 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> m_xStream
; // ??? may be stored in properties
147 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> m_xProperties
;
148 sal_Bool m_bHasCommonEncryptionData
;
149 ::comphelper::SequenceAsHashMap m_aCommonEncryptionData
;
151 // must be empty in case of root storage
152 OStorage_Impl
* m_pParent
;
154 sal_Bool m_bControlMediaType
;
155 OUString m_aMediaType
;
156 sal_Bool m_bMTFallbackUsed
;
158 sal_Bool m_bControlVersion
;
161 SwitchablePersistenceStream
* m_pSwitchStream
;
163 sal_Int32 m_nStorageType
; // the mode in which the storage is used
165 // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML
166 SotElement_Impl
* m_pRelStorElement
;
167 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> m_xRelStorage
;
168 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> > m_aRelInfo
;
169 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> m_xNewRelInfoStream
;
170 sal_Int16 m_nRelInfoStatus
;
172 //////////////////////////////////////////
175 OStorage_Impl( ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> xInputStream
,
177 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> xProperties
,
178 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> xContext
,
179 sal_Int32 nStorageType
);
181 OStorage_Impl( ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> xStream
,
183 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> xProperties
,
184 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> xContext
,
185 sal_Int32 nStorageType
);
187 // constructor for a substorage
188 OStorage_Impl( OStorage_Impl
* pParent
,
190 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> xPackageFolder
,
191 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XSingleServiceFactory
> xPackage
,
192 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> xContext
,
193 sal_Int32 nStorageType
);
197 void AddLog( const OUString
& aMessage
);
199 void SetReadOnlyWrap( OStorage
& aStorage
);
200 void RemoveReadOnlyWrap( OStorage
& aStorage
);
202 void OpenOwnPackage();
204 void ReadRelInfoIfNecessary();
206 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> GetComponentContext();
207 SotElementList_Impl
& GetChildrenList();
208 void GetStorageProperties();
210 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> > GetAllRelationshipsIfAny();
211 void CopyLastCommitTo( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xNewStor
);
212 void CopyLastCommitTo( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xNewStor
,
213 const OUString
& aPass
);
215 void InsertIntoPackageFolder(
216 const OUString
& aName
,
217 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
>& xParentPackageFolder
);
222 ::comphelper::SequenceAsHashMap
GetCommonRootEncryptionData() throw ( ::com::sun::star::packages::NoEncryptionException
);
224 void CopyToStorage( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xDest
,
226 void CopyStorageElement( SotElement_Impl
* pElement
,
227 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> xDest
,
231 void SetModified( sal_Bool bModified
);
233 SotElement_Impl
* FindElement( const OUString
& rName
);
236 SotElement_Impl
* InsertStream( OUString aName
, sal_Bool bEncr
);
237 SotElement_Impl
* InsertRawStream( OUString aName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& xInStream
);
239 OStorage_Impl
* CreateNewStorageImpl( sal_Int32 nStorageMode
);
240 SotElement_Impl
* InsertStorage( OUString aName
, sal_Int32 nStorageMode
);
241 SotElement_Impl
* InsertElement( OUString aName
, sal_Bool bIsStorage
);
243 void OpenSubStorage( SotElement_Impl
* pElement
, sal_Int32 nStorageMode
);
244 void OpenSubStream( SotElement_Impl
* pElement
);
246 ::com::sun::star::uno::Sequence
< OUString
> GetElementNames();
248 void RemoveElement( SotElement_Impl
* pElement
);
249 void ClearElement( SotElement_Impl
* pElement
);
250 void DisposeChildren();
252 void CloneStreamElement(
253 const OUString
& aStreamName
,
254 sal_Bool bPassProvided
,
255 const ::comphelper::SequenceAsHashMap
& aEncryptionData
,
256 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
>& xTargetStream
)
257 throw ( ::com::sun::star::embed::InvalidStorageException
,
258 ::com::sun::star::lang::IllegalArgumentException
,
259 ::com::sun::star::packages::WrongPasswordException
,
260 ::com::sun::star::io::IOException
,
261 ::com::sun::star::embed::StorageWrappedTargetException
,
262 ::com::sun::star::uno::RuntimeException
);
264 void RemoveStreamRelInfo( const OUString
& aOriginalName
);
265 void CreateRelStorage();
266 void CommitStreamRelInfo( SotElement_Impl
* pStreamElement
);
267 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> GetRelInfoStreamForName( const OUString
& aName
);
268 void CommitRelInfo( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
>& xNewPackageFolder
);
270 static void completeStorageStreamCopy_Impl(
271 const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
>& xSource
,
272 const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
>& xDest
,
273 sal_Int32 nStorageType
,
274 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> >& aRelInfo
);
279 class OStorage
: public ::com::sun::star::lang::XTypeProvider
280 , public ::com::sun::star::embed::XStorage2
281 , public ::com::sun::star::embed::XStorageRawAccess
282 , public ::com::sun::star::embed::XTransactedObject
283 , public ::com::sun::star::embed::XTransactionBroadcaster
284 , public ::com::sun::star::util::XModifiable
285 , public ::com::sun::star::embed::XEncryptionProtectedStorage
286 , public ::com::sun::star::beans::XPropertySet
287 , public ::com::sun::star::embed::XOptimizedStorage
288 , public ::com::sun::star::embed::XRelationshipAccess
289 , public ::com::sun::star::embed::XHierarchicalStorageAccess2
290 , public ::cppu::OWeakObject
292 OStorage_Impl
* m_pImpl
;
293 StorInternalData_Impl
* m_pData
;
299 SotElement_Impl
* OpenStreamElement_Impl( const OUString
& aStreamName
, sal_Int32 nOpenMode
, sal_Bool bEncr
);
301 void BroadcastModifiedIfNecessary();
303 void BroadcastTransaction( sal_Int8 nMessage
);
305 void MakeLinkToSubComponent_Impl(
306 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& xComponent
);
310 OStorage( ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> xInputStream
,
312 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> xProperties
,
313 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> xContext
,
314 sal_Int32 nStorageType
);
316 OStorage( ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> xStream
,
318 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> xProperties
,
319 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> xContext
,
320 sal_Int32 nStorageType
);
322 OStorage( OStorage_Impl
* pImpl
, sal_Bool bReadOnlyWrap
);
326 void SAL_CALL
InternalDispose( sal_Bool bNotifyImpl
);
328 void ChildIsDisposed( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xChild
);
330 sal_Int32
GetRefCount_Impl() { return m_refCount
; }
332 //____________________________________________________________________________________________________
334 //____________________________________________________________________________________________________
336 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& rType
)
337 throw( ::com::sun::star::uno::RuntimeException
);
339 virtual void SAL_CALL
acquire() throw();
341 virtual void SAL_CALL
release() throw();
343 //____________________________________________________________________________________________________
345 //____________________________________________________________________________________________________
347 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes()
348 throw( ::com::sun::star::uno::RuntimeException
);
350 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId()
351 throw( ::com::sun::star::uno::RuntimeException
);
353 //____________________________________________________________________________________________________
355 //____________________________________________________________________________________________________
357 virtual void SAL_CALL
copyToStorage( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xDest
)
358 throw ( ::com::sun::star::embed::InvalidStorageException
,
359 ::com::sun::star::lang::IllegalArgumentException
,
360 ::com::sun::star::io::IOException
,
361 ::com::sun::star::embed::StorageWrappedTargetException
,
362 ::com::sun::star::uno::RuntimeException
);
364 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> SAL_CALL
openStreamElement(
365 const OUString
& aStreamName
, sal_Int32 nOpenMode
)
366 throw ( ::com::sun::star::embed::InvalidStorageException
,
367 ::com::sun::star::lang::IllegalArgumentException
,
368 ::com::sun::star::packages::WrongPasswordException
,
369 ::com::sun::star::io::IOException
,
370 ::com::sun::star::embed::StorageWrappedTargetException
,
371 ::com::sun::star::uno::RuntimeException
);
373 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> SAL_CALL
openEncryptedStreamElement(
374 const OUString
& aStreamName
, sal_Int32 nOpenMode
, const OUString
& aPass
)
375 throw ( ::com::sun::star::embed::InvalidStorageException
,
376 ::com::sun::star::lang::IllegalArgumentException
,
377 ::com::sun::star::packages::NoEncryptionException
,
378 ::com::sun::star::packages::WrongPasswordException
,
379 ::com::sun::star::io::IOException
,
380 ::com::sun::star::embed::StorageWrappedTargetException
,
381 ::com::sun::star::uno::RuntimeException
);
383 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> SAL_CALL
openStorageElement(
384 const OUString
& aStorName
, sal_Int32 nStorageMode
)
385 throw ( ::com::sun::star::embed::InvalidStorageException
,
386 ::com::sun::star::lang::IllegalArgumentException
,
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
cloneStreamElement(
392 const OUString
& aStreamName
)
393 throw ( ::com::sun::star::embed::InvalidStorageException
,
394 ::com::sun::star::lang::IllegalArgumentException
,
395 ::com::sun::star::packages::WrongPasswordException
,
396 ::com::sun::star::io::IOException
,
397 ::com::sun::star::embed::StorageWrappedTargetException
,
398 ::com::sun::star::uno::RuntimeException
);
400 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> SAL_CALL
cloneEncryptedStreamElement(
401 const OUString
& aStreamName
, const OUString
& aPass
)
402 throw ( ::com::sun::star::embed::InvalidStorageException
,
403 ::com::sun::star::lang::IllegalArgumentException
,
404 ::com::sun::star::packages::NoEncryptionException
,
405 ::com::sun::star::packages::WrongPasswordException
,
406 ::com::sun::star::io::IOException
,
407 ::com::sun::star::embed::StorageWrappedTargetException
,
408 ::com::sun::star::uno::RuntimeException
);
410 virtual void SAL_CALL
copyLastCommitTo(
411 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xTargetStorage
)
412 throw ( ::com::sun::star::embed::InvalidStorageException
,
413 ::com::sun::star::lang::IllegalArgumentException
,
414 ::com::sun::star::io::IOException
,
415 ::com::sun::star::embed::StorageWrappedTargetException
,
416 ::com::sun::star::uno::RuntimeException
);
418 virtual void SAL_CALL
copyStorageElementLastCommitTo(
419 const OUString
& aStorName
,
420 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xTargetStorage
)
421 throw ( ::com::sun::star::embed::InvalidStorageException
,
422 ::com::sun::star::lang::IllegalArgumentException
,
423 ::com::sun::star::io::IOException
,
424 ::com::sun::star::embed::StorageWrappedTargetException
,
425 ::com::sun::star::uno::RuntimeException
);
427 virtual sal_Bool SAL_CALL
isStreamElement( const OUString
& aElementName
)
428 throw ( ::com::sun::star::container::NoSuchElementException
,
429 ::com::sun::star::lang::IllegalArgumentException
,
430 ::com::sun::star::embed::InvalidStorageException
,
431 ::com::sun::star::uno::RuntimeException
);
433 virtual sal_Bool SAL_CALL
isStorageElement( const OUString
& aElementName
)
434 throw ( ::com::sun::star::container::NoSuchElementException
,
435 ::com::sun::star::lang::IllegalArgumentException
,
436 ::com::sun::star::embed::InvalidStorageException
,
437 ::com::sun::star::uno::RuntimeException
);
439 virtual void SAL_CALL
removeElement( const OUString
& aElementName
)
440 throw ( ::com::sun::star::embed::InvalidStorageException
,
441 ::com::sun::star::lang::IllegalArgumentException
,
442 ::com::sun::star::container::NoSuchElementException
,
443 ::com::sun::star::io::IOException
,
444 ::com::sun::star::embed::StorageWrappedTargetException
,
445 ::com::sun::star::uno::RuntimeException
);
447 virtual void SAL_CALL
renameElement( const OUString
& rEleName
, const OUString
& rNewName
)
448 throw ( ::com::sun::star::embed::InvalidStorageException
,
449 ::com::sun::star::lang::IllegalArgumentException
,
450 ::com::sun::star::container::NoSuchElementException
,
451 ::com::sun::star::container::ElementExistException
,
452 ::com::sun::star::io::IOException
,
453 ::com::sun::star::embed::StorageWrappedTargetException
,
454 ::com::sun::star::uno::RuntimeException
);
456 virtual void SAL_CALL
copyElementTo( const OUString
& aElementName
,
457 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xDest
,
458 const OUString
& aNewName
)
459 throw ( ::com::sun::star::embed::InvalidStorageException
,
460 ::com::sun::star::lang::IllegalArgumentException
,
461 ::com::sun::star::container::NoSuchElementException
,
462 ::com::sun::star::container::ElementExistException
,
463 ::com::sun::star::io::IOException
,
464 ::com::sun::star::embed::StorageWrappedTargetException
,
465 ::com::sun::star::uno::RuntimeException
);
467 virtual void SAL_CALL
moveElementTo( const OUString
& aElementName
,
468 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xDest
,
469 const 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 //____________________________________________________________________________________________________
480 //____________________________________________________________________________________________________
482 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> SAL_CALL
openEncryptedStream( const OUString
& sStreamName
, ::sal_Int32 nOpenMode
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
>& aEncryptionData
)
483 throw ( ::com::sun::star::embed::InvalidStorageException
,
484 ::com::sun::star::lang::IllegalArgumentException
,
485 ::com::sun::star::packages::NoEncryptionException
,
486 ::com::sun::star::packages::WrongPasswordException
,
487 ::com::sun::star::io::IOException
,
488 ::com::sun::star::embed::StorageWrappedTargetException
,
489 ::com::sun::star::uno::RuntimeException
);
491 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
> SAL_CALL
cloneEncryptedStream( const OUString
& sStreamName
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
>& aEncryptionData
)
492 throw ( ::com::sun::star::embed::InvalidStorageException
,
493 ::com::sun::star::lang::IllegalArgumentException
,
494 ::com::sun::star::packages::NoEncryptionException
,
495 ::com::sun::star::packages::WrongPasswordException
,
496 ::com::sun::star::io::IOException
,
497 ::com::sun::star::embed::StorageWrappedTargetException
,
498 ::com::sun::star::uno::RuntimeException
);
500 //____________________________________________________________________________________________________
502 //____________________________________________________________________________________________________
504 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> SAL_CALL
getPlainRawStreamElement(
505 const 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 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 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 //____________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
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 //____________________________________________________________________________________________________
580 //____________________________________________________________________________________________________
582 virtual ::com::sun::star::uno::Any SAL_CALL
getByName( const 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
< OUString
> SAL_CALL
getElementNames()
588 throw ( ::com::sun::star::uno::RuntimeException
);
590 virtual sal_Bool SAL_CALL
hasByName( const 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 //____________________________________________________________________________________________________
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 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 // XEncryptionProtectedSource2
628 //____________________________________________________________________________________________________
630 virtual void SAL_CALL
setEncryptionData(
631 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
>& aEncryptionData
)
632 throw ( ::com::sun::star::io::IOException
,
633 ::com::sun::star::uno::RuntimeException
);
635 virtual sal_Bool SAL_CALL
hasEncryptionData()
636 throw ( ::com::sun::star::uno::RuntimeException
);
638 //____________________________________________________________________________________________________
639 // XEncryptionProtectedStorage
640 //____________________________________________________________________________________________________
642 virtual void SAL_CALL
setEncryptionAlgorithms( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
>& aAlgorithms
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
644 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
> SAL_CALL
getEncryptionAlgorithms() throw (::com::sun::star::uno::RuntimeException
);
646 //____________________________________________________________________________________________________
648 //____________________________________________________________________________________________________
650 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo()
651 throw ( ::com::sun::star::uno::RuntimeException
);
653 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
)
654 throw ( ::com::sun::star::beans::UnknownPropertyException
,
655 ::com::sun::star::beans::PropertyVetoException
,
656 ::com::sun::star::lang::IllegalArgumentException
,
657 ::com::sun::star::lang::WrappedTargetException
,
658 ::com::sun::star::uno::RuntimeException
);
660 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
)
661 throw ( ::com::sun::star::beans::UnknownPropertyException
,
662 ::com::sun::star::lang::WrappedTargetException
,
663 ::com::sun::star::uno::RuntimeException
);
665 virtual void SAL_CALL
addPropertyChangeListener(
666 const OUString
& aPropertyName
,
667 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
)
668 throw ( ::com::sun::star::beans::UnknownPropertyException
,
669 ::com::sun::star::lang::WrappedTargetException
,
670 ::com::sun::star::uno::RuntimeException
);
672 virtual void SAL_CALL
removePropertyChangeListener(
673 const OUString
& aPropertyName
,
674 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
)
675 throw ( ::com::sun::star::beans::UnknownPropertyException
,
676 ::com::sun::star::lang::WrappedTargetException
,
677 ::com::sun::star::uno::RuntimeException
);
679 virtual void SAL_CALL
addVetoableChangeListener(
680 const OUString
& PropertyName
,
681 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
)
682 throw ( ::com::sun::star::beans::UnknownPropertyException
,
683 ::com::sun::star::lang::WrappedTargetException
,
684 ::com::sun::star::uno::RuntimeException
);
686 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
)
687 throw ( ::com::sun::star::beans::UnknownPropertyException
,
688 ::com::sun::star::lang::WrappedTargetException
,
689 ::com::sun::star::uno::RuntimeException
);
691 //____________________________________________________________________________________________________
693 //____________________________________________________________________________________________________
694 virtual void SAL_CALL
insertRawNonEncrStreamElementDirect( const OUString
& sStreamName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& xInStream
)
695 throw ( ::com::sun::star::embed::InvalidStorageException
,
696 ::com::sun::star::lang::IllegalArgumentException
,
697 ::com::sun::star::packages::NoRawFormatException
,
698 ::com::sun::star::container::ElementExistException
,
699 ::com::sun::star::io::IOException
,
700 ::com::sun::star::embed::StorageWrappedTargetException
,
701 ::com::sun::star::uno::RuntimeException
);
703 virtual void SAL_CALL
insertStreamElementDirect( const 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
)
704 throw ( ::com::sun::star::embed::InvalidStorageException
,
705 ::com::sun::star::lang::IllegalArgumentException
,
706 ::com::sun::star::container::ElementExistException
,
707 ::com::sun::star::io::IOException
,
708 ::com::sun::star::embed::StorageWrappedTargetException
,
709 ::com::sun::star::uno::RuntimeException
);
711 virtual void SAL_CALL
copyElementDirectlyTo( const OUString
& sSourceName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XOptimizedStorage
>& xTargetStorage
, const OUString
& sTargetName
)
712 throw ( ::com::sun::star::embed::InvalidStorageException
,
713 ::com::sun::star::lang::IllegalArgumentException
,
714 ::com::sun::star::container::NoSuchElementException
,
715 ::com::sun::star::container::ElementExistException
,
716 ::com::sun::star::io::IOException
,
717 ::com::sun::star::embed::StorageWrappedTargetException
,
718 ::com::sun::star::uno::RuntimeException
);
720 virtual void SAL_CALL
writeAndAttachToStream( const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
>& xStream
)
721 throw ( ::com::sun::star::embed::InvalidStorageException
,
722 ::com::sun::star::lang::IllegalArgumentException
,
723 ::com::sun::star::io::IOException
,
724 ::com::sun::star::embed::StorageWrappedTargetException
,
725 ::com::sun::star::uno::RuntimeException
);
727 virtual void SAL_CALL
attachToURL( const OUString
& sURL
, sal_Bool bReadOnly
)
728 throw ( ::com::sun::star::embed::InvalidStorageException
,
729 ::com::sun::star::lang::IllegalArgumentException
,
730 ::com::sun::star::io::IOException
,
731 ::com::sun::star::embed::StorageWrappedTargetException
,
732 ::com::sun::star::uno::RuntimeException
);
734 virtual ::com::sun::star::uno::Any SAL_CALL
getElementPropertyValue( const OUString
& sElementName
, const OUString
& sPropertyName
)
735 throw ( ::com::sun::star::embed::InvalidStorageException
,
736 ::com::sun::star::lang::IllegalArgumentException
,
737 ::com::sun::star::container::NoSuchElementException
,
738 ::com::sun::star::io::IOException
,
739 ::com::sun::star::beans::UnknownPropertyException
,
740 ::com::sun::star::beans::PropertyVetoException
,
741 ::com::sun::star::embed::StorageWrappedTargetException
,
742 ::com::sun::star::uno::RuntimeException
);
744 virtual void SAL_CALL
copyStreamElementData( const OUString
& sStreamName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XStream
>& xTargetStream
)
745 throw ( ::com::sun::star::embed::InvalidStorageException
,
746 ::com::sun::star::lang::IllegalArgumentException
,
747 ::com::sun::star::packages::WrongPasswordException
,
748 ::com::sun::star::io::IOException
,
749 ::com::sun::star::embed::StorageWrappedTargetException
,
750 ::com::sun::star::uno::RuntimeException
);
752 //____________________________________________________________________________________________________
753 // XRelationshipAccess
754 //____________________________________________________________________________________________________
756 virtual ::sal_Bool SAL_CALL
hasByID( const OUString
& sID
)
757 throw ( ::com::sun::star::io::IOException
,
758 ::com::sun::star::uno::RuntimeException
);
760 virtual OUString SAL_CALL
getTargetByID( const OUString
& sID
)
761 throw ( ::com::sun::star::container::NoSuchElementException
,
762 ::com::sun::star::io::IOException
,
763 ::com::sun::star::uno::RuntimeException
);
765 virtual OUString SAL_CALL
getTypeByID( const OUString
& sID
)
766 throw ( ::com::sun::star::container::NoSuchElementException
,
767 ::com::sun::star::io::IOException
,
768 ::com::sun::star::uno::RuntimeException
);
770 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> SAL_CALL
getRelationshipByID( const OUString
& sID
)
771 throw ( ::com::sun::star::container::NoSuchElementException
,
772 ::com::sun::star::io::IOException
,
773 ::com::sun::star::uno::RuntimeException
);
775 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> > SAL_CALL
getRelationshipsByType( const OUString
& sType
)
776 throw ( ::com::sun::star::io::IOException
,
777 ::com::sun::star::uno::RuntimeException
);
779 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
> > SAL_CALL
getAllRelationships( )
780 throw ( ::com::sun::star::io::IOException
,
781 ::com::sun::star::uno::RuntimeException
);
783 virtual void SAL_CALL
insertRelationshipByID( const OUString
& sID
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::StringPair
>& aEntry
, ::sal_Bool bReplace
)
784 throw ( ::com::sun::star::container::ElementExistException
,
785 ::com::sun::star::io::IOException
,
786 ::com::sun::star::uno::RuntimeException
);
788 virtual void SAL_CALL
removeRelationshipByID( const OUString
& sID
)
789 throw ( ::com::sun::star::container::NoSuchElementException
,
790 ::com::sun::star::io::IOException
,
791 ::com::sun::star::uno::RuntimeException
);
793 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
)
794 throw ( ::com::sun::star::container::ElementExistException
,
795 ::com::sun::star::io::IOException
,
796 ::com::sun::star::uno::RuntimeException
);
798 virtual void SAL_CALL
clearRelationships( )
799 throw ( ::com::sun::star::io::IOException
,
800 ::com::sun::star::uno::RuntimeException
);
802 //____________________________________________________________________________________________________
803 // XHierarchicalStorageAccess
804 //____________________________________________________________________________________________________
806 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XExtendedStorageStream
> SAL_CALL
openStreamElementByHierarchicalName( const OUString
& sStreamPath
, ::sal_Int32 nOpenMode
)
807 throw ( ::com::sun::star::embed::InvalidStorageException
,
808 ::com::sun::star::lang::IllegalArgumentException
,
809 ::com::sun::star::packages::WrongPasswordException
,
810 ::com::sun::star::io::IOException
,
811 ::com::sun::star::embed::StorageWrappedTargetException
,
812 ::com::sun::star::uno::RuntimeException
);
814 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XExtendedStorageStream
> SAL_CALL
openEncryptedStreamElementByHierarchicalName( const OUString
& sStreamName
, ::sal_Int32 nOpenMode
, const OUString
& sPassword
)
815 throw ( ::com::sun::star::embed::InvalidStorageException
,
816 ::com::sun::star::lang::IllegalArgumentException
,
817 ::com::sun::star::packages::NoEncryptionException
,
818 ::com::sun::star::packages::WrongPasswordException
,
819 ::com::sun::star::io::IOException
,
820 ::com::sun::star::embed::StorageWrappedTargetException
,
821 ::com::sun::star::uno::RuntimeException
);
823 virtual void SAL_CALL
removeStreamElementByHierarchicalName( const OUString
& sElementPath
)
824 throw ( ::com::sun::star::embed::InvalidStorageException
,
825 ::com::sun::star::lang::IllegalArgumentException
,
826 ::com::sun::star::container::NoSuchElementException
,
827 ::com::sun::star::io::IOException
,
828 ::com::sun::star::embed::StorageWrappedTargetException
,
829 ::com::sun::star::uno::RuntimeException
);
831 //____________________________________________________________________________________________________
832 // XHierarchicalStorageAccess2
833 //____________________________________________________________________________________________________
835 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XExtendedStorageStream
> SAL_CALL
openEncryptedStreamByHierarchicalName( const OUString
& sStreamName
, ::sal_Int32 nOpenMode
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
>& aEncryptionData
)
836 throw ( ::com::sun::star::embed::InvalidStorageException
,
837 ::com::sun::star::lang::IllegalArgumentException
,
838 ::com::sun::star::packages::NoEncryptionException
,
839 ::com::sun::star::packages::WrongPasswordException
,
840 ::com::sun::star::io::IOException
,
841 ::com::sun::star::embed::StorageWrappedTargetException
,
842 ::com::sun::star::uno::RuntimeException
);
848 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */