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