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_XPROTOCOLPROPERTIES_IDL_ 28#define _COM_SUN_STAR_BRIDGE_XPROTOCOLPROPERTIES_IDL_ 29#include <com/sun/star/bridge/ProtocolProperty.idl> 30#include <com/sun/star/bridge/InvalidProtocolChangeException.idl> 31 32module com { module sun { module star { module bridge { 33 34 35/** Bridge internal interface, that allows to change protocol settings of the remote 36 counter part. 37 38 <p>In general, this interface is implemented by the bridge itself. It must not 39 be called from outside the bridge.</p> 40 41 <p>INTERNAL INTERFACE, DO NOT USE IT ELSEWHERE!</p> 42*/ 43published interface XProtocolProperties : com::sun::star::uno::XInterface 44{ 45 /** called to get a list of bridge internal properties. Which properties can be retrieved, 46 is protocol dependent. 47 48 <p> The properties MUST NOT change between a requestChange and a commit change call.</p> 49 */ 50 sequence< ProtocolProperty > getProperties( ); 51 52 /** called to initiate a protocol change. 53 54 <p>This method should always be called in the scope of the local bridge setting object, 55 because the remote counter part may do such a call at the same time 56 (typically at startup time). </p> 57 58 @param nRandomNumber 59 In case both processes call requestChange at the same time, 60 the caller with the higher nRandomNumber is allowed to call 61 commitChange. 62 63 @returns 64 1, if the caller may ( and MUST !!!) call commitChange. 65 0, if the caller is not allowed to call commitChange. This can only happen, 66 if the other bridge has called requestChange at the same time and 67 nRandomNumber is smaller than the other bridge's nRandomNumber. 68 The remote counterpart is supposed to call commitChange within a small 69 time span. Please call requestChange() after the remote counterpart has 70 called commitChange(). 71 -1 if the nRandomNumber is of the same value as the previously 72 sent requestChange (sent by the remote counterpart). This is a draw :o). 73 Generate a new random number and try again. 74 */ 75 long requestChange( [in] long nRandomNumber ); 76 77 /** called to commit a protocol change. 78 79 <p>It is only allowed to call commitChange, if requestChange 80 has been called previously and the return value was true. The new properties are 81 valid after the reply of commitChange has been received. 82 Note, that this is difficult for the callee, because it must marshal the reply 83 with the old settings. </p> 84 85 <p>All properties not mentioned in the list are unchanged. 86 Note that the bridge must be blocked for other threads, 87 before commitChange is sent and unblocked 88 after the reply has been received. This blocks the bridge.</p> 89 90 @throws InvalidProtocolChangeException 91 when the remote counterpart could not change at least one of the properties. 92 No property has been changed. requestChange must be called 93 again to initiate a new change of the protocol. 94 */ 95 void commitChange( [in] sequence< ProtocolProperty > newValues ) 96 raises ( com::sun::star::bridge::InvalidProtocolChangeException ); 97}; 98 99};};};}; 100#endif 101