Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / document / XDocumentEventBroadcaster.idl
blob929db7df8eea01df45a65e3ca76e69172886bd5b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_document_XDocumentEventBroadcaster_idl__
21 #define __com_sun_star_document_XDocumentEventBroadcaster_idl__
23 #include <com/sun/star/frame/XController2.idl>
24 #include <com/sun/star/document/DocumentEvent.idl>
25 #include <com/sun/star/lang/IllegalArgumentException.idl>
26 #include <com/sun/star/lang/NoSupportException.idl>
29 module com { module sun { module star { module document {
31 interface XDocumentEventListener;
34 /** allows to be notified of events happening in an OfficeDocument, and to cause notification
35 of such events.
37 <p>This interface is the successor of the XEventBroadcaster interface, which should not be used
38 anymore.</p>
40 @see DocumentEvent
41 @since OOo 3.1
43 interface XDocumentEventBroadcaster
45 /** registers a listener which is notified about document events
47 @param Listener
48 the listener to register. The behavior of the method is undefined this listener
49 is `NULL`.
51 void addDocumentEventListener( [in] XDocumentEventListener Listener );
53 /** revokes a listener which has previously been registered to be notified about document events.
55 @param Listener
56 the listener to revoke. The behavior of the method is undefined this listener
57 is `NULL`.
59 void removeDocumentEventListener( [in] XDocumentEventListener Listener );
61 /** causes the broadcaster to notify all registered listeners of the given event
63 <p>The method will create a DocumentEvent instance with the given parameters,
64 and fill in the <code>Source</code> member (denoting the broadcaster) as appropriate.</p>
66 <p>Whether the actual notification happens synchronously or asynchronously is up to the
67 implementor of this method. However, implementations are encouraged to specify this, for the
68 list of supported event types, in their service contract.</p>
70 <p>Implementations might also decide to limit the list of allowed events (means event names) at
71 their own discretion. Again, in this case they're encouraged to document this in their service
72 contract.</p>
74 @param EventName
75 the name of the event to be notified.
76 @param ViewController
77 the view/controller which the event applies to. May be `NULL`
78 @param Supplement
79 supplemental information related to the event.
81 @throws ::com::sun::star::lang::IllegalArgumentException
82 if EventName is empty, or if EventName is not supported by the
83 document implementation.
85 @throws ::com::sun::star::lang::NoSupportException
86 if the broadcaster implementation does not supported broadcasting events induced externally.
87 This is usually used for components which multiplex events from multiple sources, and thus would
88 be unable to fill in the <code>Source</code> member of the DocumentEvent instance.
90 void notifyDocumentEvent(
91 [in] string EventName,
92 [in] ::com::sun::star::frame::XController2 ViewController,
93 [in] any Supplement
95 raises ( ::com::sun::star::lang::IllegalArgumentException,
96 ::com::sun::star::lang::NoSupportException );
100 }; }; }; };
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */