Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef __XSTORAGE_HXX_
21 : #define __XSTORAGE_HXX_
22 :
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/XMultiServiceFactory.hpp>
43 : #include <com/sun/star/lang/XTypeProvider.hpp>
44 : #include <com/sun/star/lang/XComponent.hpp>
45 : #include <com/sun/star/packages/NoEncryptionException.hpp>
46 : #include <com/sun/star/logging/XSimpleLogRing.hpp>
47 :
48 : #include <cppuhelper/weak.hxx>
49 : #include <cppuhelper/interfacecontainer.h>
50 : #include <comphelper/sequenceashashmap.hxx>
51 :
52 : #include "mutexholder.hxx"
53 :
54 : #define RELINFO_NO_INIT 1
55 : #define RELINFO_READ 2
56 : #define RELINFO_CHANGED 3
57 : #define RELINFO_CHANGED_STREAM 4
58 : #define RELINFO_CHANGED_STREAM_READ 5
59 : #define RELINFO_BROKEN 6
60 : #define RELINFO_CHANGED_BROKEN 7
61 :
62 : #define STOR_MESS_PRECOMMIT 1
63 : #define STOR_MESS_COMMITED 2
64 : #define STOR_MESS_PREREVERT 3
65 : #define STOR_MESS_REVERTED 4
66 :
67 : //================================================
68 : // a common implementation for an entry
69 :
70 : struct StorInternalData_Impl;
71 : struct OStorage_Impl;
72 : struct OWriteStream_Impl;
73 :
74 : struct SotElement_Impl
75 : {
76 : ::rtl::OUString m_aName;
77 : ::rtl::OUString m_aOriginalName;
78 : sal_Bool m_bIsRemoved;
79 : sal_Bool m_bIsInserted;
80 : sal_Bool m_bIsStorage;
81 :
82 : OStorage_Impl* m_pStorage;
83 : OWriteStream_Impl* m_pStream;
84 :
85 : public:
86 : SotElement_Impl( const ::rtl::OUString& rName, sal_Bool bStor, sal_Bool bNew );
87 : ~SotElement_Impl();
88 : };
89 :
90 : #include <list>
91 : typedef ::std::list< SotElement_Impl* > SotElementList_Impl;
92 :
93 : //=========================================================================
94 : // Main storage implementation
95 :
96 : class OStorage;
97 :
98 1062 : struct StorageHolder_Impl
99 : {
100 : OStorage* m_pPointer;
101 : ::com::sun::star::uno::WeakReference< ::com::sun::star::embed::XStorage > m_xWeakRef;
102 :
103 531 : StorageHolder_Impl( OStorage* pStorage )
104 : : m_pPointer( pStorage )
105 : , m_xWeakRef( ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >(
106 531 : (::com::sun::star::embed::XStorage*)pStorage ) )
107 : {
108 531 : }
109 :
110 531 : StorageHolder_Impl( const StorageHolder_Impl& aSH )
111 : : m_pPointer( aSH.m_pPointer )
112 531 : , m_xWeakRef( aSH.m_xWeakRef )
113 : {
114 531 : }
115 : };
116 :
117 : typedef ::std::list< StorageHolder_Impl > OStorageList_Impl;
118 :
119 : class SwitchablePersistenceStream;
120 : struct OStorage_Impl
121 : {
122 : SotMutexHolderRef m_rMutexRef;
123 :
124 : OStorage* m_pAntiImpl; // only valid if external references exists
125 : OStorageList_Impl m_aReadOnlyWrapList; // only valid if readonly external reference exists
126 :
127 : sal_Int32 m_nStorageMode; // open mode ( read/write/trunc/nocreate )
128 : sal_Bool m_bIsModified; // only modified elements will be sent to the original content
129 : sal_Bool m_bBroadcastModified; // will be set if notification is required
130 : sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package
131 :
132 : sal_Bool m_bIsRoot; // marks this storage as root storages that manages all commits and reverts
133 : sal_Bool m_bListCreated;
134 :
135 :
136 : SotElementList_Impl m_aChildrenList;
137 : SotElementList_Impl m_aDeletedList;
138 :
139 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xPackageFolder;
140 : ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing > m_xLogRing;
141 :
142 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > m_xPackage;
143 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
144 :
145 : // valid only for root storage
146 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; // ??? may be stored in properties
147 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; // ??? may be stored in properties
148 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_xProperties;
149 : sal_Bool m_bHasCommonEncryptionData;
150 : ::comphelper::SequenceAsHashMap m_aCommonEncryptionData;
151 :
152 : // must be empty in case of root storage
153 : OStorage_Impl* m_pParent;
154 :
155 : sal_Bool m_bControlMediaType;
156 : ::rtl::OUString m_aMediaType;
157 : sal_Bool m_bMTFallbackUsed;
158 :
159 : sal_Bool m_bControlVersion;
160 : ::rtl::OUString m_aVersion;
161 :
162 : SwitchablePersistenceStream* m_pSwitchStream;
163 :
164 : sal_Int32 m_nStorageType; // the mode in wich the storage is used
165 :
166 : // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML
167 : SotElement_Impl* m_pRelStorElement;
168 : ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage;
169 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo;
170 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xNewRelInfoStream;
171 : sal_Int16 m_nRelInfoStatus;
172 :
173 : //////////////////////////////////////////
174 : // Constructors
175 :
176 : OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
177 : sal_Int32 nMode,
178 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
179 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
180 : sal_Int32 nStorageType );
181 :
182 : OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
183 : sal_Int32 nMode,
184 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
185 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
186 : sal_Int32 nStorageType );
187 :
188 : // constructor for a substorage
189 : OStorage_Impl( OStorage_Impl* pParent,
190 : sal_Int32 nMode,
191 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder,
192 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage,
193 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
194 : sal_Int32 nStorageType );
195 :
196 : ~OStorage_Impl();
197 :
198 : void AddLog( const ::rtl::OUString& aMessage );
199 :
200 : void SetReadOnlyWrap( OStorage& aStorage );
201 : void RemoveReadOnlyWrap( OStorage& aStorage );
202 :
203 : void OpenOwnPackage();
204 : void ReadContents();
205 : void ReadRelInfoIfNecessary();
206 :
207 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceFactory();
208 : SotElementList_Impl& GetChildrenList();
209 : void GetStorageProperties();
210 :
211 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetAllRelationshipsIfAny();
212 : void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor );
213 : void CopyLastCommitTo( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewStor,
214 : const ::rtl::OUString& aPass );
215 :
216 : void InsertIntoPackageFolder(
217 : const ::rtl::OUString& aName,
218 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xParentPackageFolder );
219 :
220 : void Commit();
221 : void Revert();
222 :
223 : ::comphelper::SequenceAsHashMap GetCommonRootEncryptionData() throw ( ::com::sun::star::packages::NoEncryptionException );
224 :
225 : void CopyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
226 : sal_Bool bDirect );
227 : void CopyStorageElement( SotElement_Impl* pElement,
228 : ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xDest,
229 : ::rtl::OUString aName,
230 : sal_Bool bDirect );
231 :
232 : void SetModified( sal_Bool bModified );
233 :
234 : SotElement_Impl* FindElement( const ::rtl::OUString& rName );
235 :
236 :
237 : SotElement_Impl* InsertStream( ::rtl::OUString aName, sal_Bool bEncr );
238 : SotElement_Impl* InsertRawStream( ::rtl::OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream );
239 :
240 : OStorage_Impl* CreateNewStorageImpl( sal_Int32 nStorageMode );
241 : SotElement_Impl* InsertStorage( ::rtl::OUString aName, sal_Int32 nStorageMode );
242 : SotElement_Impl* InsertElement( ::rtl::OUString aName, sal_Bool bIsStorage );
243 :
244 : void OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorageMode );
245 : void OpenSubStream( SotElement_Impl* pElement );
246 :
247 : ::com::sun::star::uno::Sequence< ::rtl::OUString > GetElementNames();
248 :
249 : void RemoveElement( SotElement_Impl* pElement );
250 : void ClearElement( SotElement_Impl* pElement );
251 : void DisposeChildren();
252 :
253 : void CloneStreamElement(
254 : const ::rtl::OUString& aStreamName,
255 : sal_Bool bPassProvided,
256 : const ::comphelper::SequenceAsHashMap& aEncryptionData,
257 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
258 : throw ( ::com::sun::star::embed::InvalidStorageException,
259 : ::com::sun::star::lang::IllegalArgumentException,
260 : ::com::sun::star::packages::WrongPasswordException,
261 : ::com::sun::star::io::IOException,
262 : ::com::sun::star::embed::StorageWrappedTargetException,
263 : ::com::sun::star::uno::RuntimeException );
264 :
265 : void RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName );
266 : void CreateRelStorage();
267 : void CommitStreamRelInfo( SotElement_Impl* pStreamElement );
268 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetRelInfoStreamForName( const ::rtl::OUString& aName );
269 : void CommitRelInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xNewPackageFolder );
270 :
271 : static void completeStorageStreamCopy_Impl(
272 : const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSource,
273 : const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDest,
274 : sal_Int32 nStorageType,
275 : const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aRelInfo );
276 :
277 : };
278 :
279 :
280 : class OStorage : public ::com::sun::star::lang::XTypeProvider
281 : , public ::com::sun::star::embed::XStorage2
282 : , public ::com::sun::star::embed::XStorageRawAccess
283 : , public ::com::sun::star::embed::XTransactedObject
284 : , public ::com::sun::star::embed::XTransactionBroadcaster
285 : , public ::com::sun::star::util::XModifiable
286 : , public ::com::sun::star::embed::XEncryptionProtectedStorage
287 : , public ::com::sun::star::beans::XPropertySet
288 : , public ::com::sun::star::embed::XOptimizedStorage
289 : , public ::com::sun::star::embed::XRelationshipAccess
290 : , public ::com::sun::star::embed::XHierarchicalStorageAccess2
291 : , public ::cppu::OWeakObject
292 : {
293 : OStorage_Impl* m_pImpl;
294 : StorInternalData_Impl* m_pData;
295 :
296 : protected:
297 :
298 : void Commit_Impl();
299 :
300 : SotElement_Impl* OpenStreamElement_Impl( const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, sal_Bool bEncr );
301 :
302 : void BroadcastModifiedIfNecessary();
303 :
304 : void BroadcastTransaction( sal_Int8 nMessage );
305 :
306 : void MakeLinkToSubComponent_Impl(
307 : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComponent );
308 :
309 : public:
310 :
311 : OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream,
312 : sal_Int32 nMode,
313 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
314 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
315 : sal_Int32 nStorageType );
316 :
317 : OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
318 : sal_Int32 nMode,
319 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
320 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
321 : sal_Int32 nStorageType );
322 :
323 : OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap );
324 :
325 : virtual ~OStorage();
326 :
327 : void SAL_CALL InternalDispose( sal_Bool bNotifyImpl );
328 :
329 : void ChildIsDisposed( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xChild );
330 :
331 : sal_Int32 GetRefCount_Impl() { return m_refCount; }
332 :
333 : //____________________________________________________________________________________________________
334 : // XInterface
335 : //____________________________________________________________________________________________________
336 :
337 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
338 : throw( ::com::sun::star::uno::RuntimeException );
339 :
340 : virtual void SAL_CALL acquire() throw();
341 :
342 : virtual void SAL_CALL release() throw();
343 :
344 : //____________________________________________________________________________________________________
345 : // XTypeProvider
346 : //____________________________________________________________________________________________________
347 :
348 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
349 : throw( ::com::sun::star::uno::RuntimeException );
350 :
351 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
352 : throw( ::com::sun::star::uno::RuntimeException );
353 :
354 : //____________________________________________________________________________________________________
355 : // XStorage
356 : //____________________________________________________________________________________________________
357 :
358 : virtual void SAL_CALL copyToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest )
359 : throw ( ::com::sun::star::embed::InvalidStorageException,
360 : ::com::sun::star::lang::IllegalArgumentException,
361 : ::com::sun::star::io::IOException,
362 : ::com::sun::star::embed::StorageWrappedTargetException,
363 : ::com::sun::star::uno::RuntimeException );
364 :
365 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openStreamElement(
366 : const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode )
367 : throw ( ::com::sun::star::embed::InvalidStorageException,
368 : ::com::sun::star::lang::IllegalArgumentException,
369 : ::com::sun::star::packages::WrongPasswordException,
370 : ::com::sun::star::io::IOException,
371 : ::com::sun::star::embed::StorageWrappedTargetException,
372 : ::com::sun::star::uno::RuntimeException );
373 :
374 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL openEncryptedStreamElement(
375 : const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode, const ::rtl::OUString& aPass )
376 : throw ( ::com::sun::star::embed::InvalidStorageException,
377 : ::com::sun::star::lang::IllegalArgumentException,
378 : ::com::sun::star::packages::NoEncryptionException,
379 : ::com::sun::star::packages::WrongPasswordException,
380 : ::com::sun::star::io::IOException,
381 : ::com::sun::star::embed::StorageWrappedTargetException,
382 : ::com::sun::star::uno::RuntimeException );
383 :
384 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL openStorageElement(
385 : const ::rtl::OUString& aStorName, sal_Int32 nStorageMode )
386 : throw ( ::com::sun::star::embed::InvalidStorageException,
387 : ::com::sun::star::lang::IllegalArgumentException,
388 : ::com::sun::star::io::IOException,
389 : ::com::sun::star::embed::StorageWrappedTargetException,
390 : ::com::sun::star::uno::RuntimeException );
391 :
392 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneStreamElement(
393 : const ::rtl::OUString& aStreamName )
394 : throw ( ::com::sun::star::embed::InvalidStorageException,
395 : ::com::sun::star::lang::IllegalArgumentException,
396 : ::com::sun::star::packages::WrongPasswordException,
397 : ::com::sun::star::io::IOException,
398 : ::com::sun::star::embed::StorageWrappedTargetException,
399 : ::com::sun::star::uno::RuntimeException );
400 :
401 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > SAL_CALL cloneEncryptedStreamElement(
402 : const ::rtl::OUString& aStreamName, const ::rtl::OUString& aPass )
403 : throw ( ::com::sun::star::embed::InvalidStorageException,
404 : ::com::sun::star::lang::IllegalArgumentException,
405 : ::com::sun::star::packages::NoEncryptionException,
406 : ::com::sun::star::packages::WrongPasswordException,
407 : ::com::sun::star::io::IOException,
408 : ::com::sun::star::embed::StorageWrappedTargetException,
409 : ::com::sun::star::uno::RuntimeException );
410 :
411 : virtual void SAL_CALL copyLastCommitTo(
412 : const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage )
413 : throw ( ::com::sun::star::embed::InvalidStorageException,
414 : ::com::sun::star::lang::IllegalArgumentException,
415 : ::com::sun::star::io::IOException,
416 : ::com::sun::star::embed::StorageWrappedTargetException,
417 : ::com::sun::star::uno::RuntimeException );
418 :
419 : virtual void SAL_CALL copyStorageElementLastCommitTo(
420 : const ::rtl::OUString& aStorName,
421 : const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xTargetStorage )
422 : throw ( ::com::sun::star::embed::InvalidStorageException,
423 : ::com::sun::star::lang::IllegalArgumentException,
424 : ::com::sun::star::io::IOException,
425 : ::com::sun::star::embed::StorageWrappedTargetException,
426 : ::com::sun::star::uno::RuntimeException );
427 :
428 : virtual sal_Bool SAL_CALL isStreamElement( const ::rtl::OUString& aElementName )
429 : throw ( ::com::sun::star::container::NoSuchElementException,
430 : ::com::sun::star::lang::IllegalArgumentException,
431 : ::com::sun::star::embed::InvalidStorageException,
432 : ::com::sun::star::uno::RuntimeException );
433 :
434 : virtual sal_Bool SAL_CALL isStorageElement( const ::rtl::OUString& aElementName )
435 : throw ( ::com::sun::star::container::NoSuchElementException,
436 : ::com::sun::star::lang::IllegalArgumentException,
437 : ::com::sun::star::embed::InvalidStorageException,
438 : ::com::sun::star::uno::RuntimeException );
439 :
440 : virtual void SAL_CALL removeElement( const ::rtl::OUString& aElementName )
441 : throw ( ::com::sun::star::embed::InvalidStorageException,
442 : ::com::sun::star::lang::IllegalArgumentException,
443 : ::com::sun::star::container::NoSuchElementException,
444 : ::com::sun::star::io::IOException,
445 : ::com::sun::star::embed::StorageWrappedTargetException,
446 : ::com::sun::star::uno::RuntimeException );
447 :
448 : virtual void SAL_CALL renameElement( const ::rtl::OUString& rEleName, const ::rtl::OUString& rNewName )
449 : throw ( ::com::sun::star::embed::InvalidStorageException,
450 : ::com::sun::star::lang::IllegalArgumentException,
451 : ::com::sun::star::container::NoSuchElementException,
452 : ::com::sun::star::container::ElementExistException,
453 : ::com::sun::star::io::IOException,
454 : ::com::sun::star::embed::StorageWrappedTargetException,
455 : ::com::sun::star::uno::RuntimeException );
456 :
457 : virtual void SAL_CALL copyElementTo( const ::rtl::OUString& aElementName,
458 : const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
459 : const ::rtl::OUString& aNewName )
460 : throw ( ::com::sun::star::embed::InvalidStorageException,
461 : ::com::sun::star::lang::IllegalArgumentException,
462 : ::com::sun::star::container::NoSuchElementException,
463 : ::com::sun::star::container::ElementExistException,
464 : ::com::sun::star::io::IOException,
465 : ::com::sun::star::embed::StorageWrappedTargetException,
466 : ::com::sun::star::uno::RuntimeException );
467 :
468 : virtual void SAL_CALL moveElementTo( const ::rtl::OUString& aElementName,
469 : const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xDest,
470 : const ::rtl::OUString& rNewName )
471 : throw ( ::com::sun::star::embed::InvalidStorageException,
472 : ::com::sun::star::lang::IllegalArgumentException,
473 : ::com::sun::star::container::NoSuchElementException,
474 : ::com::sun::star::container::ElementExistException,
475 : ::com::sun::star::io::IOException,
476 : ::com::sun::star::embed::StorageWrappedTargetException,
477 : ::com::sun::star::uno::RuntimeException );
478 :
479 : //____________________________________________________________________________________________________
480 : // XStorage2
481 : //____________________________________________________________________________________________________
482 :
483 : 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 )
484 : throw ( ::com::sun::star::embed::InvalidStorageException,
485 : ::com::sun::star::lang::IllegalArgumentException,
486 : ::com::sun::star::packages::NoEncryptionException,
487 : ::com::sun::star::packages::WrongPasswordException,
488 : ::com::sun::star::io::IOException,
489 : ::com::sun::star::embed::StorageWrappedTargetException,
490 : ::com::sun::star::uno::RuntimeException);
491 :
492 : 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 )
493 : throw ( ::com::sun::star::embed::InvalidStorageException,
494 : ::com::sun::star::lang::IllegalArgumentException,
495 : ::com::sun::star::packages::NoEncryptionException,
496 : ::com::sun::star::packages::WrongPasswordException,
497 : ::com::sun::star::io::IOException,
498 : ::com::sun::star::embed::StorageWrappedTargetException,
499 : ::com::sun::star::uno::RuntimeException);
500 :
501 : //____________________________________________________________________________________________________
502 : // XStorageRawAccess
503 : //____________________________________________________________________________________________________
504 :
505 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getPlainRawStreamElement(
506 : const ::rtl::OUString& sStreamName )
507 : throw ( ::com::sun::star::embed::InvalidStorageException,
508 : ::com::sun::star::lang::IllegalArgumentException,
509 : ::com::sun::star::container::NoSuchElementException,
510 : ::com::sun::star::io::IOException,
511 : ::com::sun::star::embed::StorageWrappedTargetException,
512 : ::com::sun::star::uno::RuntimeException );
513 :
514 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawEncrStreamElement(
515 : const ::rtl::OUString& sStreamName )
516 : throw ( ::com::sun::star::embed::InvalidStorageException,
517 : ::com::sun::star::lang::IllegalArgumentException,
518 : ::com::sun::star::packages::NoEncryptionException,
519 : ::com::sun::star::container::NoSuchElementException,
520 : ::com::sun::star::io::IOException,
521 : ::com::sun::star::embed::StorageWrappedTargetException,
522 : ::com::sun::star::uno::RuntimeException );
523 :
524 : virtual void SAL_CALL insertRawEncrStreamElement( const ::rtl::OUString& aStreamName,
525 : const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
526 : throw ( ::com::sun::star::embed::InvalidStorageException,
527 : ::com::sun::star::lang::IllegalArgumentException,
528 : ::com::sun::star::packages::NoRawFormatException,
529 : ::com::sun::star::container::ElementExistException,
530 : ::com::sun::star::io::IOException,
531 : ::com::sun::star::embed::StorageWrappedTargetException,
532 : ::com::sun::star::uno::RuntimeException);
533 :
534 : //____________________________________________________________________________________________________
535 : // XTransactedObject
536 : //____________________________________________________________________________________________________
537 :
538 : virtual void SAL_CALL commit()
539 : throw ( ::com::sun::star::io::IOException,
540 : ::com::sun::star::embed::StorageWrappedTargetException,
541 : ::com::sun::star::uno::RuntimeException );
542 :
543 : virtual void SAL_CALL revert()
544 : throw ( ::com::sun::star::io::IOException,
545 : ::com::sun::star::embed::StorageWrappedTargetException,
546 : ::com::sun::star::uno::RuntimeException );
547 :
548 : //____________________________________________________________________________________________________
549 : // XTransactionBroadcaster
550 : //____________________________________________________________________________________________________
551 :
552 : virtual void SAL_CALL addTransactionListener(
553 : const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener )
554 : throw ( ::com::sun::star::uno::RuntimeException );
555 :
556 : virtual void SAL_CALL removeTransactionListener(
557 : const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XTransactionListener >& aListener )
558 : throw ( ::com::sun::star::uno::RuntimeException );
559 :
560 : //____________________________________________________________________________________________________
561 : // XModifiable
562 : //____________________________________________________________________________________________________
563 :
564 : virtual sal_Bool SAL_CALL isModified()
565 : throw ( ::com::sun::star::uno::RuntimeException );
566 :
567 : virtual void SAL_CALL setModified( sal_Bool bModified )
568 : throw ( ::com::sun::star::beans::PropertyVetoException,
569 : ::com::sun::star::uno::RuntimeException );
570 :
571 : virtual void SAL_CALL addModifyListener(
572 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
573 : throw ( ::com::sun::star::uno::RuntimeException );
574 :
575 : virtual void SAL_CALL removeModifyListener(
576 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
577 : throw ( ::com::sun::star::uno::RuntimeException );
578 :
579 : //____________________________________________________________________________________________________
580 : // XNameAccess
581 : //____________________________________________________________________________________________________
582 :
583 : virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
584 : throw ( ::com::sun::star::container::NoSuchElementException,
585 : ::com::sun::star::lang::WrappedTargetException,
586 : ::com::sun::star::uno::RuntimeException );
587 :
588 : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
589 : throw ( ::com::sun::star::uno::RuntimeException );
590 :
591 : virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
592 : throw ( ::com::sun::star::uno::RuntimeException );
593 :
594 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
595 : throw ( ::com::sun::star::uno::RuntimeException );
596 :
597 : virtual sal_Bool SAL_CALL hasElements()
598 : throw ( ::com::sun::star::uno::RuntimeException );
599 :
600 : //____________________________________________________________________________________________________
601 : // XComponent
602 : //____________________________________________________________________________________________________
603 :
604 : virtual void SAL_CALL dispose()
605 : throw ( ::com::sun::star::uno::RuntimeException );
606 :
607 : virtual void SAL_CALL addEventListener(
608 : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
609 : throw ( ::com::sun::star::uno::RuntimeException );
610 :
611 : virtual void SAL_CALL removeEventListener(
612 : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
613 : throw ( ::com::sun::star::uno::RuntimeException );
614 :
615 : //____________________________________________________________________________________________________
616 : // XEncryptionProtectedSource
617 : //____________________________________________________________________________________________________
618 :
619 : virtual void SAL_CALL setEncryptionPassword( const ::rtl::OUString& aPass )
620 : throw ( ::com::sun::star::uno::RuntimeException,
621 : ::com::sun::star::io::IOException );
622 :
623 : virtual void SAL_CALL removeEncryption()
624 : throw ( ::com::sun::star::uno::RuntimeException,
625 : ::com::sun::star::io::IOException );
626 :
627 : //____________________________________________________________________________________________________
628 : // XEncryptionProtectedSource2
629 : //____________________________________________________________________________________________________
630 :
631 : virtual void SAL_CALL setEncryptionData(
632 : const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
633 : throw ( ::com::sun::star::io::IOException,
634 : ::com::sun::star::uno::RuntimeException );
635 :
636 : virtual sal_Bool SAL_CALL hasEncryptionData()
637 : throw ( ::com::sun::star::uno::RuntimeException );
638 :
639 : //____________________________________________________________________________________________________
640 : // XEncryptionProtectedStorage
641 : //____________________________________________________________________________________________________
642 :
643 : 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 :
645 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getEncryptionAlgorithms() throw (::com::sun::star::uno::RuntimeException);
646 :
647 : //____________________________________________________________________________________________________
648 : // XPropertySet
649 : //____________________________________________________________________________________________________
650 :
651 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
652 : throw ( ::com::sun::star::uno::RuntimeException );
653 :
654 : virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
655 : throw ( ::com::sun::star::beans::UnknownPropertyException,
656 : ::com::sun::star::beans::PropertyVetoException,
657 : ::com::sun::star::lang::IllegalArgumentException,
658 : ::com::sun::star::lang::WrappedTargetException,
659 : ::com::sun::star::uno::RuntimeException );
660 :
661 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
662 : throw ( ::com::sun::star::beans::UnknownPropertyException,
663 : ::com::sun::star::lang::WrappedTargetException,
664 : ::com::sun::star::uno::RuntimeException );
665 :
666 : virtual void SAL_CALL addPropertyChangeListener(
667 : const ::rtl::OUString& aPropertyName,
668 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
669 : throw ( ::com::sun::star::beans::UnknownPropertyException,
670 : ::com::sun::star::lang::WrappedTargetException,
671 : ::com::sun::star::uno::RuntimeException );
672 :
673 : virtual void SAL_CALL removePropertyChangeListener(
674 : const ::rtl::OUString& aPropertyName,
675 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
676 : throw ( ::com::sun::star::beans::UnknownPropertyException,
677 : ::com::sun::star::lang::WrappedTargetException,
678 : ::com::sun::star::uno::RuntimeException );
679 :
680 : virtual void SAL_CALL addVetoableChangeListener(
681 : const ::rtl::OUString& PropertyName,
682 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
683 : throw ( ::com::sun::star::beans::UnknownPropertyException,
684 : ::com::sun::star::lang::WrappedTargetException,
685 : ::com::sun::star::uno::RuntimeException );
686 :
687 : virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
688 : throw ( ::com::sun::star::beans::UnknownPropertyException,
689 : ::com::sun::star::lang::WrappedTargetException,
690 : ::com::sun::star::uno::RuntimeException );
691 :
692 : //____________________________________________________________________________________________________
693 : // XOptimizedStorage
694 : //____________________________________________________________________________________________________
695 : virtual void SAL_CALL insertRawNonEncrStreamElementDirect( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream )
696 : throw ( ::com::sun::star::embed::InvalidStorageException,
697 : ::com::sun::star::lang::IllegalArgumentException,
698 : ::com::sun::star::packages::NoRawFormatException,
699 : ::com::sun::star::container::ElementExistException,
700 : ::com::sun::star::io::IOException,
701 : ::com::sun::star::embed::StorageWrappedTargetException,
702 : ::com::sun::star::uno::RuntimeException );
703 :
704 : 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 )
705 : throw ( ::com::sun::star::embed::InvalidStorageException,
706 : ::com::sun::star::lang::IllegalArgumentException,
707 : ::com::sun::star::container::ElementExistException,
708 : ::com::sun::star::io::IOException,
709 : ::com::sun::star::embed::StorageWrappedTargetException,
710 : ::com::sun::star::uno::RuntimeException );
711 :
712 : 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 )
713 : throw ( ::com::sun::star::embed::InvalidStorageException,
714 : ::com::sun::star::lang::IllegalArgumentException,
715 : ::com::sun::star::container::NoSuchElementException,
716 : ::com::sun::star::container::ElementExistException,
717 : ::com::sun::star::io::IOException,
718 : ::com::sun::star::embed::StorageWrappedTargetException,
719 : ::com::sun::star::uno::RuntimeException );
720 :
721 : virtual void SAL_CALL writeAndAttachToStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream )
722 : throw ( ::com::sun::star::embed::InvalidStorageException,
723 : ::com::sun::star::lang::IllegalArgumentException,
724 : ::com::sun::star::io::IOException,
725 : ::com::sun::star::embed::StorageWrappedTargetException,
726 : ::com::sun::star::uno::RuntimeException );
727 :
728 : virtual void SAL_CALL attachToURL( const ::rtl::OUString& sURL, sal_Bool bReadOnly )
729 : throw ( ::com::sun::star::embed::InvalidStorageException,
730 : ::com::sun::star::lang::IllegalArgumentException,
731 : ::com::sun::star::io::IOException,
732 : ::com::sun::star::embed::StorageWrappedTargetException,
733 : ::com::sun::star::uno::RuntimeException );
734 :
735 : virtual ::com::sun::star::uno::Any SAL_CALL getElementPropertyValue( const ::rtl::OUString& sElementName, const ::rtl::OUString& sPropertyName )
736 : throw ( ::com::sun::star::embed::InvalidStorageException,
737 : ::com::sun::star::lang::IllegalArgumentException,
738 : ::com::sun::star::container::NoSuchElementException,
739 : ::com::sun::star::io::IOException,
740 : ::com::sun::star::beans::UnknownPropertyException,
741 : ::com::sun::star::beans::PropertyVetoException,
742 : ::com::sun::star::embed::StorageWrappedTargetException,
743 : ::com::sun::star::uno::RuntimeException);
744 :
745 : virtual void SAL_CALL copyStreamElementData( const ::rtl::OUString& sStreamName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xTargetStream )
746 : throw ( ::com::sun::star::embed::InvalidStorageException,
747 : ::com::sun::star::lang::IllegalArgumentException,
748 : ::com::sun::star::packages::WrongPasswordException,
749 : ::com::sun::star::io::IOException,
750 : ::com::sun::star::embed::StorageWrappedTargetException,
751 : ::com::sun::star::uno::RuntimeException );
752 :
753 : //____________________________________________________________________________________________________
754 : // XRelationshipAccess
755 : //____________________________________________________________________________________________________
756 :
757 : virtual ::sal_Bool SAL_CALL hasByID( const ::rtl::OUString& sID )
758 : throw ( ::com::sun::star::io::IOException,
759 : ::com::sun::star::uno::RuntimeException);
760 :
761 : virtual ::rtl::OUString SAL_CALL getTargetByID( const ::rtl::OUString& sID )
762 : throw ( ::com::sun::star::container::NoSuchElementException,
763 : ::com::sun::star::io::IOException,
764 : ::com::sun::star::uno::RuntimeException);
765 :
766 : virtual ::rtl::OUString SAL_CALL getTypeByID( const ::rtl::OUString& sID )
767 : throw ( ::com::sun::star::container::NoSuchElementException,
768 : ::com::sun::star::io::IOException,
769 : ::com::sun::star::uno::RuntimeException);
770 :
771 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > SAL_CALL getRelationshipByID( const ::rtl::OUString& sID )
772 : throw ( ::com::sun::star::container::NoSuchElementException,
773 : ::com::sun::star::io::IOException,
774 : ::com::sun::star::uno::RuntimeException);
775 :
776 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getRelationshipsByType( const ::rtl::OUString& sType )
777 : throw ( ::com::sun::star::io::IOException,
778 : ::com::sun::star::uno::RuntimeException);
779 :
780 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL getAllRelationships( )
781 : throw ( ::com::sun::star::io::IOException,
782 : ::com::sun::star::uno::RuntimeException);
783 :
784 : virtual void SAL_CALL insertRelationshipByID( const ::rtl::OUString& sID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aEntry, ::sal_Bool bReplace )
785 : throw ( ::com::sun::star::container::ElementExistException,
786 : ::com::sun::star::io::IOException,
787 : ::com::sun::star::uno::RuntimeException);
788 :
789 : virtual void SAL_CALL removeRelationshipByID( const ::rtl::OUString& sID )
790 : throw ( ::com::sun::star::container::NoSuchElementException,
791 : ::com::sun::star::io::IOException,
792 : ::com::sun::star::uno::RuntimeException);
793 :
794 : 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 )
795 : throw ( ::com::sun::star::container::ElementExistException,
796 : ::com::sun::star::io::IOException,
797 : ::com::sun::star::uno::RuntimeException);
798 :
799 : virtual void SAL_CALL clearRelationships( )
800 : throw ( ::com::sun::star::io::IOException,
801 : ::com::sun::star::uno::RuntimeException);
802 :
803 : //____________________________________________________________________________________________________
804 : // XHierarchicalStorageAccess
805 : //____________________________________________________________________________________________________
806 :
807 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XExtendedStorageStream > SAL_CALL openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode )
808 : throw ( ::com::sun::star::embed::InvalidStorageException,
809 : ::com::sun::star::lang::IllegalArgumentException,
810 : ::com::sun::star::packages::WrongPasswordException,
811 : ::com::sun::star::io::IOException,
812 : ::com::sun::star::embed::StorageWrappedTargetException,
813 : ::com::sun::star::uno::RuntimeException);
814 :
815 : 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 )
816 : throw ( ::com::sun::star::embed::InvalidStorageException,
817 : ::com::sun::star::lang::IllegalArgumentException,
818 : ::com::sun::star::packages::NoEncryptionException,
819 : ::com::sun::star::packages::WrongPasswordException,
820 : ::com::sun::star::io::IOException,
821 : ::com::sun::star::embed::StorageWrappedTargetException,
822 : ::com::sun::star::uno::RuntimeException);
823 :
824 : virtual void SAL_CALL removeStreamElementByHierarchicalName( const ::rtl::OUString& sElementPath )
825 : throw ( ::com::sun::star::embed::InvalidStorageException,
826 : ::com::sun::star::lang::IllegalArgumentException,
827 : ::com::sun::star::container::NoSuchElementException,
828 : ::com::sun::star::io::IOException,
829 : ::com::sun::star::embed::StorageWrappedTargetException,
830 : ::com::sun::star::uno::RuntimeException);
831 :
832 : //____________________________________________________________________________________________________
833 : // XHierarchicalStorageAccess2
834 : //____________________________________________________________________________________________________
835 :
836 : 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 )
837 : throw ( ::com::sun::star::embed::InvalidStorageException,
838 : ::com::sun::star::lang::IllegalArgumentException,
839 : ::com::sun::star::packages::NoEncryptionException,
840 : ::com::sun::star::packages::WrongPasswordException,
841 : ::com::sun::star::io::IOException,
842 : ::com::sun::star::embed::StorageWrappedTargetException,
843 : ::com::sun::star::uno::RuntimeException );
844 : };
845 :
846 :
847 : #endif
848 :
849 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|