xref: /AOO41X/main/offapi/com/sun/star/embed/XStorageRawAccess.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_embed_XStorageRawAccess_idl__
24#define __com_sun_star_embed_XStorageRawAccess_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_io_XStream_idl__
31#include <com/sun/star/io/XStream.idl>
32#endif
33
34#ifndef __com_sun_star_io_XInputStream_idl__
35#include <com/sun/star/io/XInputStream.idl>
36#endif
37
38#ifndef __com_sun_star_io_IOException_idl__
39#include <com/sun/star/io/IOException.idl>
40#endif
41
42#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
43#include <com/sun/star/lang/IllegalArgumentException.idl>
44#endif
45
46#ifndef __com_sun_star_embed_StorageWrappedTargetException_idl__
47#include <com/sun/star/embed/StorageWrappedTargetException.idl>
48#endif
49
50#ifndef __com_sun_star_embed_InvalidStorageException_idl__
51#include <com/sun/star/embed/InvalidStorageException.idl>
52#endif
53
54#ifndef __com_sun_star_container_NoSuchElementException_idl__
55#include <com/sun/star/container/NoSuchElementException.idl>
56#endif
57
58#ifndef __com_sun_star_container_ElementExistException_idl__
59#include <com/sun/star/container/ElementExistException.idl>
60#endif
61
62#ifndef __com_sun_star_packages_NoEncryptionException_idl__
63#include <com/sun/star/packages/NoEncryptionException.idl>
64#endif
65
66#ifndef __com_sun_star_packages_NoRawFormatException_idl__
67#include <com/sun/star/packages/NoRawFormatException.idl>
68#endif
69
70
71//============================================================================
72
73 module com {  module sun {  module star {  module embed {
74
75//============================================================================
76/** This interface represents main storage functionality.
77 */
78published interface XStorageRawAccess
79{
80    // -----------------------------------------------------------------------
81    /** allows to get a plain raw stream representing a package stream.
82
83        <p>
84        This method returns a stream from the package as it is stored there,
85        without any decompression/decription and etc. This method can be
86        helpful to check file consistency, for example by signing.
87        </p>
88
89        @returns
90            the raw representation of encrypted stream with all the data
91            required to copy the stream without information loss
92
93        @param sStreamName
94            the name of the substream that should be open
95
96        @throws ::com::sun::star::embed::InvalidStorageException
97            this storage is in invalid state for any reason
98
99        @throws ::com::sun::star::lang::IllegalArgumentException
100            one of provided arguments is illegal
101
102        @throws ::com::sun::star::container::NoSuchElementException
103            there is no element with specified name
104
105        @throws ::com::sun::star::io::IOException
106            in case of io errors during stream opening
107
108        @throws ::com::sun::star::embed::StorageWrappedTargetException
109            wraps other exceptions
110     */
111    ::com::sun::star::io::XInputStream getPlainRawStreamElement(
112            [in] string sStreamName )
113        raises( ::com::sun::star::embed::InvalidStorageException,
114                ::com::sun::star::lang::IllegalArgumentException,
115                ::com::sun::star::container::NoSuchElementException,
116                ::com::sun::star::io::IOException,
117                ::com::sun::star::embed::StorageWrappedTargetException );
118
119    // -----------------------------------------------------------------------
120    /** allows to get a raw stream representing encrypted stream with header.
121
122        <p>
123        This method allows to transport encrypted streams without decryption.
124        Mainly this method is introduced to allow to copy one encrypted
125        storage stream to another without decryption. It is not reccomended to
126        use this method outside of storage implementation since different
127        storages implementation could have different encryption format. If the
128        method is used outside of storage implementation the user code is
129        resposible to get sure that the raw format of source and target
130        storages is the same.
131        </p>
132
133        <p>
134        The difference of this method from the previous one is that it handles
135        only encrypted streams. The contents of returned by these methods
136        streams can differ for the same entry, since this method can add
137        additional data into the stream to allow successful insertion.
138        </p>
139
140        @param sStreamName
141            the name of the substream that should be open
142
143        @param xInputStream
144            a raw stream representing encrypted stream
145
146        @throws ::com::sun::star::embed::InvalidStorageException
147            this storage is in invalid state for any reason
148
149        @throws ::com::sun::star::lang::IllegalArgumentException
150            one of provided arguments is illegal
151
152        @throws ::com::sun::star::packages::NoEncryptionException
153            the stream is not an encrypted one
154
155        @throws ::com::sun::star::container::NoSuchElementException
156            there is no element with specified name
157
158        @throws ::com::sun::star::io::IOException
159            in case of io errors during stream opening
160
161        @throws ::com::sun::star::embed::StorageWrappedTargetException
162            wraps other exceptions
163     */
164    ::com::sun::star::io::XInputStream getRawEncrStreamElement(
165            [in] string sStreamName )
166        raises( ::com::sun::star::embed::InvalidStorageException,
167                ::com::sun::star::lang::IllegalArgumentException,
168                ::com::sun::star::packages::NoEncryptionException,
169                ::com::sun::star::container::NoSuchElementException,
170                ::com::sun::star::io::IOException,
171                ::com::sun::star::embed::StorageWrappedTargetException );
172
173    // -----------------------------------------------------------------------
174    /** allows to insert a raw stream representing encrypted stream with
175        header.
176
177        <p>
178        This method allows to insert a stream retrived by
179        <method>XStorageRawAccess::getRawEncrStreamElement()</method> into a
180        storage.
181        </p>
182
183        <p>
184        This method allows to transport encrypted streams without decryption.
185        Mainly this method is introduced to allow to copy one encrypted
186        storage stream to another without decryption. It is not reccomended to
187        use this method outside of storage implementation since different
188        storages implementation could have different encryption format.
189        </p>
190
191        @param sStreamName
192            the name of the substream that should be open
193
194        @param xInputStream
195            a raw stream representing encrypted stream
196
197        @throws ::com::sun::star::embed::InvalidStorageException
198            this storage is in invalid state for any reason
199
200        @throws ::com::sun::star::lang::IllegalArgumentException
201            one of provided arguments is illegal
202
203        @throws ::com::sun::star::packages::NoRawFormatException
204            the stream is not one of raw package stream format
205
206        @throws ::com::sun::star::container::ElementExistException
207            an element with specified name already exists
208
209        @throws ::com::sun::star::io::IOException
210            in case of io errors during stream opening
211
212        @throws ::com::sun::star::embed::StorageWrappedTargetException
213            wraps other exceptions
214     */
215    void insertRawEncrStreamElement(
216            [in] string sStreamName,
217            [in] ::com::sun::star::io::XInputStream xInStream )
218        raises( ::com::sun::star::embed::InvalidStorageException,
219                ::com::sun::star::lang::IllegalArgumentException,
220                ::com::sun::star::packages::NoRawFormatException,
221                ::com::sun::star::container::ElementExistException,
222                ::com::sun::star::io::IOException,
223                ::com::sun::star::embed::StorageWrappedTargetException );
224};
225
226//============================================================================
227
228}; }; }; };
229
230#endif
231
232