1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_lang_XConnectionPoint_idl__
24#define __com_sun_star_lang_XConnectionPoint_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_lang_XConnectionPointContainer_idl__
31#include <com/sun/star/lang/XConnectionPointContainer.idl>
32#endif
33
34#ifndef __com_sun_star_lang_ListenerExistException_idl__
35#include <com/sun/star/lang/ListenerExistException.idl>
36#endif
37
38#ifndef __com_sun_star_lang_InvalidListenerException_idl__
39#include <com/sun/star/lang/InvalidListenerException.idl>
40#endif
41
42
43//=============================================================================
44
45module com {  module sun {  module star {  module lang {
46
47//=============================================================================
48
49// DocMerge from idl: interface com::sun::star::lang::XConnectionPoint
50/** supports connection points for connectable objects.
51
52	<p>Connectable objects support the following features: </p>
53
54	<ul>
55		<li>outgoing interfaces, such as event sets; </li>
56		<li>the ability to enumerate the types of the outgoing interfaces;
57		<li>the ability to connect and disconnect sinks to the object
58			for those outgoing types; </li>
59		<li>the ability to enumerate the connections that exist to a
60			particular outgoing interface.  </li>
61	</ul>
62
63	<h4>When to Implement?<h4>
64
65	<p>To create a connectable object, you need to implement objects
66	that provide two related interfaces: </p>
67
68	<ul>
69		<li><type>XConnectionPointContainer</type> </li>
70		<li><type>XConnectionPoint</type> </li>
71	</ul>
72
73	<p>The <type>XConnectionPointContainer</type> interface is implemented
74	on the connectable object to indicate the existence of the outgoing
75	interfaces. It provides a sequence of sub-objects.  It also provides
76	access to all the connection point sub-objects, each of which
77	implements the <type>XConnectionPoint</type> interface. The
78	<type>XConnectionPoint</type> interface provides a sequence of
79	sub-objects.  </p>
80
81	<p>Each connection point is a separate sub-object to avoid circular
82	reference counting problems.  A connection point controls how many
83	connections (one or more) it will allow in its implementation of
84	<member>XConnectionPoint::advise()</member>.  </p>
85
86	<h4>When to use?</h4>
87
88	<p>A client can use the <type>XConnectionPointContainer</type> interface: </p>
89
90	<UL>
91
92		<LI>to get a sequence of connection points for each outgoing type. </LI>
93
94		<LI>to obtain access to connection point sub-objects with the
95			<type>XConnectionPoint</type> interface for each
96			outgoing type. Through the XConnectionPoint interface,
97			a client starts or terminates an advisory loop with the
98			connectable object and the client's own sink.  The
99			client can also use the <type>XConnectionPoint</type>
100			interface to get a sequence of the connections that it
101			knows about. </LI>
102	</UL>
103
104	@see		XConnectionPointContainer
105 */
106published interface XConnectionPoint: com::sun::star::uno::XInterface
107{
108	//-------------------------------------------------------------------------
109
110	// DocMerge from idl: method com::sun::star::lang::XConnectionPoint::getConnectionType
111	/** @returns
112				the type of the outgoing interface managed by this
113				connection point.
114
115		<p>Using the <member>XConnectionPointContainer::getConnectionPoints</member>
116		method, a client can obtain an <type>XConnectionPoint</type>
117		interface.  Using that interface and this method, the client
118		can determine the type of each connection point enumerated. The
119		type returned from this method must enable the caller to access
120		this same connection point through
121		<member>XConnectionPointContainer::findConnectionPoint</member>.
122
123		@see XConnectionPointContainer::findConnectionPoint
124	 */
125	type getConnectionType();
126
127	//-------------------------------------------------------------------------
128
129	// DocMerge from idl: method com::sun::star::lang::XConnectionPoint::getConnectionPointContainer
130	/** @returns
131			the <type>XConnectionPointContainer</type> interface on
132			the parent connectable object.
133
134		@see XConnectionPointContainer
135	 */
136	com::sun::star::lang::XConnectionPointContainer getConnectionPointContainer();
137
138	//-------------------------------------------------------------------------
139
140	// DocMerge from idl: method com::sun::star::lang::XConnectionPoint::advise
141	/** creates a connection between a connection point and a
142		client's sink, where the sink implements the outgoing interface
143		supported by this connection point.
144
145		<p>A few <code>add...Listener</code> methods need additional parameters
146		to add listeners or throw exceptions. One of these methods is
147		<member scope="com::sun::star::beans">XPropertySet::addPropertyChangeListener</member>.
148		We ignore the problem in this interface. A solution must be provided
149		in an additional <type>XConnectionPoint</type> interface.  </p>
150
151		@param xListener
152			specifies the listener interface on the client's advise sink.
153			The client's sink receives outgoing calls from the
154			connection point container.
155
156		@throws ListenerExistException
157			if it is a unicast broadcaster and a listener is already set.
158
159		@throws InvalidListenerException
160			if the listener does not supply the needed interfaces.
161
162		@see com::sun::star::beans::XPropertySet::addPropertyChangeListener
163	 */
164	void advise( [in] com::sun::star::uno::XInterface xListener )
165			raises( com::sun::star::lang::ListenerExistException,
166					com::sun::star::lang::InvalidListenerException );
167
168	//-------------------------------------------------------------------------
169
170	// DocMerge from idl: method com::sun::star::lang::XConnectionPoint::unadvise
171	/** terminates a notification previously set up with advise.
172
173		<p>A few <code>remove...Listener</code> methods need additional
174		parameters to add listeners or throw exceptions. One of these methods
175		is <member scope="com::sun::star::beans">XPropertySet::removePropertyChangeListener</member>.
176		We ignore the problem in this interface. A solution must be
177		provided in an additional <type>XConnectionPoint</type> interface.  </p>
178
179		@param listener
180			specifies the listener interface on the client's advise sink.
181
182		@see com::sun::star::beans::XPropertySet::removePropertyChangeListener
183	 */
184	void unadvise( [in] com::sun::star::uno::XInterface xListener );
185
186	//-------------------------------------------------------------------------
187
188	// DocMerge from idl: method com::sun::star::lang::XConnectionPoint::getConnections
189	/** @returns
190				a sequence of all currently advised connections.
191	 */
192	sequence<com::sun::star::uno::XInterface> getConnections();
193
194};
195
196//=============================================================================
197
198}; }; }; };
199
200#endif
201