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