1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_embed_XEmbedPersist_idl__
20 #define __com_sun_star_embed_XEmbedPersist_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
23 #include
<com
/sun
/star
/embed
/XStorage.idl
>
24 #include
<com
/sun
/star
/embed
/XCommonEmbedPersist.idl
>
25 #include
<com
/sun
/star
/io
/IOException.idl
>
26 #include
<com
/sun
/star
/embed
/WrongStateException.idl
>
27 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
28 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
31 module com
{ module sun
{ module star
{ module embed
{
33 /** specifies an implementation for embedded object persistence.
35 The idea is that any usable embedded object should be initialized
36 with an entry in the parent storage that will be used as persistent
40 published
interface XEmbedPersist
: XCommonEmbedPersist
42 /** provides object with a parent storage and a name for object's entry.
45 An entry with the specified name should be created/opened inside
46 provided storage. It can be a storage or a stream. For example,
47 OOo API will refer to OLE storages only by streams, but the object
48 implementation will use storage based on this stream.
52 Factory does this call to initialize the embedded object.
53 The linked object can be initialized by factory in different way
58 It is also possible to switch object persistent representation through
59 this call. Actually this is the way, this call can be used by user
60 ( since initialization is done by factory ).
64 a parent storage the entry should be created in
69 @param nEntryConnectionMode
70 a mode in which the object should be initialized from entry
71 can take values from EntryInitModes constant set
74 optional parameters for the embedded document persistence
75 initialization, see also
76 com::sun::star::document::MediaDescriptor
79 optional parameters for the object persistence initialization,
81 com::sun::star::embed::EmbeddedObjectDescriptor
83 @throws ::com::sun::star::lang::IllegalArgumentException
84 one of arguments is illegal
86 @throws com::sun::star::embed::WrongStateException
87 the object is in wrong state
89 @throws com::sun::star::io::IOException
90 in case of io problems during opening or creation
92 @throws com::sun::star::uno::Exception
93 in case of other problems
95 void setPersistentEntry
(
96 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
98 [in] long nEntryConnectionMode
,
99 [in] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> aMediaArgs
,
100 [in] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> aObjectArgs
)
101 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
,
102 ::com
::sun
::star
::embed
::WrongStateException
,
103 ::com
::sun
::star
::io
::IOException
,
104 ::com
::sun
::star
::uno
::Exception
);
106 /** lets the object store itself to an entry in destination storage,
107 the own persistence entry is not changed.
110 a parent storage the entry should be created inside
116 optional parameters for document saving, see also
117 com::sun::star::document::MediaDescriptor
120 optional parameters for the object saving, see also
121 com::sun::star::embed::EmbeddedObjectDescriptor
123 @throws ::com::sun::star::lang::IllegalArgumentException
124 one of arguments is illegal
126 @throws com::sun::star::embed::WrongStateException
127 the object is in wrong state
129 @throws com::sun::star::io::IOException
130 in case of io problems during storing
132 @throws com::sun::star::uno::Exception
133 in case of other problems
136 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
137 [in] string sEntName
,
138 [in] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> aMediaArgs
,
139 [in] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> aObjectArgs
)
140 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
,
141 ::com
::sun
::star
::embed
::WrongStateException
,
142 ::com
::sun
::star
::io
::IOException
,
143 ::com
::sun
::star
::uno
::Exception
);
145 /** lets the object store itself to an entry in destination storage and
146 prepare to use the new entry for own persistence.
149 The object should be stored to the new entry, after that the entry
150 should be remembered by the object. After the storing process is
151 finished the XEmbedPersist::saveCompleted() method
152 can be used to specify whether the object should use the new entry or
153 the old one. The object persistence can not be used until
154 XEmbedPersist::saveCompleted() is called.
155 So this state can be treated as "HandsOff" state.
159 a parent storage the entry should be created in
165 optional parameters for document saving, see also
166 com::sun::star::document::MediaDescriptor
169 optional parameters for the object saving, see also
170 com::sun::star::embed::EmbeddedObjectDescriptor
172 @throws ::com::sun::star::lang::IllegalArgumentException
173 one of arguments is illegal
175 @throws com::sun::star::embed::WrongStateException
176 the object is in wrong state
178 @throws com::sun::star::io::IOException
179 in case of io problems during storing
181 @throws com::sun::star::uno::Exception
182 in case of other problems
185 [in] ::com
::sun
::star
::embed
::XStorage xStorage
,
186 [in] string sEntName
,
187 [in] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> aMediaArgs
,
188 [in] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> aObjectArgs
)
189 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
,
190 ::com
::sun
::star
::embed
::WrongStateException
,
191 ::com
::sun
::star
::io
::IOException
,
192 ::com
::sun
::star
::uno
::Exception
);
195 /** specifies whether the object should use an old storage or a new one
196 after "save as" operation.
199 `TRUE` the new storage should be used
202 @throws com::sun::star::embed::WrongStateException
203 the object is in wrong state
205 @throws com::sun::star::uno::Exception
206 in case of other problems
209 void saveCompleted
( [in] boolean bUseNew
)
210 raises
( ::com
::sun
::star
::embed
::WrongStateException
,
211 ::com
::sun
::star
::uno
::Exception
);
213 /** allows to detect if the object has entry.
216 `TRUE` if the object has own entry set
220 raises
( ::com
::sun
::star
::embed
::WrongStateException
);
222 /** allows to retrieve the current object entry name.
225 the object entry name if any
227 @throws com::sun::star::embed::WrongStateException
228 the object is in wrong state ( has no entry )
230 string getEntryName
()
231 raises
( ::com
::sun
::star
::embed
::WrongStateException
);
239 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */