xref: /trunk/main/package/source/xstor/xstorage.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef __XSTORAGE_HXX_
25 #define __XSTORAGE_HXX_
26 
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <com/sun/star/embed/XStorage2.hpp>
29 #include <com/sun/star/embed/XOptimizedStorage.hpp>
30 #include <com/sun/star/embed/XHierarchicalStorageAccess2.hpp>
31 #include <com/sun/star/embed/XStorageRawAccess.hpp>
32 #include <com/sun/star/embed/XTransactedObject.hpp>
33 #include <com/sun/star/embed/XTransactionBroadcaster.hpp>
34 #include <com/sun/star/embed/XClassifiedObject.hpp>
35 #include <com/sun/star/embed/XEncryptionProtectedStorage.hpp>
36 #include <com/sun/star/embed/XRelationshipAccess.hpp>
37 #include <com/sun/star/util/XModifiable.hpp>
38 #include <com/sun/star/container/XNameAccess.hpp>
39 #include <com/sun/star/container/XNameContainer.hpp>
40 #include <com/sun/star/util/XCloseable.hpp>
41 #include <com/sun/star/beans/XPropertySet.hpp>
42 #include <com/sun/star/beans/PropertyValue.hpp>
43 #include <com/sun/star/beans/StringPair.hpp>
44 #include <com/sun/star/io/XStream.hpp>
45 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
46 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
47 #include <com/sun/star/lang/XTypeProvider.hpp>
48 #include <com/sun/star/lang/XComponent.hpp>
49 #include <com/sun/star/packages/NoEncryptionException.hpp>
50 #include <com/sun/star/logging/XSimpleLogRing.hpp>
51 
52 #include <cppuhelper/weak.hxx>
53 #include <cppuhelper/interfacecontainer.h>
54 #include <comphelper/sequenceashashmap.hxx>
55 
56 #include "mutexholder.hxx"
57 
58 #define RELINFO_NO_INIT             1
59 #define RELINFO_READ                2
60 #define RELINFO_CHANGED             3
61 #define RELINFO_CHANGED_STREAM      4
62 #define RELINFO_CHANGED_STREAM_READ 5
63 #define RELINFO_BROKEN              6
64 #define RELINFO_CHANGED_BROKEN      7
65 
66 #define STOR_MESS_PRECOMMIT 1
67 #define STOR_MESS_COMMITED  2
68 #define STOR_MESS_PREREVERT 3
69 #define STOR_MESS_REVERTED  4
70 
71 namespace cppu
72 {
73     class OTypeCollection;
74 }
75 
76 //================================================
77 // a common implementation for an entry
78 
79 struct StorInternalData_Impl;
80 struct OStorage_Impl;
81 struct OWriteStream_Impl;
82 
83 struct SotElement_Impl
84 {
85     ::rtl::OUString             m_aName;
86     ::rtl::OUString             m_aOriginalName;
87     sal_Bool                    m_bIsRemoved;
88     sal_Bool                    m_bIsInserted;
89     sal_Bool                    m_bIsStorage;
90 
91     OStorage_Impl*              m_pStorage;
92     OWriteStream_Impl*          m_pStream;
93 
94 public:
95                                 SotElement_Impl( const ::rtl::OUString& rName, sal_Bool bStor, sal_Bool bNew );
96                                 ~SotElement_Impl();
97 };
98 
99 #include <list>
100 typedef ::std::list< SotElement_Impl* > SotElementList_Impl;
101 
102 //=========================================================================
103 // Main storage implementation
104 
105 class OStorage;
106 
107 struct StorageHolder_Impl
108 {
109     OStorage* m_pPointer;
110     ::com::sun::star::uno::WeakReference< ::com::sun::star::embed::XStorage > m_xWeakRef;
111 
StorageHolder_ImplStorageHolder_Impl112     StorageHolder_Impl( OStorage* pStorage )
113     : m_pPointer( pStorage )
114     , m_xWeakRef( ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >(
115                                                 (::com::sun::star::embed::XStorage*)pStorage ) )
116     {
117     }
118 
StorageHolder_ImplStorageHolder_Impl119     StorageHolder_Impl( const StorageHolder_Impl& aSH )
120     : m_pPointer( aSH.m_pPointer )
121     , m_xWeakRef( aSH.m_xWeakRef )
122     {
123     }
124 };
125 
126 typedef ::std::list< StorageHolder_Impl > OStorageList_Impl;
127 
128 class SwitchablePersistenceStream;
129 struct OStorage_Impl
130 {
131     SotMutexHolderRef           m_rMutexRef;
132 
133     OStorage*                   m_pAntiImpl;         // only valid if external references exists
134     OStorageList_Impl           m_aReadOnlyWrapList; // only valid if readonly external reference exists
135 
136     sal_Int32                   m_nStorageMode; // open mode ( read/write/trunc/nocreate )
137     sal_Bool                    m_bIsModified;  // only modified elements will be sent to the original content
138     sal_Bool                    m_bBroadcastModified;  // will be set if notification is required
139     sal_Bool                    m_bCommited;    // sending the streams is coordinated by the root storage of the package
140 
141     sal_Bool                    m_bIsRoot;      // marks this storage as root storages that manages all commits and reverts
142     sal_Bool                    m_bListCreated;
143 
144 
145     SotElementList_Impl                         m_aChildrenList;
146     SotElementList_Impl                         m_aDeletedList;
147 
148     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xPackageFolder;
149     ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing >  m_xLogRing;
150 
151     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > m_xPackage;
152     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >  m_xFactory;
153 
154     // valid only for root storage
155     ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; // ??? may be stored in properties
156     ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; // ??? may be stored in properties
157     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_xProperties;
158     sal_Bool m_bHasCommonEncryptionData;
159     ::comphelper::SequenceAsHashMap m_aCommonEncryptionData;
160 
161     // must be empty in case of root storage
162     OStorage_Impl* m_pParent;
163 
164     sal_Bool        m_bControlMediaType;
165     ::rtl::OUString m_aMediaType;
166     sal_Bool        m_bMTFallbackUsed;
167 
168     sal_Bool        m_bControlVersion;
169     ::rtl::OUString m_aVersion;
170 
171     SwitchablePersistenceStream* m_pSwitchStream;
172 
173     sal_Int32 m_nStorageType; // the mode in which the storage is used
174 
175     // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML
176     SotElement_Impl* m_pRelStorElement;
177     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage;
178     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo;
179     ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream;
180     sal_Int16 m_nRelInfoStatus;
181 
182     //////////////////////////////////////////
183     // Constructors
184 
185     OStorage_Impl(  ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
186                     sal_Int32 nMode,
187                     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
188                     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
189                     sal_Int32 nStorageType );
190 
191     OStorage_Impl(  ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
192                     sal_Int32 nMode,
193                     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
194                     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
195                     sal_Int32 nStorageType );
196 
197     // constructor for a substorage
198     OStorage_Impl(  OStorage_Impl* pParent,
199                     sal_Int32 nMode,
200                     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder,
201                     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage,
202                     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
203                     sal_Int32 nStorageType );
204 
205     ~OStorage_Impl();
206 
207     void AddLog( const ::rtl::OUString& aMessage );
208 
209     void SetReadOnlyWrap( OStorage& aStorage );
210     void RemoveReadOnlyWrap( OStorage& aStorage );
211 
212     void OpenOwnPackage();
213     void ReadContents();
214     void ReadRelInfoIfNecessary();
215 
216     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory();
217     SotElementList_Impl& GetChildrenList();
218     void GetStorageProperties();
219 
220     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
221     void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor );
222     void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor,
223                             const ::rtl::OUString& aPass );
224 
225     void InsertIntoPackageFolder(
226             const ::rtl::OUString& aName,
227             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xParentPackageFolder );
228 
229     void Commit();
230     void Revert();
231 
232     ::comphelper::SequenceAsHashMap GetCommonRootEncryptionData();
233 
234     void CopyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
235                         sal_Bool bDirect );
236     void CopyStorageElement( SotElement_Impl* pElement,
237                             ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xDest,
238                             ::rtl::OUString aName,
239                             sal_Bool bDirect );
240 
241     void SetModified( sal_Bool bModified );
242 
243     SotElement_Impl* FindElement( const ::rtl::OUString& rName );
244 
245 
246     SotElement_Impl* InsertStream( ::rtl::OUString aName, sal_Bool bEncr );
247     SotElement_Impl* InsertRawStream( ::rtl::OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
248 
249     OStorage_Impl* CreateNewStorageImpl( sal_Int32 nStorageMode );
250     SotElement_Impl* InsertStorage( ::rtl::OUString aName, sal_Int32 nStorageMode );
251     SotElement_Impl* InsertElement( ::rtl::OUString aName, sal_Bool bIsStorage );
252 
253     void OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorageMode );
254     void OpenSubStream( SotElement_Impl* pElement );
255 
256     ::com::sun::star::uno::Sequence< ::rtl::OUString > GetElementNames();
257 
258     void RemoveElement( SotElement_Impl* pElement );
259     void ClearElement( SotElement_Impl* pElement );
260     void DisposeChildren();
261 
262     void CloneStreamElement(
263                     const ::rtl::OUString& aStreamName,
264                     sal_Bool bPassProvided,
265                     const ::comphelper::SequenceAsHashMap& aEncryptionData,
266                     ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream );
267 
268     void RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName );
269     void CreateRelStorage();
270     void CommitStreamRelInfo( SotElement_Impl* pStreamElement );
271     ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetRelInfoStreamForName( const ::rtl::OUString& aName );
272     void CommitRelInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xNewPackageFolder );
273 
274     static void completeStorageStreamCopy_Impl(
275         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSource,
276         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDest,
277         sal_Int32 nStorageType,
278         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aRelInfo );
279 
280 };
281 
282 
283 class OStorage  : public ::com::sun::star::lang::XTypeProvider
284                 , public ::com::sun::star::embed::XStorage2
285                 , public ::com::sun::star::embed::XStorageRawAccess
286                 , public ::com::sun::star::embed::XTransactedObject
287                 , public ::com::sun::star::embed::XTransactionBroadcaster
288                 , public ::com::sun::star::util::XModifiable
289                 // , public ::com::sun::star::container::XNameAccess
290                 // , public ::com::sun::star::lang::XComponent
291                 , public ::com::sun::star::embed::XEncryptionProtectedStorage
292                 , public ::com::sun::star::beans::XPropertySet
293                 , public ::com::sun::star::embed::XOptimizedStorage
294                 , public ::com::sun::star::embed::XRelationshipAccess
295                 , public ::com::sun::star::embed::XHierarchicalStorageAccess2
296                 , public ::cppu::OWeakObject
297 {
298     OStorage_Impl*  m_pImpl;
299     StorInternalData_Impl* m_pData;
300 
301 protected:
302 
303     void Commit_Impl();
304 
305     SotElement_Impl* OpenStreamElement_Impl( const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, sal_Bool bEncr );
306 
307     void BroadcastModifiedIfNecessary();
308 
309     void BroadcastTransaction( sal_Int8 nMessage );
310 
311     void MakeLinkToSubComponent_Impl(
312                     const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComponent );
313 
314 public:
315 
316     OStorage(   ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
317                 sal_Int32 nMode,
318                 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
319                 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
320                 sal_Int32 nStorageType );
321 
322     OStorage(   ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
323                 sal_Int32 nMode,
324                 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
325                 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
326                 sal_Int32 nStorageType );
327 
328     OStorage(   OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap );
329 
330     virtual ~OStorage();
331 
332     void SAL_CALL InternalDispose( sal_Bool bNotifyImpl );
333 
334     void ChildIsDisposed( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xChild );
335 
GetRefCount_Impl()336     sal_Int32 GetRefCount_Impl() { return m_refCount; }
337 
338     //____________________________________________________________________________________________________
339     //  XInterface
340     //____________________________________________________________________________________________________
341 
342     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType );
343 
344     virtual void SAL_CALL acquire() throw();
345 
346     virtual void SAL_CALL release() throw();
347 
348     //____________________________________________________________________________________________________
349     //  XTypeProvider
350     //____________________________________________________________________________________________________
351 
352     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes();
353 
354     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId();
355 
356     //____________________________________________________________________________________________________
357     //  XStorage
358     //____________________________________________________________________________________________________
359 
360     virtual void SAL_CALL copyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest );
361 
362     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openStreamElement(
363             const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode );
364 
365     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStreamElement(
366             const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, const ::rtl::OUString& aPass );
367 
368     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL openStorageElement(
369             const ::rtl::OUString& aStorName, sal_Int32 nStorageMode );
370 
371     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneStreamElement(
372             const ::rtl::OUString& aStreamName );
373 
374     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStreamElement(
375             const ::rtl::OUString& aStreamName, const ::rtl::OUString& aPass );
376 
377     virtual void SAL_CALL copyLastCommitTo(
378             const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage );
379 
380     virtual void SAL_CALL copyStorageElementLastCommitTo(
381             const ::rtl::OUString& aStorName,
382             const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage );
383 
384     virtual sal_Bool SAL_CALL isStreamElement( const ::rtl::OUString& aElementName );
385 
386     virtual sal_Bool SAL_CALL isStorageElement( const ::rtl::OUString& aElementName );
387 
388     virtual void SAL_CALL removeElement( const ::rtl::OUString& aElementName );
389 
390     virtual void SAL_CALL renameElement( const ::rtl::OUString& rEleName, const ::rtl::OUString& rNewName );
391 
392     virtual void SAL_CALL copyElementTo(    const ::rtl::OUString& aElementName,
393                                         const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
394                                         const ::rtl::OUString& aNewName );
395 
396     virtual void SAL_CALL moveElementTo(    const ::rtl::OUString& aElementName,
397                                         const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
398                                         const ::rtl::OUString& rNewName );
399 
400     //____________________________________________________________________________________________________
401     //  XStorage2
402     //____________________________________________________________________________________________________
403 
404     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStream( const ::rtl::OUString& sStreamName, ::sal_Int32 nOpenMode, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData );
405 
406     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStream( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData );
407 
408     //____________________________________________________________________________________________________
409     //  XStorageRawAccess
410     //____________________________________________________________________________________________________
411 
412     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getPlainRawStreamElement(
413             const ::rtl::OUString& sStreamName );
414 
415     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawEncrStreamElement(
416             const ::rtl::OUString& sStreamName );
417 
418     virtual void SAL_CALL insertRawEncrStreamElement( const ::rtl::OUString& aStreamName,
419                                 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
420 
421     //____________________________________________________________________________________________________
422     // XTransactedObject
423     //____________________________________________________________________________________________________
424 
425     virtual void SAL_CALL commit();
426 
427     virtual void SAL_CALL revert();
428 
429     //____________________________________________________________________________________________________
430     // XTransactionBroadcaster
431     //____________________________________________________________________________________________________
432 
433     virtual void SAL_CALL addTransactionListener(
434             const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener );
435 
436     virtual void SAL_CALL removeTransactionListener(
437             const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener );
438 
439     //____________________________________________________________________________________________________
440     //  XModifiable
441     //____________________________________________________________________________________________________
442 
443     virtual sal_Bool SAL_CALL isModified();
444 
445     virtual void SAL_CALL setModified( sal_Bool bModified );
446 
447     virtual void SAL_CALL addModifyListener(
448             const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener );
449 
450     virtual void SAL_CALL removeModifyListener(
451             const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener );
452 
453     //____________________________________________________________________________________________________
454     //  XNameAccess
455     //____________________________________________________________________________________________________
456 
457     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName );
458 
459     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames();
460 
461     virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName );
462 
463     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
464 
465     virtual sal_Bool SAL_CALL hasElements();
466 
467     //____________________________________________________________________________________________________
468     //  XComponent
469     //____________________________________________________________________________________________________
470 
471     virtual void SAL_CALL dispose();
472 
473     virtual void SAL_CALL addEventListener(
474             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener );
475 
476     virtual void SAL_CALL removeEventListener(
477             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener );
478 
479     //____________________________________________________________________________________________________
480     //  XEncryptionProtectedSource
481     //____________________________________________________________________________________________________
482 
483     virtual void SAL_CALL setEncryptionPassword( const ::rtl::OUString& aPass );
484 
485     virtual void SAL_CALL removeEncryption();
486 
487     //____________________________________________________________________________________________________
488     //  XEncryptionProtectedSource2
489     //____________________________________________________________________________________________________
490 
491     virtual void SAL_CALL setEncryptionData(
492             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData );
493 
494     //____________________________________________________________________________________________________
495     //  XEncryptionProtectedStorage
496     //____________________________________________________________________________________________________
497 
498     virtual void SAL_CALL setEncryptionAlgorithms( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aAlgorithms );
499 
500     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getEncryptionAlgorithms();
501 
502     //____________________________________________________________________________________________________
503     //  XPropertySet
504     //____________________________________________________________________________________________________
505 
506     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo();
507 
508     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue );
509 
510     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName );
511 
512     virtual void SAL_CALL addPropertyChangeListener(
513             const ::rtl::OUString& aPropertyName,
514             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener );
515 
516     virtual void SAL_CALL removePropertyChangeListener(
517             const ::rtl::OUString& aPropertyName,
518             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener );
519 
520     virtual void SAL_CALL addVetoableChangeListener(
521             const ::rtl::OUString& PropertyName,
522             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener );
523 
524     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener );
525 
526     //____________________________________________________________________________________________________
527     //  XOptimizedStorage
528     //____________________________________________________________________________________________________
529     virtual void SAL_CALL insertRawNonEncrStreamElementDirect( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
530 
531     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 );
532 
533     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 );
534 
535     virtual void SAL_CALL writeAndAttachToStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream );
536 
537     virtual void SAL_CALL attachToURL( const ::rtl::OUString& sURL, sal_Bool bReadOnly );
538 
539     virtual ::com::sun::star::uno::Any SAL_CALL getElementPropertyValue( const ::rtl::OUString& sElementName, const ::rtl::OUString& sPropertyName );
540 
541     virtual void SAL_CALL copyStreamElementData( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream );
542 
543     //____________________________________________________________________________________________________
544     // XRelationshipAccess
545     //____________________________________________________________________________________________________
546 
547     virtual ::sal_Bool SAL_CALL hasByID( const ::rtl::OUString& sID );
548 
549     virtual ::rtl::OUString SAL_CALL getTargetByID( const ::rtl::OUString& sID );
550 
551     virtual ::rtl::OUString SAL_CALL getTypeByID( const ::rtl::OUString& sID );
552 
553     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > SAL_CALL getRelationshipByID( const ::rtl::OUString& sID );
554 
555     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getRelationshipsByType( const ::rtl::OUString& sType );
556 
557     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getAllRelationships(  );
558 
559     virtual void SAL_CALL insertRelationshipByID( const ::rtl::OUString& sID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aEntry, ::sal_Bool bReplace );
560 
561     virtual void SAL_CALL removeRelationshipByID( const ::rtl::OUString& sID );
562 
563     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 );
564 
565     virtual void SAL_CALL clearRelationships(  );
566 
567     //____________________________________________________________________________________________________
568     // XHierarchicalStorageAccess
569     //____________________________________________________________________________________________________
570 
571     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode );
572 
573     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 );
574 
575     virtual void SAL_CALL removeStreamElementByHierarchicalName( const ::rtl::OUString& sElementPath );
576 
577     //____________________________________________________________________________________________________
578     // XHierarchicalStorageAccess2
579     //____________________________________________________________________________________________________
580 
581     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openEncryptedStreamByHierarchicalName( const ::rtl::OUString& sStreamName, ::sal_Int32 nOpenMode, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData );
582 };
583 
584 
585 #endif
586