1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
29 <p>This interface is the successor of the XEventBroadcaster interface, which should not be used
35 interface XDocumentEventBroadcaster
37 /** registers a listener which is notified about document events
40 the listener to register. The behavior of the method is undefined this listener
43 void addDocumentEventListener
( [in] XDocumentEventListener Listener
);
45 /** revokes a listener which has previously been registered to be notified about document events.
48 the listener to revoke. The behavior of the method is undefined this listener
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
67 the name of the event to be notified.
69 the view/controller which the event applies to. May be `NULL`
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
,
87 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
,
88 ::com
::sun
::star
::lang
::NoSupportException
);
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */