1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 module com
{ module sun
{ module star
{ module embed
{
24 /** This is a service that allows to get access to a package using storage
28 A root storage should be retrieved by using StorageFactory
29 service. Substorages are created through XStorage interface
33 published service Storage
35 /** This service describes the base functionality of storages.
38 Please see below the description of additional requirements for the
39 package storage implementation.
43 <dt>interface com::sun::star::lang::XComponent
47 A root storage is created by StorageFactory
48 and is controlled by refcounting. In case refcounting
49 is decreased to zero the storage will be disposed
50 automatically. It is still strongly recommended that
51 a root storage is disposed explicitly since in garbage
52 collector based languages the refcounting can be
53 decreased too late and resources locked by the storage
54 will not be freed until then.
58 A substorage is created by XStorage
59 interface of storage. Each time a substorage is opened
60 it is locked ( in case it is opened in readonly mode
61 it is locked for writing, in case it is opened in
62 read-write mode it is locked for reading and writing )
63 until it is disposed. The lifetime of substorage is
64 also controlled by refcounting but because of mentioned
65 garbage collection specific it is strongly recommended
66 to dispose substorages explicitly.
70 In case a storage object is disposed all the elements
71 ( substorages and substreams ) retrieved from the
72 object are disposed. If the storage was opened in
73 read-write mode all non-committed changes will be lost.
76 <dt>interface XStorage</dt>
79 <dt>XStorage::openStreamElement()</dt>
82 This method returns StorageStream
83 service implementation.
87 If the child stream is an encrypted one a correct
88 common storage password should be set through
89 XEncryptionProtectedSource interface to
90 this storage or to a one of storages in parent
91 hierarchy. In case the password is not set or is a
92 wrong one an exception will be thrown.
96 <dt>XStorage::openEncryptedStreamElement()</dt>
98 This method allows to specify reading password for the
99 stream explicitly. The password will be used to read
100 the stream. It is possible to specify a new password
101 for stream storing through
102 XEncryptionProtectedSource interface. In
103 case a new password is not specified an old one will
107 <dt>XStorage::openStorageElement()</dt>
109 This method returns Storage service
113 <dt>XStorage::cloneStreamElement()</dt>
116 This method returns StorageStream service
121 The latest flashed version of the stream will be used.
122 The stream can be flashed explicitly by
123 com::sun::star::io::XOutputStream::flush()
128 A storage flashes on commit all the child streams it
129 owns. So in case after the stream is changed neither
130 the storage was committed nor the stream was flushed
131 explicitly, the changes will not appear in the new
132 created stream. This method allows to retrieve copy of
133 a child stream even in case it is already opened for
138 If the child stream is an encrypted one a correct
139 common storage password should be set through
140 XEncryptionProtectedSource interface to
141 this storage or to a one of storages in parent
142 hierarchy. In case the password is not set or is a
143 wrong one an exception will be thrown.
147 <dt>XStorage::cloneEncryptedStreamElement()</dt>
150 This method returns StorageStream service
155 The latest flashed version of the stream will be used.
156 The stream can be flashed explicitly by
157 com::sun::star::io::XOutputStream::flush()
162 A storage flashes on commit all the child streams it
163 owns. So in case after the stream is changed neither
164 the storage was committed nor the stream was flushed
165 explicitly, the changes will not appear in the new
166 created stream. This method allows to retrieve copy of
167 a child stream even in case it is already opened for
172 <dt>XStorage::copyLastCommitTo()</dt>
174 This method gets Storage service
175 implementation and fills it in with the latest
176 committed version of this storage. So in case the
177 storage was not committed after it was changed, the
178 changes will not appear in the new created storage.
181 <dt>XStorage::copyStorageElementLastCommitTo()</dt>
184 This method gets Storage service
185 implementation and fills it in with the contents of
186 the requested substorage. The latest committed version
187 of child storage will be used. So in case the child
188 storage was not committed after it was changed, the
189 changes will not appear in the new created storage.
193 This method allows to retrieve copy of a child storage
194 even in case it is already opened for writing.
198 <dt>XStorage::removeStorageElement()</dt>
200 If the element is opened the removing will fail.
204 <dt>property URL</dt>
206 If the storage is created based on url this property allows
214 /** allows to commit or revert changes that were done for the storage.
217 If a storage is committed all changes made to it will be integrated to
218 its parent storage. This is recursive process, so the last committed
219 storage should be the root one. For the package based storages commit
220 of a root storage also means flashing to the related medium. If
221 a storage is not committed, no changes for it or its child elements
225 interface ::com
::sun
::star
::embed
::XTransactedObject
;
227 /** allows to track storage's transaction state.
229 interface ::com
::sun
::star
::embed
::XTransactionBroadcaster
;
231 /** allows to set password to a root storage.
234 This interface can be supported by a storage to allow to set
235 a common storage password. This password is used as default password
236 to decrypt all encrypted streams and to encrypt streams that are
237 marked to use common storage password on storing.
238 Specifying of the password for a storage allows to use it for the
239 whole subtree. Of course substorage can allow to overwrite the common
240 storage password for own subtree.
244 interface ::com
::sun
::star
::embed
::XEncryptionProtectedSource
;
246 /** allows to get and set the media type of the storage.
248 [property
] string MediaType
;
250 /** allows to get and set the version of the format related to the
253 [property
,optional] string Version;
255 /** allows to detect whether mediatype is detected by using fallback
259 Can be set to true if the mediatype can not be detected in standard
260 way, but there is a fallback solution allows to do it.
264 Usually means that the document validity is questionable, although
265 the package itself is not corrupted. The decision about document
266 validity in this case is in application hands. It is up to user of
267 the storage to decide whether he accepts the fallback approach for
268 an implementation of this service, outputs a warning or an error.
271 [property
, readonly] boolean MediaTypeFallbackIsUsed
;
273 /** allows to detect whether the storage is a root one.
275 [property
, readonly] boolean IsRoot
;
277 /** allows to detect whether storage is open in "repair package" mode or
280 [property
, optional, readonly] boolean RepairPackage
;
282 /** allows to detect if the storage contains encrypted entries.
285 In case it is set to `TRUE` the storage itself and/or a tree of
286 substorages contain encrypted streams. Usually in case this property
287 is supported the implementation supports
288 XEncryptionProtectedSource interface.
291 [property
, optional, readonly] boolean HasEncryptedEntries
;
293 /** allows to detect if the storage contains non-encrypted entries.
296 In case it is set to `TRUE` the storage itself and/or a tree of
297 substorages contains non-encrypted streams. Usually in case this
298 property is supported the implementation supports
299 XEncryptionProtectedSource interface.
302 [property
, optional, readonly] boolean HasNonEncryptedEntries
;
308 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */