1*d1766043SAndrew Rist/**************************************************************
2*d1766043SAndrew Rist *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_document_XDocumentEventBroadcaster_idl__
25cdf0e10cSrcweir#define __com_sun_star_document_XDocumentEventBroadcaster_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_frame_XController2_idl__
28cdf0e10cSrcweir#include <com/sun/star/frame/XController2.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir#ifndef __com_sun_star_document_DocumentEvent_idl__
32cdf0e10cSrcweir#include <com/sun/star/document/DocumentEvent.idl>
33cdf0e10cSrcweir#endif
34cdf0e10cSrcweir
35cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
36cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
37cdf0e10cSrcweir#endif
38cdf0e10cSrcweir
39cdf0e10cSrcweir#ifndef __com_sun_star_lang_NoSupportException_idl__
40cdf0e10cSrcweir#include <com/sun/star/lang/NoSupportException.idl>
41cdf0e10cSrcweir#endif
42cdf0e10cSrcweir
43cdf0e10cSrcweir//=============================================================================
44cdf0e10cSrcweir
45cdf0e10cSrcweirmodule com { module sun { module star { module document {
46cdf0e10cSrcweir
47cdf0e10cSrcweirpublished interface XDocumentEventListener;
48cdf0e10cSrcweir
49cdf0e10cSrcweir//=============================================================================
50cdf0e10cSrcweir
51cdf0e10cSrcweir/** allows to be notified of events happening in an <type>OfficeDocument</type>, and to cause notification
52cdf0e10cSrcweir    of such events.
53cdf0e10cSrcweir
54cdf0e10cSrcweir    <p>This interface is the successor of the XEventBroadcaster interface, which should not be used
55cdf0e10cSrcweir    anymore.</p>
56cdf0e10cSrcweir
57cdf0e10cSrcweir    @see DocumentEvent
58cdf0e10cSrcweir    @since OOo 3.1
59cdf0e10cSrcweir*/
60cdf0e10cSrcweirpublished interface XDocumentEventBroadcaster
61cdf0e10cSrcweir{
62cdf0e10cSrcweir    /** registers a listener which is notified about document events
63cdf0e10cSrcweir
64cdf0e10cSrcweir        @param _Listener
65cdf0e10cSrcweir            the listener to register. The behaviour of the method is undefined this listener
66cdf0e10cSrcweir            is <NULL/>.
67cdf0e10cSrcweir    */
68cdf0e10cSrcweir    void    addDocumentEventListener( [in] XDocumentEventListener _Listener );
69cdf0e10cSrcweir
70cdf0e10cSrcweir    /** revokes a listener which has previously been registered to be notified about document events.
71cdf0e10cSrcweir
72cdf0e10cSrcweir        @param _Listener
73cdf0e10cSrcweir            the listener to revoke. The behaviour of the method is undefined this listener
74cdf0e10cSrcweir            is <NULL/>.
75cdf0e10cSrcweir    */
76cdf0e10cSrcweir    void    removeDocumentEventListener( [in] XDocumentEventListener _Listener );
77cdf0e10cSrcweir
78cdf0e10cSrcweir    /** causes the broadcaster to notify all registered listeners of the given event
79cdf0e10cSrcweir
80cdf0e10cSrcweir        <p>The method will create a <type>DocumentEvent</type> instance with the given parameters,
81cdf0e10cSrcweir        and fill in the <code>Source</code> member (denoting the broadcaster) as appropriate.</p>
82cdf0e10cSrcweir
83cdf0e10cSrcweir        <p>Whether the actual notification happens synchronously or asynchronously is up to the
84cdf0e10cSrcweir        implementator of this method. However, implementations are encouraged to specify this, for the
85cdf0e10cSrcweir        list of supported event types, in their service contract.</p>
86cdf0e10cSrcweir
87cdf0e10cSrcweir        <p>Implementations might also decide to limit the list of allowed events (means event names) at
88cdf0e10cSrcweir        their own discretion. Again, in this case they're encouraged to document this in their service
89cdf0e10cSrcweir        contract.</p>
90cdf0e10cSrcweir
91cdf0e10cSrcweir        @param _EventName
92cdf0e10cSrcweir            the name of the event to be notified.
93cdf0e10cSrcweir        @param _ViewController
94cdf0e10cSrcweir            the view/controller which the event applies to. May be <NULL/>
95cdf0e10cSrcweir        @param _Supplement
96cdf0e10cSrcweir            supplemental information related to the event.
97cdf0e10cSrcweir
98cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
99cdf0e10cSrcweir            if <arg>_EventName</arg> is empty, or if <arg>_EventName</arg> is not supported by the
100cdf0e10cSrcweir            document implementation.
101cdf0e10cSrcweir
102cdf0e10cSrcweir        @throws ::com::sun::star::lang::NoSupportException
103cdf0e10cSrcweir            if the broadcaster implementation does not supported broadcasting events induced externally.
104cdf0e10cSrcweir            This is usually used for components which multiplex events from multiple sources, and thus would
105cdf0e10cSrcweir            be unable to fill in the <code>Source</code> member of the <type>DocumentEvent</type> instance.
106cdf0e10cSrcweir    */
107cdf0e10cSrcweir    void    notifyDocumentEvent(
108cdf0e10cSrcweir                [in] string _EventName,
109cdf0e10cSrcweir                [in] ::com::sun::star::frame::XController2 _ViewController,
110cdf0e10cSrcweir                [in] any _Supplement
111cdf0e10cSrcweir            )
112cdf0e10cSrcweir            raises ( ::com::sun::star::lang::IllegalArgumentException,
113cdf0e10cSrcweir                     ::com::sun::star::lang::NoSupportException );
114cdf0e10cSrcweir};
115cdf0e10cSrcweir
116cdf0e10cSrcweir//=============================================================================
117cdf0e10cSrcweir
118cdf0e10cSrcweir}; }; }; };
119cdf0e10cSrcweir
120cdf0e10cSrcweir//=============================================================================
121cdf0e10cSrcweir
122cdf0e10cSrcweir#endif
123