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_XEmbedObjectCreator_idl__
24#define __com_sun_star_embed_XEmbedObjectCreator_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_embed_XStorage_idl__
31#include <com/sun/star/embed/XStorage.idl>
32#endif
33
34#ifndef __com_sun_star_io_IOException_idl__
35#include <com/sun/star/io/IOException.idl>
36#endif
37
38#ifndef __com_sun_star_embed_WrongStateException_idl__
39#include <com/sun/star/embed/WrongStateException.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_beans_PropertyValue_idl__
47#include <com/sun/star/beans/PropertyValue.idl>
48#endif
49
50//============================================================================
51
52 module com {  module sun {  module star {  module embed {
53
54//============================================================================
55/** allows to create and initialize a new embedded object.
56
57	<p>
58	This interface contains methods that can help to create and initialize
59	an embedded object.
60	</p>
61 */
62published interface XEmbedObjectCreator: com::sun::star::uno::XInterface
63{
64	// -----------------------------------------------------------------------
65    /** creates a new object and initializes it as a new one.
66
67		<p> In case specified entry exists it's contents are ignored and
68		will be overwritten on storing.
69		</p>
70
71		@param aClassID
72			the class id of the new object
73
74		@param sClassName
75			the class name of the new object
76
77		@param xStorage
78			a parent storage the entry should be created/opened in
79
80		@param sEntryName
81			a name for the entry
82
83        @param aObjectArgs
84            optional parameters for the object persistence initialization
85            see also
86			<type>EmbeddedObjectDescriptor</type>
87
88		@throws ::com::sun::star::lang::IllegalArgumentException
89			one of arguments is illegal
90
91        @throws com::sun::star::io::IOException
92			in case of io problems during opening\creation
93
94        @throws com::sun::star::uno::Exception
95			in case of other problems
96	 */
97	::com::sun::star::uno::XInterface createInstanceInitNew(
98			[in] sequence< byte > aClassID,
99			[in] string sClassName,
100			[in] ::com::sun::star::embed::XStorage xStorage,
101		 	[in] string sEntryName,
102			[in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
103		raises( ::com::sun::star::lang::IllegalArgumentException,
104				::com::sun::star::io::IOException,
105				::com::sun::star::uno::Exception );
106
107
108	// -----------------------------------------------------------------------
109    /** creates a new object that should be based on specified storage entry.
110
111		<p> The specified entry must exists and the object should be loaded
112		from the entry. In case a persistent representation of a link is
113		specified, the result object will be a link.
114		</p>
115
116		@param xStorage
117			a parent storage the entry should be opened in
118
119		@param sEntryName
120			a name for the entry
121
122		@param aMediaDescriptor
123			an object of type
124			<type scope="com::sun::star::document">MediaDescriptor</type> that
125			specifies document related properties; please remember that target
126			related parameters, for example URL, will be ignored since the
127			object should be loaded from storage entry
128
129		@param aObjectArgs
130			an object of type <type>EmbeddedObjectDescriptor</type>
131			contains object related properties
132
133		@throws ::com::sun::star::lang::IllegalArgumentException
134			one of arguments is illegal
135
136		@throws ::com::sun::star::container::NoSuchElementException
137			the specified entry does not exist
138
139        @throws com::sun::star::io::IOException
140			in case of io problems during opening
141
142        @throws com::sun::star::uno::Exception
143			in case of other problems
144	 */
145	::com::sun::star::uno::XInterface createInstanceInitFromEntry(
146			[in] ::com::sun::star::embed::XStorage xStorage,
147			[in] string sEntryName,
148			[in] sequence< ::com::sun::star::beans::PropertyValue > aMediaDescriptor,
149			[in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
150		raises( ::com::sun::star::lang::IllegalArgumentException,
151				::com::sun::star::container::NoSuchElementException,
152				::com::sun::star::io::IOException,
153				::com::sun::star::uno::Exception );
154
155	// -----------------------------------------------------------------------
156    /** creates a new object and initializes it based on
157		<type scope="com::sun::star::document">MediaDescriptor</type>.
158
159		<p> In case specified entry exists it's contents are ignored and will
160		be overwritten on storing.
161		</p>
162
163		@param xStorage
164			a parent storage the entry should be created/opened in
165
166		@param sEntryName
167			a name for the entry
168
169		@param aMediaDescriptor
170			an object of type
171			<type scope="com::sun::star::document">MediaDescriptor</type> that
172			specifies source
173
174		@param aObjectArgs
175			an object of type <type>EmbeddedObjectDescriptor</type>
176			contains object related properties
177
178		@throws ::com::sun::star::lang::IllegalArgumentException
179			one of arguments is illegal
180
181        @throws com::sun::star::io::IOException
182			in case of io problems during opening\creation
183
184        @throws com::sun::star::uno::Exception
185			in case of other problems
186	 */
187	::com::sun::star::uno::XInterface createInstanceInitFromMediaDescriptor(
188			[in] ::com::sun::star::embed::XStorage xStorage,
189			[in] string sEntryName,
190	 		[in] sequence< ::com::sun::star::beans::PropertyValue > aMediaDescriptor,
191			[in] sequence< ::com::sun::star::beans::PropertyValue > aObjectArgs )
192		raises( ::com::sun::star::lang::IllegalArgumentException,
193				::com::sun::star::io::IOException,
194				::com::sun::star::uno::Exception );
195};
196
197//============================================================================
198
199}; }; }; };
200
201#endif
202
203