1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XKeyHandler.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_awt_XKeyHandler_idl__
32 #define __com_sun_star_awt_XKeyHandler_idl__
34 #ifndef __com_sun_star_lang_XEventListener_idl__
35 #include
<com
/sun
/star
/lang
/XEventListener.idl
>
38 #ifndef __com_sun_star_awt_KeyEvent_idl__
39 #include
<com
/sun
/star
/awt
/KeyEvent.idl
>
43 module com
{ module sun
{ module star
{ module awt
{
45 /** This key handler is similar to <type
46 scope="::com::sun::star::awt">XKeyListener</type> but allows the
47 consumption of key events. If a key event is consumed by one
48 handler both the following handlers, with respect to the list of key
49 handlers of the broadcaster, and a following handling by the
50 broadcaster will not take place.
54 published
interface XKeyHandler
: ::com
::sun
::star
::lang
::XEventListener
56 /** This function is called by the broadcaster, an <type
57 scope="::com::sun::star::awt">XExtendedToolkit</type> for
58 instance, after a key has been pressed but before it is released.
59 The return value decides about whether other handlers will be
60 called and a handling by the broadcaster will take place.
62 <p>Consume the event if the action performed by the implementation
63 is mutually exclusive with the default action of the broadcaster or,
64 when known, with that of other handlers.</p>
66 <p>Consuming this event does not prevent the pending key-release
67 event from beeing broadcasted.</p>
70 The key event informs about the pressed key.
72 When <FALSE/> is returned the other handlers are called and a
73 following handling of the event by the broadcaster takes place.
74 Otherwise, when <TRUE/> is returned, no other handler will be
75 called and the broadcaster will take no further actions
78 boolean keyPressed
([in] com
::sun
::star
::awt
::KeyEvent aEvent
);
80 /** This function is called by the broadcaster, an <type
81 scope="::com::sun::star::awt">XExtendedToolkit</type> for
82 instance, after a key has been pressed and released. The return
83 value decides about whether other handlers will be called and a
84 handling by the broadcaster will take place.
86 <p>Consume the event if the action performed by the implementation
87 is mutualy exclusive with the default action of the broadcaster or,
88 when known, with that of other handlers.</p>
91 The key event informs about the pressed key.
93 When <FALSE/> is returned the other handlers are called and a
94 following handling of the event by the broadcaster takes place.
95 Otherwise, when <TRUE/> is returned, no other handler will be
96 called and the broadcaster will take no further actions
99 boolean keyReleased
([in] com
::sun
::star
::awt
::KeyEvent aEvent
);