xref: /AOO41X/main/offapi/com/sun/star/embed/XHierarchicalStorageAccess.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
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_XHierarchicalStorageAccess_idl__
24#define __com_sun_star_embed_XHierarchicalStorageAccess_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_io_XStream_idl__
31#include <com/sun/star/io/XStream.idl>
32#endif
33
34#ifndef __com_sun_star_embed_XExtendedStorageStream_idl__
35#include <com/sun/star/embed/XExtendedStorageStream.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_lang_IllegalArgumentException_idl__
43#include <com/sun/star/lang/IllegalArgumentException.idl>
44#endif
45
46#ifndef __com_sun_star_embed_StorageWrappedTargetException_idl__
47#include <com/sun/star/embed/StorageWrappedTargetException.idl>
48#endif
49
50#ifndef __com_sun_star_embed_InvalidStorageException_idl__
51#include <com/sun/star/embed/InvalidStorageException.idl>
52#endif
53
54#ifndef __com_sun_star_packages_WrongPasswordException_idl__
55#include <com/sun/star/packages/WrongPasswordException.idl>
56#endif
57
58#ifndef __com_sun_star_container_XNameAccess_idl__
59#include <com/sun/star/container/XNameAccess.idl>
60#endif
61
62#ifndef __com_sun_star_container_NoSuchElementException_idl__
63#include <com/sun/star/container/NoSuchElementException.idl>
64#endif
65
66#ifndef __com_sun_star_container_ElementExistException_idl__
67#include <com/sun/star/container/ElementExistException.idl>
68#endif
69
70#ifndef __com_sun_star_packages_NoEncryptionException_idl__
71#include <com/sun/star/packages/NoEncryptionException.idl>
72#endif
73
74
75//============================================================================
76
77 module com {  module sun {  module star {  module embed {
78
79//============================================================================
80/** This interface allows hierarchical access to storage tree.
81
82    <p>
83    Currently only streams can be opened using this interface.
84    </p>
85
86    <p>
87    The hierarchical access can not be mixed with a normal access. Thus when
88    in a storage a stream with a path "a/b/c" is accessed using hierarchical
89    access, another stream "a/b/d" can also be opened with hierarchical
90    access ( if it is still not opened ), but the substorage "a" can not be
91    opened ( it is locked by hierarchical access ).
92    </p>
93 */
94published interface XHierarchicalStorageAccess
95{
96    // METHODS
97    //
98    // -----------------------------------------------------------------------
99    /** allows to get access to a child stream of the storage, using
100        hierarchical path.
101
102        <p>
103        In case the stream is open in readonly mode the
104        <method scope="com::sun::star::io">XStream::getOutputStream</method>
105        method will return an empty reference.
106        </p>
107
108        @param sStreamPath
109            the path to the substream that should be open
110
111        @param nOpenMode
112            a mode the stream should be open in,
113            can be a combination of <type>ElementModes</type> values
114
115        @throws ::com::sun::star::embed::InvalidStorageException
116            this storage is in invalid state for any reason
117
118        @throws ::com::sun::star::lang::IllegalArgumentException
119            one of provided arguments is illegal
120
121        @throws ::com::sun::star::packages::WrongPasswordException
122            the provided password is wrong
123
124        @throws ::com::sun::star::io::IOException
125            in case of io errors during stream opening
126
127        @throws ::com::sun::star::embed::StorageWrappedTargetException
128            wraps other exceptions
129     */
130    XExtendedStorageStream  openStreamElementByHierarchicalName(
131            [in] string sStreamPath,
132            [in] long nOpenMode )
133        raises( ::com::sun::star::embed::InvalidStorageException,
134                ::com::sun::star::lang::IllegalArgumentException,
135                ::com::sun::star::packages::WrongPasswordException,
136                ::com::sun::star::io::IOException,
137                ::com::sun::star::embed::StorageWrappedTargetException );
138
139    // -----------------------------------------------------------------------
140    /** allows to get access to a child encrypted stream with password using
141        hierarchical path.
142
143        <p>
144        If storage does not allow any encryption this method will always throw
145        <type scope="com::sun::star::packages">NoEncryptionException</type>.
146        </p>
147
148        <p>
149        In case the stream is open in readonly mode the
150        <method scope="com::sun::star::io">XStream::getOutputStream</method>
151        method will return an empty reference.
152        </p>
153
154        @param sStreamPath
155            the path to the substream that should be open
156
157        @param nOpenMode
158            a mode the stream should be open in,
159            can be a combination of <type>ElementModes</type> values
160
161        @param sPassword
162            this parameter allowes to specify a reading password for the
163            stream, the password must be a correct one, otherwise an
164            exception will be thrown
165
166        @throws ::com::sun::star::embed::InvalidStorageException
167            this storage is in invalid state for any reason
168
169        @throws ::com::sun::star::lang::IllegalArgumentException
170            one of provided arguments is illegal
171
172        @throws ::com::sun::star::packages::NoEncryptionException
173            the stream is not encrypted
174
175        @throws ::com::sun::star::packages::WrongPasswordException
176            the provided password is wrong
177
178        @throws ::com::sun::star::io::IOException
179            in case of io errors during stream opening
180
181        @throws ::com::sun::star::embed::StorageWrappedTargetException
182            wraps other exceptions
183     */
184    XExtendedStorageStream  openEncryptedStreamElementByHierarchicalName(
185            [in] string sStreamName,
186            [in] long nOpenMode,
187            [in] string sPassword )
188        raises( ::com::sun::star::embed::InvalidStorageException,
189                ::com::sun::star::lang::IllegalArgumentException,
190                ::com::sun::star::packages::NoEncryptionException,
191                ::com::sun::star::packages::WrongPasswordException,
192                ::com::sun::star::io::IOException,
193                ::com::sun::star::embed::StorageWrappedTargetException );
194
195    // -----------------------------------------------------------------------
196    /** removes a stream specified by hierarchical name from a storage.
197
198        @param sElementPath
199            the path to the element to remove
200
201        @throws ::com::sun::star::embed::InvalidStorageException
202            this storage is in invalid state for eny reason
203
204        @throws ::com::sun::star::lang::IllegalArgumentException
205            an illegal argument is provided
206
207        @throws ::com::sun::star::container::NoSuchElementException
208            there is no element with such name
209
210        @throws ::com::sun::star::io::IOException
211            in case of io errors during removing
212
213        @throws ::com::sun::star::embed::StorageWrappedTargetException
214            wraps other exceptions
215
216     */
217    void removeStreamElementByHierarchicalName( [in] string sElementPath )
218        raises( ::com::sun::star::embed::InvalidStorageException,
219                ::com::sun::star::lang::IllegalArgumentException,
220                ::com::sun::star::container::NoSuchElementException,
221                ::com::sun::star::io::IOException,
222                ::com::sun::star::embed::StorageWrappedTargetException );
223
224};
225
226//============================================================================
227
228}; }; }; };
229
230#endif
231
232