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