1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24#ifndef __com_sun_star_ui_XContextChangeEventMultiplexer_idl__ 25#define __com_sun_star_ui_XContextChangeEventMultiplexer_idl__ 26 27#ifndef __com_sun_star_uno_XInterface_idl__ 28#include <com/sun/star/uno/XInterface.idl> 29#endif 30 31#ifndef __com_sun_star_ui_XContextChangeEventListener_idl__ 32#include <com/sun/star/ui/XContextChangeEventListener.idl> 33#endif 34 35#ifndef __com_sun_star_ui_ContextChangeEventObject_idl__ 36#include <com/sun/star/ui/ContextChangeEventObject.idl> 37#endif 38 39#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 40#include <com/sun/star/lang/IllegalArgumentException.idl> 41#endif 42 43 44module com { module sun { module star { module ui { 45 46/** Provide a central access point for a group of events. 47 48 Listeners can be added with a simple restriction on the event source. 49 They are only called for events that originate at the specified source. 50 51 Event providers can broadcast an event to all interested listeners. 52 53 The XEventMultiplexer interface is typically implemented as a singleton 54*/ 55interface XContextChangeEventMultiplexer : ::com::sun::star::uno::XInterface 56{ 57 /** Add an event listener that is called only when events are broadcast for the specified 58 event focus. 59 60 @param xListener 61 An empty reference results in an InvalidArgumentException. 62 63 One listener may be added more than once for different 64 event foci. Adding a listener a second time for the same 65 event focus results in an InvalidArgumentException. 66 67 @param xEventFocus 68 An empty reference is a valid value. In this case the 69 registered listener will be called for every event 70 broadcast, regardless of its event focus. 71 72 The event focus may or may not be the source of the event. 73 74 A typical example for an event focus is the XController of 75 a view. Using an XController restricts events passed to 76 a listener to events that belong to one view. 77 78 @throws com::sun::star::lang::IllegalArgumentException 79 80 */ 81 void addContextChangeEventListener ( 82 [in] com::sun::star::ui::XContextChangeEventListener xListener, 83 [in] com::sun::star::uno::XInterface xEventFocus) 84 raises (com::sun::star::lang::IllegalArgumentException); 85 86 /** Remove an event listener for the specified event focus. 87 88 When the same listener was added for other event foci then 89 these associations remain unmodified. 90 91 @param xListener 92 An empty reference results in an InvalidArgumentException. 93 94 When the listener is not registered for the given event 95 focus then an InvalidArgumentException is thrown. 96 97 @param xEventFocus 98 The listener is only removed for this event focus. 99 An empty reference is a valid value. 100 101 @throws com::sun::star::lang::IllegalArgumentException 102 */ 103 void removeContextChangeEventListener ( 104 [in] com::sun::star::ui::XContextChangeEventListener xListener, 105 [in] com::sun::star::uno::XInterface xEventFocus) 106 raises (com::sun::star::lang::IllegalArgumentException); 107 108 /** Remove an event listener for all event foci. 109 110 @param xListener 111 An empty reference results in an InvalidArgumentException. 112 113 It is not an error when the listener is not registered for any event focus. 114 115 @throws com::sun::star::lang::IllegalArgumentException 116 */ 117 void removeAllContextChangeEventListeners ( 118 [in] com::sun::star::ui::XContextChangeEventListener xListener) 119 raises (com::sun::star::lang::IllegalArgumentException); 120 121 122 /** Call all event listeners that where added for the specified event focus. 123 */ 124 [oneway] void broadcastContextChangeEvent ( 125 [in] com::sun::star::ui::ContextChangeEventObject aEvent, 126 [in] com::sun::star::uno::XInterface xEventFocus); 127} ; 128 129} ; } ; } ; } ; 130 131#endif 132