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_XDialogProvider2_idl__
29#define __com_sun_star_awt_XDialogProvider2_idl__
30
31#ifndef __com_sun_star_awt_XDialogProvider_idl__
32#include <com/sun/star/awt/XDialogProvider.idl>
33#endif
34#ifndef __com_sun_star_beans_NamedValue_idl__
35#include <com/sun/star/beans/NamedValue.idl>
36#endif
37
38
39//=============================================================================
40
41module com { module sun { module star { module awt {
42
43//=============================================================================
44
45/** provides dialogs implementing the
46    <type scope="com::sun::star::awt">XDialog</type> interface.
47 */
48published interface XDialogProvider2 : ::com::sun::star::awt::XDialogProvider {
49
50    //-------------------------------------------------------------------------
51
52    /** creates a dialog for the given URL accepting an Interface used
53        to handle dialog events.
54
55        @param URL
56            is the URL.
57
58        @param xHandler
59            is the interface that will be called to handle the Events that
60            are generated by the dialog (and all controls placed on it) and
61            bound to the handler using a vnd.sun.star.UNO URL specifying a
62            handler method to be called. Usually this will be done directly
63            by the user.
64
65            xHandler can handle events in two different ways:
66
67            1. By supporting the <type scope="com::sun::star::awt">XDialogEventHandler</type> interface.
68            This is a generic interface to accept event notifications.
69
70            2. By providing interfaces that directly implement the handler
71            methods to be called. The XDialogProvider2 implementation then
72            will try to access these events using the
73            <type scope="com::sun::star::beans">Introspection</type>Introspection
74            service. To make this possible the handler implementation also has to
75            support <type scope="com::sun::star::lang">XTypeProvider</type>.
76
77            If XDialogEventHandler is supported XDialogEventHandler.callHandlerMethod()
78            is always called first to handle the event. Only if the event cannot be
79            handled by XDialogEventHandler (callHandlerMethod() then has to return
80            false) or if XDialogEventHandler is not supported at all the Introspection
81            based access will be used.
82
83            The Introspection based access tries to call a method named according to the
84            HandlerMethodName specified by a vnd.sun.star.UNO:<HandlerMethodName> URL.
85            First a method
86
87            void HandlerMethodName( [in] com::sun::star::awt::XDialog xDialog, [in] any aEvent )
88
89            will be searched. The signature is similar to XDialogEventHandler.
90            callHandlerMethod except for MethodName itself that isn't needed
91            here. For more information about these parameters, see
92            <type scope="com::sun::star::awt">XDialogEventHandler</type>.
93
94            If this method is found, it will be called, otherwise a method
95
96            void HandlerMethodName( void )
97
98            will be searched and called.
99
100        @returns
101            a dialog implementing the <type scope="com::sun::star::awt">XDialog</type> interface.
102
103        @throws com::sun::star::lang::IllegalArgumentException
104            if no dialog for the given URL is found or if the URL is invalid
105            or xHandler is null.
106
107        @see <type scope="com::sun::star::awt">XDialogEventHandler</type>
108
109     */
110    XDialog createDialogWithHandler
111        ( [in] string URL, [in] com::sun::star::uno::XInterface xHandler )
112            raises ( com::sun::star::lang::IllegalArgumentException );
113
114    /** creates a dialog for the given URL, accepting additional creation parameters
115
116        <p>The arguments accepted so far are
117        <ul><li><em>ParentWindow</em> - must be a component supporting the <type>XWindowPeer</type> interface,
118                or a component supporting the <type>XControl</type> interfac, so an <code>XWindowPeer</code> can be
119                obtained from it. The given window will be used as parent window for the to-be-created dialog.</li>
120            <li><em>EventHandler</em> - specifies a component handling events in the dialog. See
121                <member>createDialogWithHandler</member> for a detailed specification of dialog event handling.</li>
122        </ul>
123        </p>
124    */
125
126    XDialog createDialogWithArguments
127        ( [in] string URL,
128          [in] sequence< ::com::sun::star::beans::NamedValue > Arguments )
129        raises  ( com::sun::star::lang::IllegalArgumentException );
130};
131
132//=============================================================================
133
134}; }; }; };
135
136#endif
137