xref: /aoo41x/main/offapi/com/sun/star/awt/XKeyHandler.idl (revision d1e7efc3)
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_awt_XKeyHandler_idl__
25#define __com_sun_star_awt_XKeyHandler_idl__
26
27#ifndef __com_sun_star_lang_XEventListener_idl__
28#include <com/sun/star/lang/XEventListener.idl>
29#endif
30
31#ifndef __com_sun_star_awt_KeyEvent_idl__
32#include <com/sun/star/awt/KeyEvent.idl>
33#endif
34
35
36module com {  module sun {  module star {  module awt {
37
38/** This key handler is similar to <type
39    scope="::com::sun::star::awt">XKeyListener</type> but allows the
40    consumption of key events.  If a key event is consumed by one
41    handler both the following handlers, with respect to the list of key
42    handlers of the broadcaster, and a following handling by the
43    broadcaster will not take place.
44
45    @since OpenOffice 1.1.2
46*/
47published interface XKeyHandler : ::com::sun::star::lang::XEventListener
48{
49    /** This function is called by the broadcaster, an <type
50        scope="::com::sun::star::awt">XExtendedToolkit</type> for
51        instance, after a key has been pressed but before it is released.
52        The return value decides about whether other handlers will be
53        called and a handling by the broadcaster will take place.
54
55        <p>Consume the event if the action performed by the implementation
56        is mutually exclusive with the default action of the broadcaster or,
57        when known, with that of other handlers.</p>
58
59        <p>Consuming this event does not prevent the pending key-release
60        event from beeing broadcasted.</p>
61
62        @param aEvent
63            The key event informs about the pressed key.
64        @return
65            When <FALSE/> is returned the other handlers are called and a
66            following handling of the event by the broadcaster takes place.
67            Otherwise, when <TRUE/> is returned, no other handler will be
68            called and the broadcaster will take no further actions
69            regarding the event.
70    */
71	boolean keyPressed ([in] com::sun::star::awt::KeyEvent aEvent);
72
73    /** This function is called by the broadcaster, an <type
74        scope="::com::sun::star::awt">XExtendedToolkit</type> for
75        instance, after a key has been pressed and released.  The return
76        value decides about whether other handlers will be called and a
77        handling by the broadcaster will take place.
78
79        <p>Consume the event if the action performed by the implementation
80        is mutualy exclusive with the default action of the broadcaster or,
81        when known, with that of other handlers.</p>
82
83        @param aEvent
84            The key event informs about the pressed key.
85        @return
86            When <FALSE/> is returned the other handlers are called and a
87            following handling of the event by the broadcaster takes place.
88            Otherwise, when <TRUE/> is returned, no other handler will be
89            called and the broadcaster will take no further actions
90            regarding the event.
91    */
92	boolean keyReleased ([in] com::sun::star::awt::KeyEvent aEvent);
93};
94
95}; }; }; };
96
97#endif
98