merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / embed / XEmbedPersist.idl
blob73f807188ba67949109c54c9163cd406df6a4ed0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_embed_XEmbedPersist_idl__
28 #define __com_sun_star_embed_XEmbedPersist_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include <com/sun/star/uno/XInterface.idl>
32 #endif
34 #ifndef __com_sun_star_embed_XStorage_idl__
35 #include <com/sun/star/embed/XStorage.idl>
36 #endif
38 #ifndef __com_sun_star_embed_XCommonEmbedPersist_idl__
39 #include <com/sun/star/embed/XCommonEmbedPersist.idl>
40 #endif
42 #ifndef __com_sun_star_io_IOException_idl__
43 #include <com/sun/star/io/IOException.idl>
44 #endif
46 #ifndef __com_sun_star_embed_WrongStateException_idl__
47 #include <com/sun/star/embed/WrongStateException.idl>
48 #endif
50 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
51 #include <com/sun/star/lang/IllegalArgumentException.idl>
52 #endif
54 #ifndef __com_sun_star_beans_PropertyValue_idl__
55 #include <com/sun/star/beans/PropertyValue.idl>
56 #endif
58 //============================================================================
60 module com { module sun { module star { module embed {
62 //============================================================================
63 /** specifies an implementation for embedded object persistence.
64 <p>
65 The idea is that any usable embedded object should be initialized
66 with an entry in the parent storage that will be used as persistent
67 representation.
68 </p>
70 published interface XEmbedPersist: XCommonEmbedPersist
72 //------------------------------------------------------------------------
73 /** provides object with a parent storage and a name for object's entry.
75 <p>
76 An entry with the specified name should be created/opened inside
77 provided storage. It can be a storage or a stream. For example,
78 OOo API will refer to ole storages only by streams, but the object
79 implementation will use storage based on this stream.
80 </p>
82 <p>
83 Factory does this call to initialize the embedded object.
84 The linked object can be initialized by factory in different way
85 ( internally ).
86 </p>
88 <p>
89 It is also possible to switch object persistent representation through
90 this call. Actually this is the way, this call can be used by user
91 ( since initialization is done by factory ).
92 </p>
94 @param xStorage
95 a parent storage the entry should be created in
97 @param sEntName
98 a name for the entry
100 @param nEntryConnectionMode
101 a mode in which the object should be initialized from entry
102 can take values from EntryInitModes constant set
104 @param aMediaArgs
105 optional parameters for the embedded document persistence
106 initialization, see also
107 <type scope="com::sun::star::document">MediaDescriptor</type>
109 @param aObjectArgs
110 optional parameters for the object persistence initialization,
111 see also
112 <type scope="com::sun::star::embed">EmbeddedObjectDescriptor</type>
114 @thrown ::com::sun::star::lang::IllegalArgumentException
115 one of arguments is illegal
117 @throws com::sun::star::embed::WrongStateException
118 the object is in wrong state
120 @throws com::sun::star::io::IOException
121 in case of io problems during opening\creation
123 @throws com::sun::star::uno::Exception
124 in case of other problems
126 void setPersistentEntry(
127 [in] ::com::sun::star::embed::XStorage xStorage,
128 [in] string sEntName,
129 [in] long nEntryConnectionMode,
130 [in] sequence< ::com::sun::star::beans::PropertyValue > aMediaArgs,
131 [in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
132 raises( ::com::sun::star::lang::IllegalArgumentException,
133 ::com::sun::star::embed::WrongStateException,
134 ::com::sun::star::io::IOException,
135 ::com::sun::star::uno::Exception );
137 //------------------------------------------------------------------------
138 /** lets the object store itself to an entry in destination storage,
139 the own persistence entry is not changed.
141 @param xStorage
142 a parent storage the entry should be created inside
144 @param sEntName
145 a name for the entry
147 @param aMediaArgs
148 optional parameters for document saving, see also
149 <type scope="com::sun::star::document">MediaDescriptor</type>
151 @param aObjectArgs
152 optional parameters for the object saving, see also
153 <type scope="com::sun::star::embed">EmbeddedObjectDescriptor</type>
155 @thrown ::com::sun::star::lang::IllegalArgumentException
156 one of arguments is illegal
158 @throws com::sun::star::embed::WrongStateException
159 the object is in wrong state
161 @throws com::sun::star::io::IOException
162 in case of io problems during storing
164 @throws com::sun::star::uno::Exception
165 in case of other problems
167 void storeToEntry(
168 [in] ::com::sun::star::embed::XStorage xStorage,
169 [in] string sEntName,
170 [in] sequence< ::com::sun::star::beans::PropertyValue > aMediaArgs,
171 [in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
172 raises( ::com::sun::star::lang::IllegalArgumentException,
173 ::com::sun::star::embed::WrongStateException,
174 ::com::sun::star::io::IOException,
175 ::com::sun::star::uno::Exception );
177 //------------------------------------------------------------------------
178 /** lets the object store itself to an entry in destination storage and
179 prepare to use the new entry for own persistence.
182 The object should be stored to the new entry, after that the entry
183 should be remembered by the object. After the storing process is
184 finished the <method>XEmbedPersist::saveCompleted</method> method
185 can be used to specify whether the object should use the new entry or
186 the old one. The object persistence can not be used until
187 <method>XEmbedPersist::saveCompleted</method> is called.
188 So this state can be treated as "HandsOff" state.
191 @param xStorage
192 a parent storage the entry should be created in
194 @param sEntName
195 a name for the entry
197 @param aMediaArgs
198 optional parameters for document saving, see also
199 <type scope="com::sun::star::document">MediaDescriptor</type>
201 @param aObjectArgs
202 optional parameters for the object saving, see also
203 <type scope="com::sun::star::embed">EmbeddedObjectDescriptor</type>
205 @thrown ::com::sun::star::lang::IllegalArgumentException
206 one of arguments is illegal
208 @throws com::sun::star::embed::WrongStateException
209 the object is in wrong state
211 @throws com::sun::star::io::IOException
212 in case of io problems during storing
214 @throws com::sun::star::uno::Exception
215 in case of other problems
217 void storeAsEntry(
218 [in] ::com::sun::star::embed::XStorage xStorage,
219 [in] string sEntName,
220 [in] sequence< ::com::sun::star::beans::PropertyValue > aMediaArgs,
221 [in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
222 raises( ::com::sun::star::lang::IllegalArgumentException,
223 ::com::sun::star::embed::WrongStateException,
224 ::com::sun::star::io::IOException,
225 ::com::sun::star::uno::Exception );
228 //------------------------------------------------------------------------
229 /** specifies whether the object should use an old storage or a new one
230 after "save as" operation.
232 @param bUseNew
233 <TRUE/> the new storage should be used
234 <FALSE/> the old one
236 @throws com::sun::star::embed::WrongStateException
237 the object is in wrong state
239 @throws com::sun::star::uno::Exception
240 in case of other problems
243 void saveCompleted( [in] boolean bUseNew )
244 raises( ::com::sun::star::embed::WrongStateException,
245 ::com::sun::star::uno::Exception );
247 //------------------------------------------------------------------------
248 /** allows to detect if the object has entry.
250 @returns
251 <TRUE/> if the object has own entry set
252 <FALSE/> otherwise
254 boolean hasEntry()
255 raises( ::com::sun::star::embed::WrongStateException );
257 //------------------------------------------------------------------------
258 /** allows to retrieve the current object entry name.
260 @returns
261 the object entry name if any
263 @throws com::sun::star::embed::WrongStateException
264 the object is in wrong state ( has no entry )
266 string getEntryName()
267 raises( ::com::sun::star::embed::WrongStateException );
270 //============================================================================
272 }; }; }; };
274 #endif