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