cid#1607171 Data race condition
[LibreOffice.git] / offapi / com / sun / star / document / XDocumentEventBroadcaster.idl
blob12842b30006dd7998e99e31e4a611d98f8afc24a
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 .
21 module com { module sun { module star { module document {
23 interface XDocumentEventListener;
26 /** allows to be notified of events happening in an OfficeDocument, and to cause notification
27 of such events.
29 <p>This interface is the successor of the XEventBroadcaster interface, which should not be used
30 anymore.</p>
32 @see DocumentEvent
33 @since OOo 3.1
35 interface XDocumentEventBroadcaster
37 /** registers a listener which is notified about document events
39 @param Listener
40 the listener to register. The behavior of the method is undefined this listener
41 is `NULL`.
43 void addDocumentEventListener( [in] XDocumentEventListener Listener );
45 /** revokes a listener which has previously been registered to be notified about document events.
47 @param Listener
48 the listener to revoke. The behavior of the method is undefined this listener
49 is `NULL`.
51 void removeDocumentEventListener( [in] XDocumentEventListener Listener );
53 /** causes the broadcaster to notify all registered listeners of the given event
55 <p>The method will create a DocumentEvent instance with the given parameters,
56 and fill in the <code>Source</code> member (denoting the broadcaster) as appropriate.</p>
58 <p>Whether the actual notification happens synchronously or asynchronously is up to the
59 implementor of this method. However, implementations are encouraged to specify this, for the
60 list of supported event types, in their service contract.</p>
62 <p>Implementations might also decide to limit the list of allowed events (means event names) at
63 their own discretion. Again, in this case they're encouraged to document this in their service
64 contract.</p>
66 @param EventName
67 the name of the event to be notified.
68 @param ViewController
69 the view/controller which the event applies to. May be `NULL`
70 @param Supplement
71 supplemental information related to the event.
73 @throws ::com::sun::star::lang::IllegalArgumentException
74 if EventName is empty, or if EventName is not supported by the
75 document implementation.
77 @throws ::com::sun::star::lang::NoSupportException
78 if the broadcaster implementation does not supported broadcasting events induced externally.
79 This is usually used for components which multiplex events from multiple sources, and thus would
80 be unable to fill in the <code>Source</code> member of the DocumentEvent instance.
82 void notifyDocumentEvent(
83 [in] string EventName,
84 [in] ::com::sun::star::frame::XController2 ViewController,
85 [in] any Supplement
87 raises ( ::com::sun::star::lang::IllegalArgumentException,
88 ::com::sun::star::lang::NoSupportException );
92 }; }; }; };
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */