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