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_XStorage2_idl__
24#define __com_sun_star_embed_XStorage2_idl__
25
26#ifndef __com_sun_star_embed_XStorage_idl__
27#include <com/sun/star/embed/XStorage.idl>
28#endif
29
30#ifndef __com_sun_star_beans_NamedValue_idl__
31#include <com/sun/star/beans/NamedValue.idl>
32#endif
33
34
35//============================================================================
36
37 module com {  module sun {  module star {  module embed {
38
39//============================================================================
40/** This interface extends the base XStorage interface.
41 */
42interface XStorage2 : XStorage
43{
44	// -----------------------------------------------------------------------
45	/** allows to get access to a child encrypted stream with EncryptionData.
46
47		<p>
48		If storage does not allow any encryption this method will always throw
49		<type scope="com::sun::star::packages">NoEncryptionException</type>.
50		</p>
51
52		<p>
53		In case the stream is open in readonly mode the
54		<method scope="com::sun::star::io">XStream::getOutputStream</method>
55		method will return an empty reference.
56		</p>
57
58		@param sStreamName
59			the name of the substream that should be open
60
61		@param nOpenMode
62			a mode the stream should be open in,
63			can be a combination of <type>ElementModes</type> values
64
65		@param aEncryptionData
66			this parameter allowes to specify an encryption data to decrypt the
67			stream, the encryption data must be correct, otherwise an
68			exception will be thrown
69
70		@throws ::com::sun::star::embed::InvalidStorageException
71			this storage is in invalid state for any reason
72
73		@throws ::com::sun::star::lang::IllegalArgumentException
74			one of provided arguments is illegal
75
76		@throws ::com::sun::star::packages::NoEncryptionException
77			the stream is not encrypted
78
79		@throws ::com::sun::star::packages::WrongPasswordException
80			the provided encryption data is wrong
81
82		@throws ::com::sun::star::io::IOException
83			in case of io errors during stream opening
84
85		@throws ::com::sun::star::embed::StorageWrappedTargetException
86			wraps other exceptions
87	 */
88    ::com::sun::star::io::XStream  openEncryptedStream(
89			[in] string sStreamName,
90			[in] long nOpenMode,
91			[in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData )
92		raises( ::com::sun::star::embed::InvalidStorageException,
93				::com::sun::star::lang::IllegalArgumentException,
94				::com::sun::star::packages::NoEncryptionException,
95				::com::sun::star::packages::WrongPasswordException,
96				::com::sun::star::io::IOException,
97				::com::sun::star::embed::StorageWrappedTargetException );
98
99	// -----------------------------------------------------------------------
100	/** allows to get readonly copy of a child encrypted stream with encryption
101        data.
102
103		<p>
104		If storage does not allow any encryption this method will always throw
105		<type scope="com::sun::star::packages">NoEncryptionException</type>.
106		</p>
107
108		<p>
109		The stream is open in readonly mode so the
110		<method scope="com::sun::star::io">XStream::getOutputStream</method>
111		method will return an empty reference.
112		</p>
113
114		<p>
115		This method allows to specify encryption data for the child stream
116		explicitly.
117		</p>
118
119		@param sStreamName
120			the name of the substream that should be copied
121
122		@param aEncryptionData
123			this parameter allowes to specify an encryption data for the
124			stream, the encryption data must be correct, otherwise an
125			exception will be thrown
126
127		@throws ::com::sun::star::embed::InvalidStorageException
128			this storage is in invalid state for any reason
129
130		@throws ::com::sun::star::lang::IllegalArgumentException
131			one of provided arguments is illegal
132
133		@throws ::com::sun::star::packages::NoEncryptionException
134			the stream is not encrypted
135
136		@throws ::com::sun::star::packages::WrongPasswordException
137			the provided encryption data is wrong
138
139		@throws ::com::sun::star::io::IOException
140			in case of io errors during stream opening
141
142		@throws ::com::sun::star::embed::StorageWrappedTargetException
143			wraps other exceptions
144	 */
145    ::com::sun::star::io::XStream cloneEncryptedStream(
146			[in] string sStreamName,
147			[in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData )
148		raises( ::com::sun::star::embed::InvalidStorageException,
149				::com::sun::star::lang::IllegalArgumentException,
150				::com::sun::star::packages::NoEncryptionException,
151				::com::sun::star::packages::WrongPasswordException,
152				::com::sun::star::io::IOException,
153				::com::sun::star::embed::StorageWrappedTargetException );
154};
155
156//============================================================================
157
158}; }; }; };
159
160#endif
161
162