1*408a4873SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3*408a4873SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*408a4873SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*408a4873SAndrew Rist * distributed with this work for additional information 6*408a4873SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*408a4873SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*408a4873SAndrew Rist * "License"); you may not use this file except in compliance 9*408a4873SAndrew Rist * with the License. You may obtain a copy of the License at 10*408a4873SAndrew Rist * 11*408a4873SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*408a4873SAndrew Rist * 13*408a4873SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*408a4873SAndrew Rist * software distributed under the License is distributed on an 15*408a4873SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*408a4873SAndrew Rist * KIND, either express or implied. See the License for the 17*408a4873SAndrew Rist * specific language governing permissions and limitations 18*408a4873SAndrew Rist * under the License. 19*408a4873SAndrew Rist * 20*408a4873SAndrew Rist *************************************************************/ 21*408a4873SAndrew Rist 22*408a4873SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_bridge_XBridgeSupplier2_idl__ 24cdf0e10cSrcweir#define __com_sun_star_bridge_XBridgeSupplier2_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 31cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir 35cdf0e10cSrcweir//============================================================================= 36cdf0e10cSrcweir 37cdf0e10cSrcweir module com { module sun { module star { module bridge { 38cdf0e10cSrcweir 39cdf0e10cSrcweir//============================================================================= 40cdf0e10cSrcweir 41cdf0e10cSrcweir/** defines the interface for creating bridges to other object models. 42cdf0e10cSrcweir <p /> 43cdf0e10cSrcweir <p> 44cdf0e10cSrcweir The created bridges are transparent to the user. That is, if one maps 45cdf0e10cSrcweir an interface into the target model, then the resulting target interface 46cdf0e10cSrcweir is a bridge implementation, that is not being noticed by an user. During 47cdf0e10cSrcweir a call on that interface, the bridge is invoked to convert the arguments 48cdf0e10cSrcweir and carry out a call according to the rules of the source model. 49cdf0e10cSrcweir Return values are automatically mapped to the types of the target model. 50cdf0e10cSrcweir </p> 51cdf0e10cSrcweir <p> 52cdf0e10cSrcweir Simple types are mapped to simple target types. That is, there is no additional 53cdf0e10cSrcweir bridging code involved when those types are being used. 54cdf0e10cSrcweir </p> 55cdf0e10cSrcweir 56cdf0e10cSrcweir <p>Sometimes a bridge cannot be created, depending on whether a programm uses 57cdf0e10cSrcweir the XBridgeSupplier2 interface remotely. Assuming one wants to bridge an 58cdf0e10cSrcweir OLE Automation object to UNO by calling createBridge on a proxy, then the UNO remote 59cdf0e10cSrcweir bridge would not recognise that the Any argument contains an IDispatch interface. 60cdf0e10cSrcweir Therefore it cannot marshal it as COM requires it and the bridgeing would fail. 61cdf0e10cSrcweir To prevent this, implementations of this interface should be aware of this scenario and 62cdf0e10cSrcweir if necessary take the appropriate steps. The process ID argument to the createBridge 63cdf0e10cSrcweir function represents the calling process and may be used by the implementation to determine 64cdf0e10cSrcweir if it is being accessed remotely. 65cdf0e10cSrcweir </p> 66cdf0e10cSrcweir <p>All objects, whether they are part of the UNO object model or not, 67cdf0e10cSrcweir are carried in an <atom>any</atom>. The representation of this object 68cdf0e10cSrcweir is heavily model-dependent and has to be specified in the following list: </p> 69cdf0e10cSrcweir 70cdf0e10cSrcweir <dl> 71cdf0e10cSrcweir <dt>UNO: </dt> 72cdf0e10cSrcweir <dd>The any carries normal UNO types, which can be any base type, 73cdf0e10cSrcweir struct, sequence, enum or interface. </dd> 74cdf0e10cSrcweir 75cdf0e10cSrcweir <dt>OLE: </dt> 76cdf0e10cSrcweir <dd>The any carries an <atom>unsigned long</atom> (on 32-bit systems) 77cdf0e10cSrcweir or an <atom>unsigned hyper</atom> (on 64-bit systems), which is 78cdf0e10cSrcweir interpreted as a variant pointer. The any does not control the 79cdf0e10cSrcweir lifetime of the represented variant. That implies that the caller 80cdf0e10cSrcweir has the responsibility of freeing the OLE resources represented 81cdf0e10cSrcweir by the any value. </dd> 82cdf0e10cSrcweir 83cdf0e10cSrcweir <dt>JAVA: </dt> 84cdf0e10cSrcweir <dd>not specified yet. </dd> 85cdf0e10cSrcweir 86cdf0e10cSrcweir <dt>CORBA: </dt> 87cdf0e10cSrcweir <dd>not specified yet. </dd> 88cdf0e10cSrcweir </dl> 89cdf0e10cSrcweir 90cdf0e10cSrcweir </p> 91cdf0e10cSrcweir <p>Any implementation can supply its own bridges to other object 92cdf0e10cSrcweir models by implementing this interface and returning the bridge 93cdf0e10cSrcweir when the method <member>XBridgeSupplier2::createBridge()</member> 94cdf0e10cSrcweir is called with itself as the first parameter. </p> 95cdf0e10cSrcweir 96cdf0e10cSrcweir @see com::sun::star::bridge::OleBridgeSupplier2 97cdf0e10cSrcweir */ 98cdf0e10cSrcweirpublished interface XBridgeSupplier2: com::sun::star::uno::XInterface 99cdf0e10cSrcweir{ 100cdf0e10cSrcweir /** creates a bridge to provide an object of one object model with another. 101cdf0e10cSrcweir */ 102cdf0e10cSrcweir any createBridge( [in] any aModelDepObject, 103cdf0e10cSrcweir [in] sequence< byte > aProcessId, 104cdf0e10cSrcweir [in] short nSourceModelType, 105cdf0e10cSrcweir [in] short nDestModelType ) 106cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 107cdf0e10cSrcweir 108cdf0e10cSrcweir}; 109cdf0e10cSrcweir 110cdf0e10cSrcweir//============================================================================= 111cdf0e10cSrcweir 112cdf0e10cSrcweir}; }; }; }; 113cdf0e10cSrcweir 114cdf0e10cSrcweir/*============================================================================= 115cdf0e10cSrcweir 116cdf0e10cSrcweir=============================================================================*/ 117cdf0e10cSrcweir#endif 118