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