/src/libreoffice/package/source/xstor/xstorage.hxx
Line | Count | Source |
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/XEncryptionProtectedStorage.hpp> |
31 | | #include <com/sun/star/embed/XRelationshipAccess.hpp> |
32 | | #include <com/sun/star/util/XModifiable.hpp> |
33 | | #include <com/sun/star/container/XNameContainer.hpp> |
34 | | #include <com/sun/star/beans/XPropertySet.hpp> |
35 | | #include <com/sun/star/beans/PropertyValue.hpp> |
36 | | #include <com/sun/star/beans/StringPair.hpp> |
37 | | #include <com/sun/star/io/XStream.hpp> |
38 | | #include <com/sun/star/lang/XSingleServiceFactory.hpp> |
39 | | #include <com/sun/star/lang/XTypeProvider.hpp> |
40 | | #include <com/sun/star/lang/XComponent.hpp> |
41 | | |
42 | | #include <cppuhelper/typeprovider.hxx> |
43 | | #include <cppuhelper/weak.hxx> |
44 | | #include <cppuhelper/weakref.hxx> |
45 | | #include <comphelper/multicontainer2.hxx> |
46 | | #include <comphelper/refcountedmutex.hxx> |
47 | | #include <comphelper/sequenceashashmap.hxx> |
48 | | #include <o3tl/deleter.hxx> |
49 | | #include <rtl/ref.hxx> |
50 | | |
51 | | #include "ohierarchyholder.hxx" |
52 | | #include "disposelistener.hxx" |
53 | | |
54 | | #include <vector> |
55 | | #include <memory> |
56 | | #include <optional> |
57 | | #include <string_view> |
58 | | |
59 | | namespace com::sun::star::uno { |
60 | | class XComponentContext; |
61 | | } |
62 | | |
63 | 680k | #define RELINFO_NO_INIT 1 |
64 | 266k | #define RELINFO_READ 2 |
65 | 11 | #define RELINFO_CHANGED 3 |
66 | 109k | #define RELINFO_CHANGED_STREAM 4 |
67 | 71.5k | #define RELINFO_CHANGED_STREAM_READ 5 |
68 | 0 | #define RELINFO_BROKEN 6 |
69 | 0 | #define RELINFO_CHANGED_BROKEN 7 |
70 | | |
71 | 0 | #define STOR_MESS_PRECOMMIT 1 |
72 | 0 | #define STOR_MESS_COMMITTED 2 |
73 | 0 | #define STOR_MESS_PREREVERT 3 |
74 | 0 | #define STOR_MESS_REVERTED 4 |
75 | | |
76 | | // a common implementation for an entry |
77 | | |
78 | | struct OStorage_Impl; |
79 | | struct OWriteStream_Impl; |
80 | | |
81 | | struct SotElement_Impl |
82 | | { |
83 | | OUString m_aOriginalName; |
84 | | bool m_bIsRemoved; |
85 | | bool m_bIsInserted; |
86 | | bool m_bIsStorage; |
87 | | |
88 | | std::unique_ptr<OStorage_Impl> m_xStorage; |
89 | | std::unique_ptr<OWriteStream_Impl, o3tl::default_delete<OWriteStream_Impl>> m_xStream; |
90 | | |
91 | | public: |
92 | | SotElement_Impl(OUString aName, bool bStor, bool bNew); |
93 | | }; |
94 | | |
95 | | // Main storage implementation |
96 | | |
97 | | class OStorage; |
98 | | |
99 | | struct StorageHolder_Impl |
100 | | { |
101 | | OStorage* m_pPointer; |
102 | | css::uno::WeakReference< css::embed::XStorage > m_xWeakRef; |
103 | | |
104 | | explicit inline StorageHolder_Impl( OStorage* pStorage ); |
105 | | }; |
106 | | |
107 | | class SwitchablePersistenceStream; |
108 | | struct OStorage_Impl |
109 | | { |
110 | | typedef std::vector<StorageHolder_Impl> StorageHoldersType; |
111 | | |
112 | | rtl::Reference<comphelper::RefCountedMutex> m_xMutex; |
113 | | |
114 | | OStorage* m_pAntiImpl; // only valid if external references exists |
115 | | StorageHoldersType m_aReadOnlyWrapVector; // only valid if readonly external reference exists |
116 | | |
117 | | sal_Int32 m_nStorageMode; // open mode ( read/write/trunc/nocreate ) |
118 | | bool m_bIsModified; // only modified elements will be sent to the original content |
119 | | bool m_bBroadcastModified; // will be set if notification is required |
120 | | |
121 | | bool m_bCommited; // sending the streams is coordinated by the root storage of the package |
122 | | |
123 | | bool m_bIsRoot; // marks this storage as root storages that manages all commits and reverts |
124 | | bool m_bListCreated; |
125 | | bool m_bRepairPackage = false; |
126 | | |
127 | | /// Count of registered modification listeners |
128 | | oslInterlockedCount m_nModifiedListenerCount; |
129 | | bool HasModifiedListener() const |
130 | 571 | { |
131 | 571 | return m_nModifiedListenerCount > 0 && m_pAntiImpl != nullptr; |
132 | 571 | } |
133 | | |
134 | | std::unordered_map<OUString, std::vector<SotElement_Impl*>> m_aChildrenMap; |
135 | | std::vector< SotElement_Impl* > m_aDeletedVector; |
136 | | |
137 | | css::uno::Reference< css::container::XNameContainer > m_xPackageFolder; |
138 | | |
139 | | css::uno::Reference< css::lang::XSingleServiceFactory > m_xPackage; |
140 | | css::uno::Reference< css::uno::XComponentContext > m_xContext; |
141 | | |
142 | | // valid only for root storage |
143 | | css::uno::Reference< css::io::XInputStream > m_xInputStream; // ??? may be stored in properties |
144 | | rtl::Reference< SwitchablePersistenceStream > m_xStream; // ??? may be stored in properties |
145 | | css::uno::Sequence< css::beans::PropertyValue > m_xProperties; |
146 | | bool m_bHasCommonEncryptionData; |
147 | | ::comphelper::SequenceAsHashMap m_aCommonEncryptionData; |
148 | | |
149 | | // must be empty in case of root storage |
150 | | OStorage_Impl* m_pParent; |
151 | | |
152 | | bool m_bControlMediaType; |
153 | | OUString m_aMediaType; |
154 | | bool m_bMTFallbackUsed; |
155 | | |
156 | | bool m_bControlVersion; |
157 | | OUString m_aVersion; |
158 | | |
159 | | rtl::Reference<SwitchablePersistenceStream> m_pSwitchStream; |
160 | | |
161 | | sal_Int32 m_nStorageType; // the mode in which the storage is used |
162 | | |
163 | | // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML |
164 | | SotElement_Impl* m_pRelStorElement; |
165 | | rtl::Reference< OStorage > m_xRelStorage; |
166 | | css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > > m_aRelInfo; |
167 | | css::uno::Reference< css::io::XInputStream > m_xNewRelInfoStream; |
168 | | sal_Int16 m_nRelInfoStatus; |
169 | | |
170 | | // Constructors |
171 | | OStorage_Impl( css::uno::Reference< css::io::XInputStream > const & xInputStream, |
172 | | sal_Int32 nMode, |
173 | | const css::uno::Sequence< css::beans::PropertyValue >& xProperties, |
174 | | css::uno::Reference< css::uno::XComponentContext > const & xContext, |
175 | | sal_Int32 nStorageType ); |
176 | | |
177 | | OStorage_Impl( css::uno::Reference< css::io::XStream > const & xStream, |
178 | | sal_Int32 nMode, |
179 | | const css::uno::Sequence< css::beans::PropertyValue >& xProperties, |
180 | | css::uno::Reference< css::uno::XComponentContext > const & xContext, |
181 | | sal_Int32 nStorageType ); |
182 | | |
183 | | // constructor for a substorage |
184 | | OStorage_Impl( OStorage_Impl* pParent, |
185 | | sal_Int32 nMode, |
186 | | css::uno::Reference< css::container::XNameContainer > const & xPackageFolder, |
187 | | css::uno::Reference< css::lang::XSingleServiceFactory > xPackage, |
188 | | css::uno::Reference< css::uno::XComponentContext > const & xContext, |
189 | | sal_Int32 nStorageType ); |
190 | | |
191 | | ~OStorage_Impl(); |
192 | | |
193 | | void SetReadOnlyWrap( OStorage& aStorage ); |
194 | | void RemoveReadOnlyWrap( const OStorage& aStorage ); |
195 | | |
196 | | void OpenOwnPackage(); |
197 | | void ReadContents(); |
198 | | void ReadRelInfoIfNecessary(); |
199 | | |
200 | | bool HasChildren(); |
201 | | void GetStorageProperties(); |
202 | | |
203 | | css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > > GetAllRelationshipsIfAny(); |
204 | | void CopyLastCommitTo( const css::uno::Reference< css::embed::XStorage >& xNewStor ); |
205 | | |
206 | | void InsertIntoPackageFolder( |
207 | | const OUString& aName, |
208 | | const css::uno::Reference< css::container::XNameContainer >& xParentPackageFolder ); |
209 | | |
210 | | void Commit(); |
211 | | void Revert(); |
212 | | |
213 | | /// @throws css::packages::NoEncryptionException |
214 | | ::comphelper::SequenceAsHashMap GetCommonRootEncryptionData(); |
215 | | |
216 | | void CopyToStorage( const css::uno::Reference< css::embed::XStorage >& xDest, |
217 | | bool bDirect ); |
218 | | void CopyStorageElement( SotElement_Impl* pElement, |
219 | | const css::uno::Reference< css::embed::XStorage >& xDest, |
220 | | const OUString& aName, |
221 | | bool bDirect ); |
222 | | |
223 | | SotElement_Impl* FindElement( const OUString& rName ); |
224 | | |
225 | | SotElement_Impl* InsertStream( const OUString& aName, bool bEncr ); |
226 | | void InsertRawStream( const OUString& aName, const css::uno::Reference< css::io::XInputStream >& xInStream ); |
227 | | |
228 | | std::unique_ptr<OStorage_Impl> CreateNewStorageImpl( sal_Int32 nStorageMode ); |
229 | | SotElement_Impl* InsertStorage( const OUString& aName, sal_Int32 nStorageMode ); |
230 | | SotElement_Impl* InsertElement( const OUString& aName, bool bIsStorage ); |
231 | | |
232 | | void OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorageMode ); |
233 | | void OpenSubStream( SotElement_Impl* pElement ); |
234 | | |
235 | | css::uno::Sequence< OUString > GetElementNames(); |
236 | | |
237 | | void RemoveElement( OUString const & rName, SotElement_Impl* pElement ); |
238 | | static void ClearElement( SotElement_Impl* pElement ); |
239 | | |
240 | | /// @throws css::embed::InvalidStorageException |
241 | | /// @throws css::lang::IllegalArgumentException |
242 | | /// @throws css::packages::WrongPasswordException |
243 | | /// @throws css::packages::NoEncryptionException |
244 | | /// @throws css::container::NoSuchElementException |
245 | | /// @throws css::io::IOException |
246 | | /// @throws css::embed::StorageWrappedTargetException |
247 | | /// @throws css::uno::RuntimeException |
248 | | void CloneStreamElement( |
249 | | const OUString& aStreamName, |
250 | | bool bPassProvided, |
251 | | const ::comphelper::SequenceAsHashMap& aEncryptionData, |
252 | | css::uno::Reference< css::io::XStream >& xTargetStream ); |
253 | | |
254 | | void RemoveStreamRelInfo( std::u16string_view aOriginalName ); |
255 | | void CreateRelStorage(); |
256 | | void CommitStreamRelInfo( std::u16string_view rName, SotElement_Impl const * pStreamElement ); |
257 | | css::uno::Reference< css::io::XInputStream > GetRelInfoStreamForName( |
258 | | std::u16string_view aName ); |
259 | | void CommitRelInfo( const css::uno::Reference< css::container::XNameContainer >& xNewPackageFolder ); |
260 | | |
261 | | static void completeStorageStreamCopy_Impl( |
262 | | const css::uno::Reference< css::io::XStream >& xSource, |
263 | | const css::uno::Reference< css::io::XStream >& xDest, |
264 | | sal_Int32 nStorageType, |
265 | | const css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >& aRelInfo ); |
266 | | |
267 | | }; |
268 | | |
269 | | class OStorage final : public css::lang::XTypeProvider |
270 | | , public css::embed::XStorage2 |
271 | | , public css::embed::XStorageRawAccess |
272 | | , public css::embed::XTransactedObject |
273 | | , public css::embed::XTransactionBroadcaster |
274 | | , public css::util::XModifiable |
275 | | , public css::embed::XEncryptionProtectedStorage |
276 | | , public css::beans::XPropertySet |
277 | | , public css::embed::XOptimizedStorage |
278 | | , public css::embed::XRelationshipAccess |
279 | | , public css::embed::XHierarchicalStorageAccess2 |
280 | | , public ::cppu::OWeakObject |
281 | | { |
282 | | OStorage_Impl* m_pImpl; |
283 | | rtl::Reference<comphelper::RefCountedMutex> m_xSharedMutex; |
284 | | comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenersContainer; // list of listeners |
285 | | ::std::optional< ::cppu::OTypeCollection> m_oTypeCollection; |
286 | | bool m_bReadOnlyWrap; |
287 | | ::rtl::Reference<OChildDispListener_Impl> m_pSubElDispListener; |
288 | | ::std::vector< css::uno::WeakReference< css::lang::XComponent > > m_aOpenSubComponentsVector; |
289 | | std::unique_ptr<OHierarchyHolder_Impl> m_pHierarchyHolder; |
290 | | |
291 | | SotElement_Impl* OpenStreamElement_Impl( const OUString& aStreamName, sal_Int32 nOpenMode, bool bEncr ); |
292 | | |
293 | | void BroadcastModifiedIfNecessary(); |
294 | | |
295 | | void BroadcastTransaction( sal_Int8 nMessage ); |
296 | | |
297 | | void MakeLinkToSubComponent_Impl( |
298 | | const css::uno::Reference< css::lang::XComponent >& xComponent ); |
299 | | |
300 | | public: |
301 | | |
302 | | OStorage( css::uno::Reference< css::io::XInputStream > const & xInputStream, |
303 | | sal_Int32 nMode, |
304 | | const css::uno::Sequence< css::beans::PropertyValue >& xProperties, |
305 | | css::uno::Reference< css::uno::XComponentContext > const & xContext, |
306 | | sal_Int32 nStorageType ); |
307 | | |
308 | | OStorage( css::uno::Reference< css::io::XStream > const & xStream, |
309 | | sal_Int32 nMode, |
310 | | const css::uno::Sequence< css::beans::PropertyValue >& xProperties, |
311 | | css::uno::Reference< css::uno::XComponentContext > const & xContext, |
312 | | sal_Int32 nStorageType ); |
313 | | |
314 | | OStorage( OStorage_Impl* pImpl, bool bReadOnlyWrap ); |
315 | | |
316 | | virtual ~OStorage() override; |
317 | | |
318 | | void InternalDispose( bool bNotifyImpl ); |
319 | | |
320 | | void ChildIsDisposed( const css::uno::Reference< css::uno::XInterface >& xChild ); |
321 | | |
322 | 0 | sal_Int32 GetRefCount_Impl() const { return m_refCount; } |
323 | | |
324 | | // XInterface |
325 | | |
326 | | virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override; |
327 | | |
328 | | virtual void SAL_CALL acquire() noexcept override; |
329 | | |
330 | | virtual void SAL_CALL release() noexcept override; |
331 | | |
332 | | // XTypeProvider |
333 | | |
334 | | virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; |
335 | | |
336 | | virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; |
337 | | |
338 | | // XStorage |
339 | | |
340 | | virtual void SAL_CALL copyToStorage( const css::uno::Reference< css::embed::XStorage >& xDest ) override; |
341 | | |
342 | | virtual css::uno::Reference< css::io::XStream > SAL_CALL openStreamElement( |
343 | | const OUString& aStreamName, sal_Int32 nOpenMode ) override; |
344 | | |
345 | | virtual css::uno::Reference< css::io::XStream > SAL_CALL openEncryptedStreamElement( |
346 | | const OUString& aStreamName, sal_Int32 nOpenMode, const OUString& aPass ) override; |
347 | | |
348 | | virtual css::uno::Reference< css::embed::XStorage > SAL_CALL openStorageElement( |
349 | | const OUString& aStorName, sal_Int32 nStorageMode ) override final; |
350 | | |
351 | | rtl::Reference< OStorage > openStorageElement2( |
352 | | const OUString& aStorName, sal_Int32 nStorageMode ); |
353 | | |
354 | | virtual css::uno::Reference< css::io::XStream > SAL_CALL cloneStreamElement( |
355 | | const OUString& aStreamName ) override; |
356 | | |
357 | | virtual css::uno::Reference< css::io::XStream > SAL_CALL cloneEncryptedStreamElement( |
358 | | const OUString& aStreamName, const OUString& aPass ) override; |
359 | | |
360 | | virtual void SAL_CALL copyLastCommitTo( |
361 | | const css::uno::Reference< css::embed::XStorage >& xTargetStorage ) override; |
362 | | |
363 | | virtual void SAL_CALL copyStorageElementLastCommitTo( |
364 | | const OUString& aStorName, |
365 | | const css::uno::Reference< css::embed::XStorage >& xTargetStorage ) override; |
366 | | |
367 | | virtual sal_Bool SAL_CALL isStreamElement( const OUString& aElementName ) override; |
368 | | |
369 | | virtual sal_Bool SAL_CALL isStorageElement( const OUString& aElementName ) override; |
370 | | |
371 | | virtual void SAL_CALL removeElement( const OUString& aElementName ) override; |
372 | | |
373 | | virtual void SAL_CALL renameElement( const OUString& rEleName, const OUString& rNewName ) override; |
374 | | |
375 | | virtual void SAL_CALL copyElementTo( const OUString& aElementName, |
376 | | const css::uno::Reference< css::embed::XStorage >& xDest, |
377 | | const OUString& aNewName ) override; |
378 | | |
379 | | virtual void SAL_CALL moveElementTo( const OUString& aElementName, |
380 | | const css::uno::Reference< css::embed::XStorage >& xDest, |
381 | | const OUString& rNewName ) override; |
382 | | |
383 | | // XStorage2 |
384 | | |
385 | | virtual css::uno::Reference< css::io::XStream > SAL_CALL openEncryptedStream( const OUString& sStreamName, ::sal_Int32 nOpenMode, const css::uno::Sequence< css::beans::NamedValue >& aEncryptionData ) override; |
386 | | |
387 | | virtual css::uno::Reference< css::io::XStream > SAL_CALL cloneEncryptedStream( const OUString& sStreamName, const css::uno::Sequence< css::beans::NamedValue >& aEncryptionData ) override; |
388 | | |
389 | | // XStorageRawAccess |
390 | | |
391 | | virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getPlainRawStreamElement( |
392 | | const OUString& sStreamName ) override; |
393 | | |
394 | | virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getRawEncrStreamElement( |
395 | | const OUString& sStreamName ) override; |
396 | | |
397 | | virtual void SAL_CALL insertRawEncrStreamElement( const OUString& aStreamName, |
398 | | const css::uno::Reference< css::io::XInputStream >& xInStream ) override; |
399 | | |
400 | | // XTransactedObject |
401 | | virtual void SAL_CALL commit() override; |
402 | | |
403 | | virtual void SAL_CALL revert() override; |
404 | | |
405 | | // XTransactionBroadcaster |
406 | | virtual void SAL_CALL addTransactionListener( |
407 | | const css::uno::Reference< css::embed::XTransactionListener >& aListener ) override; |
408 | | |
409 | | virtual void SAL_CALL removeTransactionListener( |
410 | | const css::uno::Reference< css::embed::XTransactionListener >& aListener ) override; |
411 | | |
412 | | // XModifiable |
413 | | |
414 | | virtual sal_Bool SAL_CALL isModified() override; |
415 | | |
416 | | virtual void SAL_CALL setModified( sal_Bool bModified ) override; |
417 | | |
418 | | virtual void SAL_CALL addModifyListener( |
419 | | const css::uno::Reference< css::util::XModifyListener >& aListener ) override; |
420 | | |
421 | | virtual void SAL_CALL removeModifyListener( |
422 | | const css::uno::Reference< css::util::XModifyListener >& aListener ) override; |
423 | | |
424 | | // XNameAccess |
425 | | |
426 | | virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override; |
427 | | |
428 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
429 | | |
430 | | virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override; |
431 | | |
432 | | virtual css::uno::Type SAL_CALL getElementType() override; |
433 | | |
434 | | virtual sal_Bool SAL_CALL hasElements() override; |
435 | | |
436 | | // XComponent |
437 | | |
438 | | virtual void SAL_CALL dispose() override; |
439 | | |
440 | | virtual void SAL_CALL addEventListener( |
441 | | const css::uno::Reference< css::lang::XEventListener >& xListener ) override; |
442 | | |
443 | | virtual void SAL_CALL removeEventListener( |
444 | | const css::uno::Reference< css::lang::XEventListener >& xListener ) override; |
445 | | |
446 | | // XEncryptionProtectedSource |
447 | | |
448 | | virtual void SAL_CALL setEncryptionPassword( const OUString& aPass ) override; |
449 | | |
450 | | virtual void SAL_CALL removeEncryption() override; |
451 | | |
452 | | // XEncryptionProtectedSource2 |
453 | | |
454 | | virtual void SAL_CALL setEncryptionData( |
455 | | const css::uno::Sequence< css::beans::NamedValue >& aEncryptionData ) override; |
456 | | |
457 | | virtual sal_Bool SAL_CALL hasEncryptionData() override; |
458 | | |
459 | | // XEncryptionProtectedStorage |
460 | | |
461 | | virtual void SAL_CALL setEncryptionAlgorithms( const css::uno::Sequence< css::beans::NamedValue >& aAlgorithms ) override; |
462 | | virtual void SAL_CALL setGpgProperties( const css::uno::Sequence< css::uno::Sequence< css::beans::NamedValue > >& aCryptProps ) override; |
463 | | |
464 | | virtual css::uno::Sequence< css::beans::NamedValue > SAL_CALL getEncryptionAlgorithms() override; |
465 | | |
466 | | // XPropertySet |
467 | | |
468 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; |
469 | | |
470 | | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; |
471 | | |
472 | | virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; |
473 | | |
474 | | virtual void SAL_CALL addPropertyChangeListener( |
475 | | const OUString& aPropertyName, |
476 | | const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
477 | | |
478 | | virtual void SAL_CALL removePropertyChangeListener( |
479 | | const OUString& aPropertyName, |
480 | | const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
481 | | |
482 | | virtual void SAL_CALL addVetoableChangeListener( |
483 | | const OUString& PropertyName, |
484 | | const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
485 | | |
486 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
487 | | |
488 | | // XOptimizedStorage |
489 | | virtual void SAL_CALL insertRawNonEncrStreamElementDirect( const OUString& sStreamName, const css::uno::Reference< css::io::XInputStream >& xInStream ) override; |
490 | | |
491 | | virtual void SAL_CALL insertStreamElementDirect( const OUString& sStreamName, const css::uno::Reference< css::io::XInputStream >& xInStream, const css::uno::Sequence< css::beans::PropertyValue >& aProps ) override; |
492 | | |
493 | | virtual void SAL_CALL copyElementDirectlyTo( const OUString& sSourceName, const css::uno::Reference< css::embed::XOptimizedStorage >& xTargetStorage, const OUString& sTargetName ) override; |
494 | | |
495 | | virtual void SAL_CALL writeAndAttachToStream( const css::uno::Reference< css::io::XStream >& xStream ) override; |
496 | | |
497 | | virtual void SAL_CALL attachToURL( const OUString& sURL, sal_Bool bReadOnly ) override; |
498 | | |
499 | | virtual css::uno::Any SAL_CALL getElementPropertyValue( const OUString& sElementName, const OUString& sPropertyName ) override; |
500 | | |
501 | | virtual void SAL_CALL copyStreamElementData( const OUString& sStreamName, const css::uno::Reference< css::io::XStream >& xTargetStream ) override; |
502 | | |
503 | | // XRelationshipAccess |
504 | | virtual sal_Bool SAL_CALL hasByID( const OUString& sID ) override; |
505 | | |
506 | | virtual OUString SAL_CALL getTargetByID( const OUString& sID ) override; |
507 | | |
508 | | virtual OUString SAL_CALL getTypeByID( const OUString& sID ) override; |
509 | | |
510 | | virtual css::uno::Sequence< css::beans::StringPair > SAL_CALL getRelationshipByID( const OUString& sID ) override; |
511 | | |
512 | | virtual css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > > SAL_CALL getRelationshipsByType( const OUString& sType ) override; |
513 | | |
514 | | virtual css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > > SAL_CALL getAllRelationships( ) override; |
515 | | |
516 | | virtual void SAL_CALL insertRelationshipByID( const OUString& sID, const css::uno::Sequence< css::beans::StringPair >& aEntry, sal_Bool bReplace ) override; |
517 | | |
518 | | virtual void SAL_CALL removeRelationshipByID( const OUString& sID ) override; |
519 | | |
520 | | virtual void SAL_CALL insertRelationships( const css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >& aEntries, sal_Bool bReplace ) override; |
521 | | |
522 | | virtual void SAL_CALL clearRelationships( ) override; |
523 | | |
524 | | // XHierarchicalStorageAccess |
525 | | virtual css::uno::Reference< css::embed::XExtendedStorageStream > SAL_CALL openStreamElementByHierarchicalName( const OUString& sStreamPath, ::sal_Int32 nOpenMode ) override; |
526 | | |
527 | | virtual css::uno::Reference< css::embed::XExtendedStorageStream > SAL_CALL openEncryptedStreamElementByHierarchicalName( const OUString& sStreamName, ::sal_Int32 nOpenMode, const OUString& sPassword ) override; |
528 | | |
529 | | virtual void SAL_CALL removeStreamElementByHierarchicalName( const OUString& sElementPath ) override; |
530 | | |
531 | | // XHierarchicalStorageAccess2 |
532 | | virtual css::uno::Reference< css::embed::XExtendedStorageStream > SAL_CALL openEncryptedStreamByHierarchicalName( const OUString& sStreamName, ::sal_Int32 nOpenMode, const css::uno::Sequence< css::beans::NamedValue >& aEncryptionData ) override; |
533 | | }; |
534 | | |
535 | | StorageHolder_Impl::StorageHolder_Impl( OStorage* pStorage ) |
536 | 77.0k | : m_pPointer( pStorage ) |
537 | 77.0k | , m_xWeakRef( css::uno::Reference< css::embed::XStorage >( pStorage ) ) |
538 | 77.0k | { |
539 | 77.0k | } |
540 | | |
541 | | #endif |
542 | | |
543 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |