1d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __com_sun_star_awt_XKeyHandler_idl__ 25cdf0e10cSrcweir#define __com_sun_star_awt_XKeyHandler_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#ifndef __com_sun_star_lang_XEventListener_idl__ 28cdf0e10cSrcweir#include <com/sun/star/lang/XEventListener.idl> 29cdf0e10cSrcweir#endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir#ifndef __com_sun_star_awt_KeyEvent_idl__ 32cdf0e10cSrcweir#include <com/sun/star/awt/KeyEvent.idl> 33cdf0e10cSrcweir#endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir 36cdf0e10cSrcweirmodule com { module sun { module star { module awt { 37cdf0e10cSrcweir 38cdf0e10cSrcweir/** This key handler is similar to <type 39cdf0e10cSrcweir scope="::com::sun::star::awt">XKeyListener</type> but allows the 40cdf0e10cSrcweir consumption of key events. If a key event is consumed by one 41cdf0e10cSrcweir handler both the following handlers, with respect to the list of key 42cdf0e10cSrcweir handlers of the broadcaster, and a following handling by the 43cdf0e10cSrcweir broadcaster will not take place. 44cdf0e10cSrcweir 45d1e7efc3SJürgen Schmidt @since OpenOffice 1.1.2 46cdf0e10cSrcweir*/ 47cdf0e10cSrcweirpublished interface XKeyHandler : ::com::sun::star::lang::XEventListener 48cdf0e10cSrcweir{ 49cdf0e10cSrcweir /** This function is called by the broadcaster, an <type 50cdf0e10cSrcweir scope="::com::sun::star::awt">XExtendedToolkit</type> for 51cdf0e10cSrcweir instance, after a key has been pressed but before it is released. 52cdf0e10cSrcweir The return value decides about whether other handlers will be 53cdf0e10cSrcweir called and a handling by the broadcaster will take place. 54cdf0e10cSrcweir 55cdf0e10cSrcweir <p>Consume the event if the action performed by the implementation 56cdf0e10cSrcweir is mutually exclusive with the default action of the broadcaster or, 57cdf0e10cSrcweir when known, with that of other handlers.</p> 58cdf0e10cSrcweir 59cdf0e10cSrcweir <p>Consuming this event does not prevent the pending key-release 60*2df387e6Smseidel event from being broadcasted.</p> 61cdf0e10cSrcweir 62cdf0e10cSrcweir @param aEvent 63cdf0e10cSrcweir The key event informs about the pressed key. 64cdf0e10cSrcweir @return 65cdf0e10cSrcweir When <FALSE/> is returned the other handlers are called and a 66cdf0e10cSrcweir following handling of the event by the broadcaster takes place. 67cdf0e10cSrcweir Otherwise, when <TRUE/> is returned, no other handler will be 68cdf0e10cSrcweir called and the broadcaster will take no further actions 69cdf0e10cSrcweir regarding the event. 70cdf0e10cSrcweir */ 71cdf0e10cSrcweir boolean keyPressed ([in] com::sun::star::awt::KeyEvent aEvent); 72cdf0e10cSrcweir 73cdf0e10cSrcweir /** This function is called by the broadcaster, an <type 74cdf0e10cSrcweir scope="::com::sun::star::awt">XExtendedToolkit</type> for 75cdf0e10cSrcweir instance, after a key has been pressed and released. The return 76cdf0e10cSrcweir value decides about whether other handlers will be called and a 77cdf0e10cSrcweir handling by the broadcaster will take place. 78cdf0e10cSrcweir 79cdf0e10cSrcweir <p>Consume the event if the action performed by the implementation 80cdf0e10cSrcweir is mutualy exclusive with the default action of the broadcaster or, 81cdf0e10cSrcweir when known, with that of other handlers.</p> 82cdf0e10cSrcweir 83cdf0e10cSrcweir @param aEvent 84cdf0e10cSrcweir The key event informs about the pressed key. 85cdf0e10cSrcweir @return 86cdf0e10cSrcweir When <FALSE/> is returned the other handlers are called and a 87cdf0e10cSrcweir following handling of the event by the broadcaster takes place. 88cdf0e10cSrcweir Otherwise, when <TRUE/> is returned, no other handler will be 89cdf0e10cSrcweir called and the broadcaster will take no further actions 90cdf0e10cSrcweir regarding the event. 91cdf0e10cSrcweir */ 92cdf0e10cSrcweir boolean keyReleased ([in] com::sun::star::awt::KeyEvent aEvent); 93cdf0e10cSrcweir}; 94cdf0e10cSrcweir 95cdf0e10cSrcweir}; }; }; }; 96cdf0e10cSrcweir 97cdf0e10cSrcweir#endif 98