1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef _COM_SUN_STAR_BRIDGE_XPROTOCOLPROPERTIES_IDL_
28*cdf0e10cSrcweir#define _COM_SUN_STAR_BRIDGE_XPROTOCOLPROPERTIES_IDL_
29*cdf0e10cSrcweir#include <com/sun/star/bridge/ProtocolProperty.idl>
30*cdf0e10cSrcweir#include <com/sun/star/bridge/InvalidProtocolChangeException.idl>
31*cdf0e10cSrcweir
32*cdf0e10cSrcweirmodule com { module sun { module star { module bridge {
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir
35*cdf0e10cSrcweir/** Bridge internal interface, that allows to change protocol settings of the remote
36*cdf0e10cSrcweir    counter part.
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir	<p>In general, this interface is implemented by the bridge itself. It must not
39*cdf0e10cSrcweir    be called from outside the bridge.</p>
40*cdf0e10cSrcweir
41*cdf0e10cSrcweir	<p>INTERNAL INTERFACE, DO NOT USE IT ELSEWHERE!</p>
42*cdf0e10cSrcweir*/
43*cdf0e10cSrcweirpublished interface XProtocolProperties : com::sun::star::uno::XInterface
44*cdf0e10cSrcweir{
45*cdf0e10cSrcweir	/** called to get a list of bridge internal properties. Which properties can be retrieved,
46*cdf0e10cSrcweir		is protocol dependent.
47*cdf0e10cSrcweir
48*cdf0e10cSrcweir		<p> The properties MUST NOT change between a requestChange and a commit change call.</p>
49*cdf0e10cSrcweir	 */
50*cdf0e10cSrcweir	sequence< ProtocolProperty > getProperties( );
51*cdf0e10cSrcweir
52*cdf0e10cSrcweir	/** called to initiate a protocol change.
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir		<p>This method should always be called in the scope of the local bridge setting object,
55*cdf0e10cSrcweir		because the remote counter part may do such a call at the same time
56*cdf0e10cSrcweir		(typically at startup time). </p>
57*cdf0e10cSrcweir
58*cdf0e10cSrcweir		@param nRandomNumber
59*cdf0e10cSrcweir			In case both processes call requestChange at the same time,
60*cdf0e10cSrcweir			 the caller with the higher nRandomNumber is allowed to call
61*cdf0e10cSrcweir			 commitChange.
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir		@returns
64*cdf0e10cSrcweir			1, if the caller may ( and MUST !!!) call commitChange.
65*cdf0e10cSrcweir			0, if the caller is not allowed to call commitChange. This can only happen,
66*cdf0e10cSrcweir			   if the other bridge has called requestChange at the same time and
67*cdf0e10cSrcweir			   nRandomNumber is smaller than the other bridge's nRandomNumber.
68*cdf0e10cSrcweir			   The remote counterpart is supposed to call commitChange within a small
69*cdf0e10cSrcweir			   time span. Please call requestChange() after the remote counterpart has
70*cdf0e10cSrcweir			   called commitChange().
71*cdf0e10cSrcweir			-1 if the nRandomNumber is of the same value as the previously
72*cdf0e10cSrcweir			   sent requestChange (sent by the remote counterpart). This is a draw :o).
73*cdf0e10cSrcweir			   Generate a new random number and try again.
74*cdf0e10cSrcweir	 */
75*cdf0e10cSrcweir	long requestChange( [in] long nRandomNumber );
76*cdf0e10cSrcweir
77*cdf0e10cSrcweir	/** called to commit a protocol change.
78*cdf0e10cSrcweir
79*cdf0e10cSrcweir		<p>It is only allowed to call commitChange, if requestChange
80*cdf0e10cSrcweir		has been called previously and the return value was true.  The new properties are
81*cdf0e10cSrcweir		valid after the reply of commitChange has been received.
82*cdf0e10cSrcweir		Note, that this is difficult for the callee, because it must marshal the reply
83*cdf0e10cSrcweir		with the old settings. </p>
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir		<p>All properties not mentioned in the list are unchanged.
86*cdf0e10cSrcweir		Note that the bridge must be blocked for other threads,
87*cdf0e10cSrcweir		before commitChange is sent and unblocked
88*cdf0e10cSrcweir		after the reply has been received. This blocks the bridge.</p>
89*cdf0e10cSrcweir
90*cdf0e10cSrcweir		@throws InvalidProtocolChangeException
91*cdf0e10cSrcweir				when the remote counterpart could not change at least one of the properties.
92*cdf0e10cSrcweir				No property has been changed. requestChange must be called
93*cdf0e10cSrcweir				again to initiate a new change of the protocol.
94*cdf0e10cSrcweir	 */
95*cdf0e10cSrcweir	void commitChange( [in] sequence< ProtocolProperty > newValues )
96*cdf0e10cSrcweir		raises ( com::sun::star::bridge::InvalidProtocolChangeException );
97*cdf0e10cSrcweir};
98*cdf0e10cSrcweir
99*cdf0e10cSrcweir};};};};
100*cdf0e10cSrcweir#endif
101