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