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_packages_XDataSinkEncrSupport_idl__
28#define __com_sun_star_packages_XDataSinkEncrSupport_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_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_packages_WrongPasswordException_idl__
43#include <com/sun/star/packages/WrongPasswordException.idl>
44#endif
45
46#ifndef __com_sun_star_packages_NoEncryptionException_idl__
47#include <com/sun/star/packages/NoEncryptionException.idl>
48#endif
49
50#ifndef __com_sun_star_packages_EncryptionNotAllowedException_idl__
51#include <com/sun/star/packages/EncryptionNotAllowedException.idl>
52#endif
53
54#ifndef __com_sun_star_packages_NoRawFormatException_idl__
55#include <com/sun/star/packages/NoRawFormatException.idl>
56#endif
57
58
59//=============================================================================
60
61module com {  module sun {  module star {  module packages {
62
63//=============================================================================
64
65/** Allows to get access to the stream of a <type>PackageStream</type>.
66 */
67interface XDataSinkEncrSupport: com::sun::star::uno::XInterface
68{
69	//-------------------------------------------------------------------------
70	/** Allows to get access to the data of the PackageStream.
71	<p>
72		In case stream is encrypted one and the key for the stream is not set,
73	an exception must be thrown.
74	</p>
75
76	@returns
77		the stream
78
79	@throws ::com::sun::star::packages::WrongPasswordException
80		no key or a wrong one is set
81
82	@throws ::com::sun::star::io::IOException
83		in case of io problems during retrieving
84	 */
85	::com::sun::star::io::XInputStream getDataStream()
86		raises( ::com::sun::star::packages::WrongPasswordException,
87				::com::sun::star::io::IOException );
88
89
90	//-------------------------------------------------------------------------
91	/** Allows to get access to the data of the PackageStream as to raw stream.
92	In case stream is not encrypted an exception will be thrown.
93	<p>
94		The difference of raw stream is that it contains header for encrypted data,
95	so an encrypted stream can be copyed from one PackageStream to
96	another one without decryption.
97	</p>
98
99	@returns
100		the raw representation of stream
101
102	@throws ::com::sun::star::packages::NoEncryptionException
103		the PackageStream object is not encrypted
104
105	@throws ::com::sun::star::io::IOException
106		in case of io problems during retrieving
107	 */
108	::com::sun::star::io::XInputStream getRawStream()
109		raises( ::com::sun::star::packages::NoEncryptionException,
110				::com::sun::star::io::IOException );
111
112	//-------------------------------------------------------------------------
113	/** Allows to set a data stream for the PackageStream.
114	<p>
115		In case PackageStream is marked as encrypted the data stream will be encrypted on storing.
116	</p>
117
118	@param aStream
119		new data stream
120
121	@throws ::com::sun::star::io::IOException
122		in case of io problems
123	 */
124	void setDataStream( [in] ::com::sun::star::io::XInputStream aStream )
125		raises( ::com::sun::star::io::IOException );
126
127	//-------------------------------------------------------------------------
128	/** Allows to set raw stream for the PackageStream.
129	The PackageStream object can not be marked as encrypted one,
130	an exception will be thrown in such case.
131
132	@param aStream
133		the new raw representation of stream
134
135	@throws ::com::sun::star::packages::EncryptionNotAllowedException
136		the PackageStream object is marked as encrypted
137
138	@throws ::com::sun::star::packages::NoRawFormatException
139		the stream is not a correct raw representation of encrypted package stream
140
141	@throws ::com::sun::star::io::IOException
142		in case of io problems during retrieving
143	 */
144	void setRawStream( [in] ::com::sun::star::io::XInputStream aStream )
145		raises( ::com::sun::star::packages::EncryptionNotAllowedException,
146				::com::sun::star::packages::NoRawFormatException,
147				::com::sun::star::io::IOException );
148
149	//-------------------------------------------------------------------------
150	/** Allows to get access to the raw data of the stream as it is stored in
151		the package.
152
153	@returns
154		the plain raw stream as it is stored in the package
155
156	@throws ::com::sun::star::io::IOException
157		in case of io problems during retrieving
158	 */
159	::com::sun::star::io::XInputStream getPlainRawStream()
160		raises( ::com::sun::star::io::IOException );
161
162};
163
164//=============================================================================
165
166}; }; }; };
167
168/*=============================================================================
169
170=============================================================================*/
171#endif
172