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 .
20 module com
{ module sun
{ module star
{ module ui
{
22 /** Provide a central access point for a group of events.
24 Listeners can be added with a simple restriction on the event source.
25 They are only called for events that originate at the specified source.
27 Event providers can broadcast an event to all interested listeners.
29 The XEventMultiplexer interface is typically implemented as a singleton
31 interface XContextChangeEventMultiplexer
: ::com
::sun
::star
::uno
::XInterface
33 /** Add an event listener that is called only when events are broadcast for the specified
37 An empty reference results in an InvalidArgumentException.
39 One listener may be added more than once for different
40 event foci. Adding a listener a second time for the same
41 event focus results in an InvalidArgumentException.
44 An empty reference is a valid value. In this case the
45 registered listener will be called for every event
46 broadcast, regardless of its event focus.
48 The event focus may or may not be the source of the event.
50 A typical example for an event focus is the XController of
51 a view. Using an XController restricts events passed to
52 a listener to events that belong to one view.
54 @throws com::sun::star::lang::IllegalArgumentException
57 void addContextChangeEventListener
(
58 [in] com
::sun
::star
::ui
::XContextChangeEventListener xListener
,
59 [in] com
::sun
::star
::uno
::XInterface xEventFocus
)
60 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
62 /** Remove an event listener for the specified event focus.
64 When the same listener was added for other event foci then
65 these associations remain unmodified.
68 An empty reference results in an InvalidArgumentException.
70 When the listener is not registered for the given event
71 focus then an InvalidArgumentException is thrown.
74 The listener is only removed for this event focus.
75 An empty reference is a valid value.
77 @throws com::sun::star::lang::IllegalArgumentException
79 void removeContextChangeEventListener
(
80 [in] com
::sun
::star
::ui
::XContextChangeEventListener xListener
,
81 [in] com
::sun
::star
::uno
::XInterface xEventFocus
)
82 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
84 /** Remove an event listener for all event foci.
87 An empty reference results in an InvalidArgumentException.
89 It is not an error when the listener is not registered for any event focus.
91 @throws com::sun::star::lang::IllegalArgumentException
93 void removeAllContextChangeEventListeners
(
94 [in] com
::sun
::star
::ui
::XContextChangeEventListener xListener
)
95 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
98 /** Call all event listeners that were added for the specified event focus.
100 void broadcastContextChangeEvent
(
101 [in] com
::sun
::star
::ui
::ContextChangeEventObject aEvent
,
102 [in] com
::sun
::star
::uno
::XInterface xEventFocus
);
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */