1 /*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * Copyright 2008 by Sun Microsystems, Inc.
6 * OpenOffice.org - a multi-platform office productivity suite
8 * $RCSfile: XDocumentEventBroadcaster.idl,v $
10 * $Revision: 1.5.2.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
28 ************************************************************************/
30 #ifndef __com_sun_star_document_XDocumentEventBroadcaster_idl__
31 #define __com_sun_star_document_XDocumentEventBroadcaster_idl__
33 #ifndef __com_sun_star_frame_XController2_idl__
34 #include
<com
/sun
/star
/frame
/XController2.idl
>
37 #ifndef __com_sun_star_document_DocumentEvent_idl__
38 #include
<com
/sun
/star
/document
/DocumentEvent.idl
>
41 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
42 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
45 #ifndef __com_sun_star_lang_NoSupportException_idl__
46 #include
<com
/sun
/star
/lang
/NoSupportException.idl
>
49 //=============================================================================
51 module com
{ module sun
{ module star
{ module document
{
53 interface XDocumentEventListener
;
55 //=============================================================================
57 /** allows to be notified of events happening in an <type>OfficeDocument</type>, and to cause notification
60 <p>This interface is the successor of the XEventBroadcaster interface, which should not be used
65 interface XDocumentEventBroadcaster
67 /** registers a listener which is notified about document events
70 the listener to register. The behaviour of the method is undefined this listener
73 void addDocumentEventListener
( [in] XDocumentEventListener _Listener
);
75 /** revokes a listener which has previously been registered to be notified about document events.
78 the listener to revoke. The behaviour of the method is undefined this listener
81 void removeDocumentEventListener
( [in] XDocumentEventListener _Listener
);
83 /** causes the broadcaster to notify all registered listeners of the given event
85 <p>The method will create a <type>DocumentEvent</type> instance with the given parameters,
86 and fill in the <code>Source</code> member (denoting the broadcaster) as appropriate.</p>
88 <p>Whether the actual notification happens synchronously or asynchronously is up to the
89 implementator of this method. However, implementations are encouraged to specify this, for the
90 list of supported event types, in their service contract.</p>
92 <p>Implementations might also decide to limit the list of allowed events (means event names) at
93 their own discretion. Again, in this case they're encouraged to document this in their service
97 the name of the event to be notified.
98 @param _ViewController
99 the view/controller which the event applies to. May be <NULL/>
101 supplemental information related to the event.
103 @throws ::com::sun::star::lang::IllegalArgumentException
104 if <arg>_EventName</arg> is empty, or if <arg>_EventName</arg> is not supported by the
105 document implementation.
107 @throws ::com::sun::star::lang::NoSupportException
108 if the broadcaster implementation does not supported broadcasting events induced externally.
109 This is usually used for components which multiplex events from multiple sources, and thus would
110 be unable to fill in the <code>Source</code> member of the <type>DocumentEvent</type> instance.
112 void notifyDocumentEvent
(
113 [in] string _EventName
,
114 [in] ::com
::sun
::star
::frame
::XController2 _ViewController
,
117 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
,
118 ::com
::sun
::star
::lang
::NoSupportException
);
121 //=============================================================================
125 //=============================================================================