1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XOptimizedStorage.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_embed_XOptimizedStorage_idl__
31 #define __com_sun_star_embed_XOptimizedStorage_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_io_XStream_idl__
38 #include
<com
/sun
/star
/io
/XStream.idl
>
41 #ifndef __com_sun_star_io_XInputStream_idl__
42 #include
<com
/sun
/star
/io
/XInputStream.idl
>
45 #ifndef __com_sun_star_io_IOException_idl__
46 #include
<com
/sun
/star
/io
/IOException.idl
>
49 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
50 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
53 #ifndef __com_sun_star_embed_StorageWrappedTargetException_idl__
54 #include
<com
/sun
/star
/embed
/StorageWrappedTargetException.idl
>
57 #ifndef __com_sun_star_embed_InvalidStorageException_idl__
58 #include
<com
/sun
/star
/embed
/InvalidStorageException.idl
>
61 #ifndef __com_sun_star_container_NoSuchElementException_idl__
62 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
65 #ifndef __com_sun_star_container_ElementExistException_idl__
66 #include
<com
/sun
/star
/container
/ElementExistException.idl
>
69 #ifndef __com_sun_star_packages_EncryptionNotAllowedException_idl__
70 #include
<com
/sun
/star
/packages
/EncryptionNotAllowedException.idl
>
73 #ifndef __com_sun_star_packages_NoRawFormatException_idl__
74 #include
<com
/sun
/star
/packages
/NoRawFormatException.idl
>
77 #ifndef __com_sun_star_packages_WrongPasswordException_idl__
78 #include
<com
/sun
/star
/packages
/WrongPasswordException.idl
>
81 #ifndef __com_sun_star_beans_PropertyValue_idl__
82 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
85 #ifndef __com_sun_star_beans_UnknownPropertyException_idl__
86 #include
<com
/sun
/star
/beans
/UnknownPropertyException.idl
>
89 #ifndef __com_sun_star_beans_PropertyVetoException_idl__
90 #include
<com
/sun
/star
/beans
/PropertyVetoException.idl
>
93 //============================================================================
95 module com
{ module sun
{ module star
{ module embed
{
97 //============================================================================
98 /** This is a temporary interface that is introduced to temporarily optimize
99 the document storing process. PLEASE DO NOT USE IT, it might change in any
100 time and will be depricated soon!
101 Another solution will be introduced as final one.
103 interface XOptimizedStorage
105 // -----------------------------------------------------------------------
106 /** allows to insert a raw stream representing nonencrypted stream with
109 void insertRawNonEncrStreamElementDirect
(
110 [in] string sStreamName
,
111 [in] ::com
::sun
::star
::io
::XInputStream xInStream
)
112 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
113 ::com
::sun
::star
::lang
::IllegalArgumentException
,
114 ::com
::sun
::star
::packages
::NoRawFormatException
,
115 ::com
::sun
::star
::container
::ElementExistException
,
116 ::com
::sun
::star
::io
::IOException
,
117 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
119 // -----------------------------------------------------------------------
120 /** allows to insert a stream to the storage directly. The stream must
121 stay alive till the storage is commited.
123 void insertStreamElementDirect
(
124 [in] string sStreamName
,
125 [in] ::com
::sun
::star
::io
::XInputStream xInStream
,
126 [in] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> aProperties
)
127 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
128 ::com
::sun
::star
::lang
::IllegalArgumentException
,
129 ::com
::sun
::star
::container
::ElementExistException
,
130 ::com
::sun
::star
::io
::IOException
,
131 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
133 // -----------------------------------------------------------------------
134 /** allows to copy storage element directly, not guarantied to work.
136 void copyElementDirectlyTo
(
137 [in] string sSourceName
,
138 [in] ::com
::sun
::star
::embed
::XOptimizedStorage xTargetStorage
,
139 [in] string sTargetName
)
140 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
141 ::com
::sun
::star
::lang
::IllegalArgumentException
,
142 ::com
::sun
::star
::container
::NoSuchElementException
,
143 ::com
::sun
::star
::container
::ElementExistException
,
144 ::com
::sun
::star
::io
::IOException
,
145 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
147 // -----------------------------------------------------------------------
148 /** allows to switch storage persistence to the provided stream. The stream
149 will be filled by the storage. If an empty reference is provided, the
150 storage will create a temporary stream to switch to itself.
151 It is applicable only for root storages.
153 void writeAndAttachToStream
(
154 [in] ::com
::sun
::star
::io
::XStream xStream
)
155 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
156 ::com
::sun
::star
::lang
::IllegalArgumentException
,
157 ::com
::sun
::star
::io
::IOException
,
158 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
160 // -----------------------------------------------------------------------
161 /** allows to switch storage persistence to the provided URL. The caller is
162 responsible to be sure that the file referenced by the URL contains the
163 same contents as the stream the storage is based currently. Thus using
164 of this method is very dangerous and should be avoided when possible.
165 It is applicable only for root storages.
167 void attachToURL
( [in] string sURL
,
168 [in] boolean bReadOnly
)
169 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
170 ::com
::sun
::star
::lang
::IllegalArgumentException
,
171 ::com
::sun
::star
::io
::IOException
,
172 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
174 // -----------------------------------------------------------------------
175 /** allows to get property of the child element with the specified name.
176 The implementation of the method might allow to access only subset
177 of the supported by element properties.
179 any getElementPropertyValue
( [in] string sElementName
,
180 [in] string sPropertyName
)
181 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
182 ::com
::sun
::star
::lang
::IllegalArgumentException
,
183 ::com
::sun
::star
::container
::NoSuchElementException
,
184 ::com
::sun
::star
::io
::IOException
,
185 ::com
::sun
::star
::beans
::UnknownPropertyException
,
186 ::com
::sun
::star
::beans
::PropertyVetoException
,
187 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
189 // -----------------------------------------------------------------------
190 /** fills the provided stream with the last flushed version of data from
191 the child stream of the storage.
194 the name of the substream that should be copied
197 the target stream where the data must be copied to
199 @throws ::com::sun::star::embed::InvalidStorageException
200 this storage is in invalid state for any reason
202 @throws ::com::sun::star::lang::IllegalArgumentException
203 one of provided arguments is illegal
205 @throws ::com::sun::star::packages::WrongPasswordException
206 the provided password is wrong
208 @throws ::com::sun::star::io::IOException
209 in case of io errors during stream opening
211 @throws ::com::sun::star::embed::StorageWrappedTargetException
212 wraps other exceptions
214 void copyStreamElementData
( [in] string sStreamName
,
215 [in] ::com
::sun
::star
::io
::XStream xTargetStream
)
216 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
217 ::com
::sun
::star
::lang
::IllegalArgumentException
,
218 ::com
::sun
::star
::packages
::WrongPasswordException
,
219 ::com
::sun
::star
::io
::IOException
,
220 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
224 //============================================================================