1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_embed_XEmbedPersist_idl__
28*cdf0e10cSrcweir#define __com_sun_star_embed_XEmbedPersist_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_embed_XStorage_idl__
35*cdf0e10cSrcweir#include <com/sun/star/embed/XStorage.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_embed_XCommonEmbedPersist_idl__
39*cdf0e10cSrcweir#include <com/sun/star/embed/XCommonEmbedPersist.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_io_IOException_idl__
43*cdf0e10cSrcweir#include <com/sun/star/io/IOException.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir#ifndef __com_sun_star_embed_WrongStateException_idl__
47*cdf0e10cSrcweir#include <com/sun/star/embed/WrongStateException.idl>
48*cdf0e10cSrcweir#endif
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
51*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
52*cdf0e10cSrcweir#endif
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__
55*cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl>
56*cdf0e10cSrcweir#endif
57*cdf0e10cSrcweir
58*cdf0e10cSrcweir//============================================================================
59*cdf0e10cSrcweir
60*cdf0e10cSrcweir module com {  module sun {  module star {  module embed {
61*cdf0e10cSrcweir
62*cdf0e10cSrcweir//============================================================================
63*cdf0e10cSrcweir/** specifies an implementation for embedded object persistence.
64*cdf0e10cSrcweir	<p>
65*cdf0e10cSrcweir	The idea is that any usable embedded object should be initialized
66*cdf0e10cSrcweir	with an entry in the parent storage that will be used as persistent
67*cdf0e10cSrcweir	representation.
68*cdf0e10cSrcweir	</p>
69*cdf0e10cSrcweir */
70*cdf0e10cSrcweirpublished interface XEmbedPersist: XCommonEmbedPersist
71*cdf0e10cSrcweir{
72*cdf0e10cSrcweir	//------------------------------------------------------------------------
73*cdf0e10cSrcweir    /** provides object with a parent storage and a name for object's entry.
74*cdf0e10cSrcweir
75*cdf0e10cSrcweir		<p>
76*cdf0e10cSrcweir		An entry with the specified name should be created/opened inside
77*cdf0e10cSrcweir		provided storage. It can be a storage or a stream. For example,
78*cdf0e10cSrcweir		OOo API will refer to ole storages only by streams, but the object
79*cdf0e10cSrcweir		implementation will use storage based on this stream.
80*cdf0e10cSrcweir		</p>
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir		<p>
83*cdf0e10cSrcweir		Factory does this call to initialize the embedded object.
84*cdf0e10cSrcweir		The linked object can be initialized by factory in different way
85*cdf0e10cSrcweir		( internally ).
86*cdf0e10cSrcweir		</p>
87*cdf0e10cSrcweir
88*cdf0e10cSrcweir		<p>
89*cdf0e10cSrcweir		It is also possible to switch object persistent representation through
90*cdf0e10cSrcweir		this call. Actually this is the way, this call can be used by user
91*cdf0e10cSrcweir		( since initialization is done by factory ).
92*cdf0e10cSrcweir		</p>
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir		@param xStorage
95*cdf0e10cSrcweir			a parent storage the entry should be created in
96*cdf0e10cSrcweir
97*cdf0e10cSrcweir		@param sEntName
98*cdf0e10cSrcweir			a name for the entry
99*cdf0e10cSrcweir
100*cdf0e10cSrcweir		@param nEntryConnectionMode
101*cdf0e10cSrcweir			a mode in which the object should be initialized from entry
102*cdf0e10cSrcweir			can take values from EntryInitModes constant set
103*cdf0e10cSrcweir
104*cdf0e10cSrcweir        @param aMediaArgs
105*cdf0e10cSrcweir            optional parameters for the embedded document persistence
106*cdf0e10cSrcweir			initialization, see also
107*cdf0e10cSrcweir			<type scope="com::sun::star::document">MediaDescriptor</type>
108*cdf0e10cSrcweir
109*cdf0e10cSrcweir        @param aObjectArgs
110*cdf0e10cSrcweir            optional parameters for the object persistence initialization,
111*cdf0e10cSrcweir            see also
112*cdf0e10cSrcweir			<type scope="com::sun::star::embed">EmbeddedObjectDescriptor</type>
113*cdf0e10cSrcweir
114*cdf0e10cSrcweir		@thrown ::com::sun::star::lang::IllegalArgumentException
115*cdf0e10cSrcweir			one of arguments is illegal
116*cdf0e10cSrcweir
117*cdf0e10cSrcweir        @throws com::sun::star::embed::WrongStateException
118*cdf0e10cSrcweir			the object is in wrong state
119*cdf0e10cSrcweir
120*cdf0e10cSrcweir        @throws com::sun::star::io::IOException
121*cdf0e10cSrcweir			in case of io problems during opening\creation
122*cdf0e10cSrcweir
123*cdf0e10cSrcweir        @throws com::sun::star::uno::Exception
124*cdf0e10cSrcweir			in case of other problems
125*cdf0e10cSrcweir	 */
126*cdf0e10cSrcweir	void setPersistentEntry(
127*cdf0e10cSrcweir			[in] ::com::sun::star::embed::XStorage xStorage,
128*cdf0e10cSrcweir			[in] string sEntName,
129*cdf0e10cSrcweir			[in] long nEntryConnectionMode,
130*cdf0e10cSrcweir			[in] sequence< ::com::sun::star::beans::PropertyValue > aMediaArgs,
131*cdf0e10cSrcweir			[in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
132*cdf0e10cSrcweir		raises( ::com::sun::star::lang::IllegalArgumentException,
133*cdf0e10cSrcweir				::com::sun::star::embed::WrongStateException,
134*cdf0e10cSrcweir				::com::sun::star::io::IOException,
135*cdf0e10cSrcweir				::com::sun::star::uno::Exception );
136*cdf0e10cSrcweir
137*cdf0e10cSrcweir	//------------------------------------------------------------------------
138*cdf0e10cSrcweir    /** lets the object store itself to an entry in destination storage,
139*cdf0e10cSrcweir		the own persistence entry is not changed.
140*cdf0e10cSrcweir
141*cdf0e10cSrcweir		@param xStorage
142*cdf0e10cSrcweir			a parent storage the entry should be created inside
143*cdf0e10cSrcweir
144*cdf0e10cSrcweir		@param sEntName
145*cdf0e10cSrcweir			a name for the entry
146*cdf0e10cSrcweir
147*cdf0e10cSrcweir        @param aMediaArgs
148*cdf0e10cSrcweir            optional parameters for document saving, see also
149*cdf0e10cSrcweir			<type scope="com::sun::star::document">MediaDescriptor</type>
150*cdf0e10cSrcweir
151*cdf0e10cSrcweir        @param aObjectArgs
152*cdf0e10cSrcweir            optional parameters for the object saving, see also
153*cdf0e10cSrcweir			<type scope="com::sun::star::embed">EmbeddedObjectDescriptor</type>
154*cdf0e10cSrcweir
155*cdf0e10cSrcweir		@thrown ::com::sun::star::lang::IllegalArgumentException
156*cdf0e10cSrcweir			one of arguments is illegal
157*cdf0e10cSrcweir
158*cdf0e10cSrcweir        @throws com::sun::star::embed::WrongStateException
159*cdf0e10cSrcweir			the object is in wrong state
160*cdf0e10cSrcweir
161*cdf0e10cSrcweir        @throws com::sun::star::io::IOException
162*cdf0e10cSrcweir			in case of io problems during storing
163*cdf0e10cSrcweir
164*cdf0e10cSrcweir        @throws com::sun::star::uno::Exception
165*cdf0e10cSrcweir			in case of other problems
166*cdf0e10cSrcweir	 */
167*cdf0e10cSrcweir	void storeToEntry(
168*cdf0e10cSrcweir			[in] ::com::sun::star::embed::XStorage xStorage,
169*cdf0e10cSrcweir			[in] string sEntName,
170*cdf0e10cSrcweir			[in] sequence< ::com::sun::star::beans::PropertyValue > aMediaArgs,
171*cdf0e10cSrcweir			[in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
172*cdf0e10cSrcweir		raises( ::com::sun::star::lang::IllegalArgumentException,
173*cdf0e10cSrcweir				::com::sun::star::embed::WrongStateException,
174*cdf0e10cSrcweir				::com::sun::star::io::IOException,
175*cdf0e10cSrcweir				::com::sun::star::uno::Exception );
176*cdf0e10cSrcweir
177*cdf0e10cSrcweir	//------------------------------------------------------------------------
178*cdf0e10cSrcweir    /** lets the object store itself to an entry in destination storage and
179*cdf0e10cSrcweir		prepare to use the new entry for own persistence.
180*cdf0e10cSrcweir
181*cdf0e10cSrcweir		<p>
182*cdf0e10cSrcweir		The object should be stored to the new entry, after that the entry
183*cdf0e10cSrcweir		should be remembered by the object. After the storing process is
184*cdf0e10cSrcweir		finished the <method>XEmbedPersist::saveCompleted</method> method
185*cdf0e10cSrcweir		can be used to specify whether the object should use the new entry or
186*cdf0e10cSrcweir		the old one. The object persistence can not be used until
187*cdf0e10cSrcweir		<method>XEmbedPersist::saveCompleted</method> is called.
188*cdf0e10cSrcweir		So this state can be treated as "HandsOff" state.
189*cdf0e10cSrcweir		<p>
190*cdf0e10cSrcweir
191*cdf0e10cSrcweir		@param xStorage
192*cdf0e10cSrcweir			a parent storage the entry should be created in
193*cdf0e10cSrcweir
194*cdf0e10cSrcweir		@param sEntName
195*cdf0e10cSrcweir			a name for the entry
196*cdf0e10cSrcweir
197*cdf0e10cSrcweir        @param aMediaArgs
198*cdf0e10cSrcweir            optional parameters for document saving, see also
199*cdf0e10cSrcweir			<type scope="com::sun::star::document">MediaDescriptor</type>
200*cdf0e10cSrcweir
201*cdf0e10cSrcweir        @param aObjectArgs
202*cdf0e10cSrcweir            optional parameters for the object saving, see also
203*cdf0e10cSrcweir			<type scope="com::sun::star::embed">EmbeddedObjectDescriptor</type>
204*cdf0e10cSrcweir
205*cdf0e10cSrcweir		@thrown ::com::sun::star::lang::IllegalArgumentException
206*cdf0e10cSrcweir			one of arguments is illegal
207*cdf0e10cSrcweir
208*cdf0e10cSrcweir        @throws com::sun::star::embed::WrongStateException
209*cdf0e10cSrcweir			the object is in wrong state
210*cdf0e10cSrcweir
211*cdf0e10cSrcweir        @throws com::sun::star::io::IOException
212*cdf0e10cSrcweir			in case of io problems during storing
213*cdf0e10cSrcweir
214*cdf0e10cSrcweir        @throws com::sun::star::uno::Exception
215*cdf0e10cSrcweir			in case of other problems
216*cdf0e10cSrcweir	 */
217*cdf0e10cSrcweir	void storeAsEntry(
218*cdf0e10cSrcweir			[in] ::com::sun::star::embed::XStorage xStorage,
219*cdf0e10cSrcweir			[in] string sEntName,
220*cdf0e10cSrcweir			[in] sequence< ::com::sun::star::beans::PropertyValue > aMediaArgs,
221*cdf0e10cSrcweir			[in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
222*cdf0e10cSrcweir		raises( ::com::sun::star::lang::IllegalArgumentException,
223*cdf0e10cSrcweir				::com::sun::star::embed::WrongStateException,
224*cdf0e10cSrcweir				::com::sun::star::io::IOException,
225*cdf0e10cSrcweir				::com::sun::star::uno::Exception );
226*cdf0e10cSrcweir
227*cdf0e10cSrcweir
228*cdf0e10cSrcweir	//------------------------------------------------------------------------
229*cdf0e10cSrcweir    /** specifies whether the object should use an old storage or a new one
230*cdf0e10cSrcweir		after "save as" operation.
231*cdf0e10cSrcweir
232*cdf0e10cSrcweir		@param bUseNew
233*cdf0e10cSrcweir			<TRUE/> the new storage should be used
234*cdf0e10cSrcweir			<FALSE/> the old one
235*cdf0e10cSrcweir
236*cdf0e10cSrcweir        @throws com::sun::star::embed::WrongStateException
237*cdf0e10cSrcweir			the object is in wrong state
238*cdf0e10cSrcweir
239*cdf0e10cSrcweir        @throws com::sun::star::uno::Exception
240*cdf0e10cSrcweir			in case of other problems
241*cdf0e10cSrcweir	 */
242*cdf0e10cSrcweir
243*cdf0e10cSrcweir	void saveCompleted( [in] boolean bUseNew )
244*cdf0e10cSrcweir		raises( ::com::sun::star::embed::WrongStateException,
245*cdf0e10cSrcweir				::com::sun::star::uno::Exception );
246*cdf0e10cSrcweir
247*cdf0e10cSrcweir	//------------------------------------------------------------------------
248*cdf0e10cSrcweir    /** allows to detect if the object has entry.
249*cdf0e10cSrcweir
250*cdf0e10cSrcweir        @returns
251*cdf0e10cSrcweir            <TRUE/> if the object has own entry set
252*cdf0e10cSrcweir            <FALSE/> otherwise
253*cdf0e10cSrcweir	 */
254*cdf0e10cSrcweir	boolean hasEntry()
255*cdf0e10cSrcweir		raises( ::com::sun::star::embed::WrongStateException );
256*cdf0e10cSrcweir
257*cdf0e10cSrcweir	//------------------------------------------------------------------------
258*cdf0e10cSrcweir    /** allows to retrieve the current object entry name.
259*cdf0e10cSrcweir
260*cdf0e10cSrcweir        @returns
261*cdf0e10cSrcweir			the object entry name if any
262*cdf0e10cSrcweir
263*cdf0e10cSrcweir        @throws com::sun::star::embed::WrongStateException
264*cdf0e10cSrcweir			the object is in wrong state ( has no entry )
265*cdf0e10cSrcweir	 */
266*cdf0e10cSrcweir	string getEntryName()
267*cdf0e10cSrcweir		raises( ::com::sun::star::embed::WrongStateException );
268*cdf0e10cSrcweir};
269*cdf0e10cSrcweir
270*cdf0e10cSrcweir//============================================================================
271*cdf0e10cSrcweir
272*cdf0e10cSrcweir}; }; }; };
273*cdf0e10cSrcweir
274*cdf0e10cSrcweir#endif
275*cdf0e10cSrcweir
276