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_lang_XConnectionPoint_idl__ 24cdf0e10cSrcweir#define __com_sun_star_lang_XConnectionPoint_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_XConnectionPointContainer_idl__ 31cdf0e10cSrcweir#include <com/sun/star/lang/XConnectionPointContainer.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir#ifndef __com_sun_star_lang_ListenerExistException_idl__ 35cdf0e10cSrcweir#include <com/sun/star/lang/ListenerExistException.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir#ifndef __com_sun_star_lang_InvalidListenerException_idl__ 39cdf0e10cSrcweir#include <com/sun/star/lang/InvalidListenerException.idl> 40cdf0e10cSrcweir#endif 41cdf0e10cSrcweir 42cdf0e10cSrcweir 43cdf0e10cSrcweir//============================================================================= 44cdf0e10cSrcweir 45cdf0e10cSrcweirmodule com { module sun { module star { module lang { 46cdf0e10cSrcweir 47cdf0e10cSrcweir//============================================================================= 48cdf0e10cSrcweir 49cdf0e10cSrcweir// DocMerge from idl: interface com::sun::star::lang::XConnectionPoint 50cdf0e10cSrcweir/** supports connection points for connectable objects. 51cdf0e10cSrcweir 52cdf0e10cSrcweir <p>Connectable objects support the following features: </p> 53cdf0e10cSrcweir 54cdf0e10cSrcweir <ul> 55cdf0e10cSrcweir <li>outgoing interfaces, such as event sets; </li> 56cdf0e10cSrcweir <li>the ability to enumerate the types of the outgoing interfaces; 57cdf0e10cSrcweir <li>the ability to connect and disconnect sinks to the object 58cdf0e10cSrcweir for those outgoing types; </li> 59cdf0e10cSrcweir <li>the ability to enumerate the connections that exist to a 60cdf0e10cSrcweir particular outgoing interface. </li> 61cdf0e10cSrcweir </ul> 62cdf0e10cSrcweir 63cdf0e10cSrcweir <h4>When to Implement?<h4> 64cdf0e10cSrcweir 65cdf0e10cSrcweir <p>To create a connectable object, you need to implement objects 66cdf0e10cSrcweir that provide two related interfaces: </p> 67cdf0e10cSrcweir 68cdf0e10cSrcweir <ul> 69cdf0e10cSrcweir <li><type>XConnectionPointContainer</type> </li> 70cdf0e10cSrcweir <li><type>XConnectionPoint</type> </li> 71cdf0e10cSrcweir </ul> 72cdf0e10cSrcweir 73cdf0e10cSrcweir <p>The <type>XConnectionPointContainer</type> interface is implemented 74cdf0e10cSrcweir on the connectable object to indicate the existence of the outgoing 75cdf0e10cSrcweir interfaces. It provides a sequence of sub-objects. It also provides 76cdf0e10cSrcweir access to all the connection point sub-objects, each of which 77cdf0e10cSrcweir implements the <type>XConnectionPoint</type> interface. The 78cdf0e10cSrcweir <type>XConnectionPoint</type> interface provides a sequence of 79cdf0e10cSrcweir sub-objects. </p> 80cdf0e10cSrcweir 81cdf0e10cSrcweir <p>Each connection point is a separate sub-object to avoid circular 82cdf0e10cSrcweir reference counting problems. A connection point controls how many 83cdf0e10cSrcweir connections (one or more) it will allow in its implementation of 84cdf0e10cSrcweir <member>XConnectionPoint::advise()</member>. </p> 85cdf0e10cSrcweir 86cdf0e10cSrcweir <h4>When to use?</h4> 87cdf0e10cSrcweir 88cdf0e10cSrcweir <p>A client can use the <type>XConnectionPointContainer</type> interface: </p> 89cdf0e10cSrcweir 90cdf0e10cSrcweir <UL> 91cdf0e10cSrcweir 92cdf0e10cSrcweir <LI>to get a sequence of connection points for each outgoing type. </LI> 93cdf0e10cSrcweir 94cdf0e10cSrcweir <LI>to obtain access to connection point sub-objects with the 95cdf0e10cSrcweir <type>XConnectionPoint</type> interface for each 96cdf0e10cSrcweir outgoing type. Through the XConnectionPoint interface, 97cdf0e10cSrcweir a client starts or terminates an advisory loop with the 98cdf0e10cSrcweir connectable object and the client's own sink. The 99cdf0e10cSrcweir client can also use the <type>XConnectionPoint</type> 100cdf0e10cSrcweir interface to get a sequence of the connections that it 101cdf0e10cSrcweir knows about. </LI> 102cdf0e10cSrcweir </UL> 103cdf0e10cSrcweir 104cdf0e10cSrcweir @see XConnectionPointContainer 105cdf0e10cSrcweir */ 106cdf0e10cSrcweirpublished interface XConnectionPoint: com::sun::star::uno::XInterface 107cdf0e10cSrcweir{ 108cdf0e10cSrcweir //------------------------------------------------------------------------- 109cdf0e10cSrcweir 110cdf0e10cSrcweir // DocMerge from idl: method com::sun::star::lang::XConnectionPoint::getConnectionType 111cdf0e10cSrcweir /** @returns 112cdf0e10cSrcweir the type of the outgoing interface managed by this 113cdf0e10cSrcweir connection point. 114cdf0e10cSrcweir 115cdf0e10cSrcweir <p>Using the <member>XConnectionPointContainer::getConnectionPoints</member> 116cdf0e10cSrcweir method, a client can obtain an <type>XConnectionPoint</type> 117cdf0e10cSrcweir interface. Using that interface and this method, the client 118cdf0e10cSrcweir can determine the type of each connection point enumerated. The 119cdf0e10cSrcweir type returned from this method must enable the caller to access 120cdf0e10cSrcweir this same connection point through 121cdf0e10cSrcweir <member>XConnectionPointContainer::findConnectionPoint</member>. 122cdf0e10cSrcweir 123cdf0e10cSrcweir @see XConnectionPointContainer::findConnectionPoint 124cdf0e10cSrcweir */ 125cdf0e10cSrcweir type getConnectionType(); 126cdf0e10cSrcweir 127cdf0e10cSrcweir //------------------------------------------------------------------------- 128cdf0e10cSrcweir 129cdf0e10cSrcweir // DocMerge from idl: method com::sun::star::lang::XConnectionPoint::getConnectionPointContainer 130cdf0e10cSrcweir /** @returns 131cdf0e10cSrcweir the <type>XConnectionPointContainer</type> interface on 132cdf0e10cSrcweir the parent connectable object. 133cdf0e10cSrcweir 134cdf0e10cSrcweir @see XConnectionPointContainer 135cdf0e10cSrcweir */ 136cdf0e10cSrcweir com::sun::star::lang::XConnectionPointContainer getConnectionPointContainer(); 137cdf0e10cSrcweir 138cdf0e10cSrcweir //------------------------------------------------------------------------- 139cdf0e10cSrcweir 140cdf0e10cSrcweir // DocMerge from idl: method com::sun::star::lang::XConnectionPoint::advise 141cdf0e10cSrcweir /** creates a connection between a connection point and a 142cdf0e10cSrcweir client's sink, where the sink implements the outgoing interface 143cdf0e10cSrcweir supported by this connection point. 144cdf0e10cSrcweir 145cdf0e10cSrcweir <p>A few <code>add...Listener</code> methods need additional parameters 146cdf0e10cSrcweir to add listeners or throw exceptions. One of these methods is 147cdf0e10cSrcweir <member scope="com::sun::star::beans">XPropertySet::addPropertyChangeListener</member>. 148cdf0e10cSrcweir We ignore the problem in this interface. A solution must be provided 149cdf0e10cSrcweir in an additional <type>XConnectionPoint</type> interface. </p> 150cdf0e10cSrcweir 151cdf0e10cSrcweir @param xListener 152cdf0e10cSrcweir specifies the listener interface on the client's advise sink. 153cdf0e10cSrcweir The client's sink receives outgoing calls from the 154cdf0e10cSrcweir connection point container. 155cdf0e10cSrcweir 156cdf0e10cSrcweir @throws ListenerExistException 157cdf0e10cSrcweir if it is a unicast broadcaster and a listener is already set. 158cdf0e10cSrcweir 159cdf0e10cSrcweir @throws InvalidListenerException 160cdf0e10cSrcweir if the listener does not supply the needed interfaces. 161cdf0e10cSrcweir 162cdf0e10cSrcweir @see com::sun::star::beans::XPropertySet::addPropertyChangeListener 163cdf0e10cSrcweir */ 164cdf0e10cSrcweir void advise( [in] com::sun::star::uno::XInterface xListener ) 165cdf0e10cSrcweir raises( com::sun::star::lang::ListenerExistException, 166cdf0e10cSrcweir com::sun::star::lang::InvalidListenerException ); 167cdf0e10cSrcweir 168cdf0e10cSrcweir //------------------------------------------------------------------------- 169cdf0e10cSrcweir 170cdf0e10cSrcweir // DocMerge from idl: method com::sun::star::lang::XConnectionPoint::unadvise 171cdf0e10cSrcweir /** terminates a notification previously set up with advise. 172cdf0e10cSrcweir 173cdf0e10cSrcweir <p>A few <code>remove...Listener</code> methods need additional 174cdf0e10cSrcweir parameters to add listeners or throw exceptions. One of these methods 175cdf0e10cSrcweir is <member scope="com::sun::star::beans">XPropertySet::removePropertyChangeListener</member>. 176cdf0e10cSrcweir We ignore the problem in this interface. A solution must be 177cdf0e10cSrcweir provided in an additional <type>XConnectionPoint</type> interface. </p> 178cdf0e10cSrcweir 179cdf0e10cSrcweir @param listener 180cdf0e10cSrcweir specifies the listener interface on the client's advise sink. 181cdf0e10cSrcweir 182cdf0e10cSrcweir @see com::sun::star::beans::XPropertySet::removePropertyChangeListener 183cdf0e10cSrcweir */ 184cdf0e10cSrcweir void unadvise( [in] com::sun::star::uno::XInterface xListener ); 185cdf0e10cSrcweir 186cdf0e10cSrcweir //------------------------------------------------------------------------- 187cdf0e10cSrcweir 188cdf0e10cSrcweir // DocMerge from idl: method com::sun::star::lang::XConnectionPoint::getConnections 189cdf0e10cSrcweir /** @returns 190cdf0e10cSrcweir a sequence of all currently advised connections. 191cdf0e10cSrcweir */ 192cdf0e10cSrcweir sequence<com::sun::star::uno::XInterface> getConnections(); 193cdf0e10cSrcweir 194cdf0e10cSrcweir}; 195cdf0e10cSrcweir 196cdf0e10cSrcweir//============================================================================= 197cdf0e10cSrcweir 198cdf0e10cSrcweir}; }; }; }; 199cdf0e10cSrcweir 200cdf0e10cSrcweir#endif 201