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_XContainerWindowEventHandler_idl__
25#define __com_sun_star_awt_XContainerWindowEventHandler_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30#ifndef __com_sun_star_awt_XWindow_idl__
31#include <com/sun/star/awt/XWindow.idl>
32#endif
33#ifndef __com_sun_star_lang_WrappedTargetException_idl__
34#include <com/sun/star/lang/WrappedTargetException.idl>
35#endif
36
37
38//=============================================================================
39
40module com { module sun { module star { module awt {
41
42//=============================================================================
43
44/** Handles events fired by windows represented by a
45    <type scope="com::sun::star::awt">XWindow</type> interface.
46 */
47published interface XContainerWindowEventHandler : ::com::sun::star::uno::XInterface {
48
49    //-------------------------------------------------------------------------
50
51    /** Handles an event generated by a window.
52
53        The implementation must be aware that the EventObject argument contains types
54        which it is not prepared to handle. Similarly this applies for the MethodName
55        argument. In this case the method should simply return false.
56
57        @param xWindow
58            the window instance that generated the event. If used in the scope of
59            <type scope="com::sun::star::awt">XContainerWindowProvider</type> this
60            is the same window instance that was returned by the createContainerWindow
61            method when passing the XContainerWindowEventHandler instance receiving the
62            event as handler parameter.
63
64        @param EventObject
65            an object describing the event which occurred in the window or anything else that
66            provides additional information for the event.
67            If the event was caused by the window or any of the controls which it contains
68            then the any should contain an object derived from
69            <type scope="com::sun::star::lang">EventObject</type>. Typically this would be one
70            of the several com::sun::star::awt::*Event types.
71
72        @param MethodName
73            the name of the function which is to be called.
74
75        @returns
76            true if the event was handled, otherwise false.
77
78        @throws com::sun::star::lang::WrappedTargetException
79            if the implementation of the method, which is determined by the argument MethodName,
80            throws an exception. This exception is then wrapped into a
81            <type scope="com::sun::star::lang">WrappedTargetException</type>.
82
83     */
84    boolean callHandlerMethod(
85        [in] com::sun::star::awt::XWindow xWindow,
86        [in] any EventObject,
87        [in] string MethodName)
88        raises(com::sun::star::lang::WrappedTargetException);
89
90
91    /** returns a sequence of supported method names
92
93        @returns
94            all method names that will be accepted in calls to callHandlerMethod.
95     */
96    sequence<string> getSupportedMethodNames();
97};
98
99//=============================================================================
100
101}; }; }; };
102
103#endif
104