1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3*cdf0e10cSrcweir *
4*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
5*cdf0e10cSrcweir *
6*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
7*cdf0e10cSrcweir *
8*cdf0e10cSrcweir * This file is part of OpenOffice.org.
9*cdf0e10cSrcweir *
10*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
11*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
12*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
13*cdf0e10cSrcweir *
14*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
15*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
16*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
18*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
19*cdf0e10cSrcweir *
20*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
21*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
22*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
23*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
24*cdf0e10cSrcweir *
25*cdf0e10cSrcweir************************************************************************/
26*cdf0e10cSrcweir
27*cdf0e10cSrcweir#ifndef __com_sun_star_document_XDocumentEventBroadcaster_idl__
28*cdf0e10cSrcweir#define __com_sun_star_document_XDocumentEventBroadcaster_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XController2_idl__
31*cdf0e10cSrcweir#include <com/sun/star/frame/XController2.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_document_DocumentEvent_idl__
35*cdf0e10cSrcweir#include <com/sun/star/document/DocumentEvent.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
39*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_lang_NoSupportException_idl__
43*cdf0e10cSrcweir#include <com/sun/star/lang/NoSupportException.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir//=============================================================================
47*cdf0e10cSrcweir
48*cdf0e10cSrcweirmodule com { module sun { module star { module document {
49*cdf0e10cSrcweir
50*cdf0e10cSrcweirpublished interface XDocumentEventListener;
51*cdf0e10cSrcweir
52*cdf0e10cSrcweir//=============================================================================
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir/** allows to be notified of events happening in an <type>OfficeDocument</type>, and to cause notification
55*cdf0e10cSrcweir    of such events.
56*cdf0e10cSrcweir
57*cdf0e10cSrcweir    <p>This interface is the successor of the XEventBroadcaster interface, which should not be used
58*cdf0e10cSrcweir    anymore.</p>
59*cdf0e10cSrcweir
60*cdf0e10cSrcweir    @see DocumentEvent
61*cdf0e10cSrcweir    @since OOo 3.1
62*cdf0e10cSrcweir*/
63*cdf0e10cSrcweirpublished interface XDocumentEventBroadcaster
64*cdf0e10cSrcweir{
65*cdf0e10cSrcweir    /** registers a listener which is notified about document events
66*cdf0e10cSrcweir
67*cdf0e10cSrcweir        @param _Listener
68*cdf0e10cSrcweir            the listener to register. The behaviour of the method is undefined this listener
69*cdf0e10cSrcweir            is <NULL/>.
70*cdf0e10cSrcweir    */
71*cdf0e10cSrcweir    void    addDocumentEventListener( [in] XDocumentEventListener _Listener );
72*cdf0e10cSrcweir
73*cdf0e10cSrcweir    /** revokes a listener which has previously been registered to be notified about document events.
74*cdf0e10cSrcweir
75*cdf0e10cSrcweir        @param _Listener
76*cdf0e10cSrcweir            the listener to revoke. The behaviour of the method is undefined this listener
77*cdf0e10cSrcweir            is <NULL/>.
78*cdf0e10cSrcweir    */
79*cdf0e10cSrcweir    void    removeDocumentEventListener( [in] XDocumentEventListener _Listener );
80*cdf0e10cSrcweir
81*cdf0e10cSrcweir    /** causes the broadcaster to notify all registered listeners of the given event
82*cdf0e10cSrcweir
83*cdf0e10cSrcweir        <p>The method will create a <type>DocumentEvent</type> instance with the given parameters,
84*cdf0e10cSrcweir        and fill in the <code>Source</code> member (denoting the broadcaster) as appropriate.</p>
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir        <p>Whether the actual notification happens synchronously or asynchronously is up to the
87*cdf0e10cSrcweir        implementator of this method. However, implementations are encouraged to specify this, for the
88*cdf0e10cSrcweir        list of supported event types, in their service contract.</p>
89*cdf0e10cSrcweir
90*cdf0e10cSrcweir        <p>Implementations might also decide to limit the list of allowed events (means event names) at
91*cdf0e10cSrcweir        their own discretion. Again, in this case they're encouraged to document this in their service
92*cdf0e10cSrcweir        contract.</p>
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir        @param _EventName
95*cdf0e10cSrcweir            the name of the event to be notified.
96*cdf0e10cSrcweir        @param _ViewController
97*cdf0e10cSrcweir            the view/controller which the event applies to. May be <NULL/>
98*cdf0e10cSrcweir        @param _Supplement
99*cdf0e10cSrcweir            supplemental information related to the event.
100*cdf0e10cSrcweir
101*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
102*cdf0e10cSrcweir            if <arg>_EventName</arg> is empty, or if <arg>_EventName</arg> is not supported by the
103*cdf0e10cSrcweir            document implementation.
104*cdf0e10cSrcweir
105*cdf0e10cSrcweir        @throws ::com::sun::star::lang::NoSupportException
106*cdf0e10cSrcweir            if the broadcaster implementation does not supported broadcasting events induced externally.
107*cdf0e10cSrcweir            This is usually used for components which multiplex events from multiple sources, and thus would
108*cdf0e10cSrcweir            be unable to fill in the <code>Source</code> member of the <type>DocumentEvent</type> instance.
109*cdf0e10cSrcweir    */
110*cdf0e10cSrcweir    void    notifyDocumentEvent(
111*cdf0e10cSrcweir                [in] string _EventName,
112*cdf0e10cSrcweir                [in] ::com::sun::star::frame::XController2 _ViewController,
113*cdf0e10cSrcweir                [in] any _Supplement
114*cdf0e10cSrcweir            )
115*cdf0e10cSrcweir            raises ( ::com::sun::star::lang::IllegalArgumentException,
116*cdf0e10cSrcweir                     ::com::sun::star::lang::NoSupportException );
117*cdf0e10cSrcweir};
118*cdf0e10cSrcweir
119*cdf0e10cSrcweir//=============================================================================
120*cdf0e10cSrcweir
121*cdf0e10cSrcweir}; }; }; };
122*cdf0e10cSrcweir
123*cdf0e10cSrcweir//=============================================================================
124*cdf0e10cSrcweir
125*cdf0e10cSrcweir#endif
126