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_bridge_XBridgeSupplier2_idl__
24#define __com_sun_star_bridge_XBridgeSupplier2_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_lang_IllegalArgumentException_idl__
31#include <com/sun/star/lang/IllegalArgumentException.idl>
32#endif
33
34
35//=============================================================================
36
37 module com {  module sun {  module star {  module bridge {
38
39//=============================================================================
40
41/** defines the interface for creating bridges to other object models.
42	<p />
43	<p>
44	The created bridges are transparent to the user. That is, if one maps
45	an interface into the target model, then the resulting target interface
46	is a bridge implementation, that is not being noticed by an user. During
47	a call on that interface, the bridge is invoked to convert the arguments
48	and carry out a call according to the rules of the source model.
49	Return values are automatically mapped to the types of the target model.
50	</p>
51	<p>
52	Simple types are mapped to simple target types. That is, there is no additional
53	bridging code involved when those types are being used.
54	</p>
55
56	<p>Sometimes a bridge cannot be created, depending on whether a programm uses
57	the XBridgeSupplier2 interface remotely. Assuming one wants to bridge an
58	OLE Automation object to UNO by calling createBridge on a proxy, then the UNO remote
59	bridge would not recognise that the Any argument contains an IDispatch interface.
60	Therefore it cannot marshal it as COM requires it and the bridgeing would fail.
61	To prevent this, implementations of this interface should be aware of this scenario and
62	if necessary take the appropriate steps. The process ID argument to the createBridge
63	function represents the calling process and may be used by the implementation to determine
64	if it is being accessed remotely.
65	</p>
66	<p>All objects, whether they are part of the UNO object model or not,
67	are carried in an <atom>any</atom>.  The representation of this object
68	is heavily model-dependent and has to be specified in the following list: </p>
69
70	<dl>
71		<dt>UNO: </dt>
72		<dd>The any carries normal UNO types, which can be any base type,
73		struct, sequence, enum or interface.  </dd>
74
75		<dt>OLE: 	</dt>
76		<dd>The any carries an <atom>unsigned long</atom> (on 32-bit systems)
77		or an <atom>unsigned hyper</atom> (on 64-bit systems), which is
78		interpreted as a variant pointer. The any does not control the
79		lifetime of the represented variant. That implies that the caller
80		has the responsibility of freeing the OLE resources represented
81		by the any value.  </dd>
82
83		<dt>JAVA: 	</dt>
84		<dd>not specified yet.  </dd>
85
86		<dt>CORBA: </dt>
87		<dd>not specified yet.  </dd>
88	</dl>
89
90	</p>
91	<p>Any implementation can supply its own bridges to other object
92	models by implementing this interface and returning the bridge
93	when the method <member>XBridgeSupplier2::createBridge()</member>
94	is called with itself as the first parameter.  </p>
95
96	@see com::sun::star::bridge::OleBridgeSupplier2
97 */
98published interface XBridgeSupplier2: com::sun::star::uno::XInterface
99{
100	/** creates a bridge to provide an object of one object model with another.
101	 */
102	any createBridge( [in] any aModelDepObject,
103			 [in] sequence< byte > aProcessId,
104			 [in] short nSourceModelType,
105			 [in] short nDestModelType )
106			raises( com::sun::star::lang::IllegalArgumentException );
107
108};
109
110//=============================================================================
111
112}; }; }; };
113
114/*=============================================================================
115
116=============================================================================*/
117#endif
118