merge the formfield patch from ooo-build
[ooovba.git] / offapi / com / sun / star / frame / XDispatch.idl
blob52048fa0595e70ed5f6fde1d8dde48959954dbda
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XDispatch.idl,v $
10 * $Revision: 1.13 $
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 ************************************************************************/
30 #ifndef __com_sun_star_frame_XDispatch_idl__
31 #define __com_sun_star_frame_XDispatch_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include <com/sun/star/uno/XInterface.idl>
35 #endif
37 #ifndef __com_sun_star_util_URL_idl__
38 #include <com/sun/star/util/URL.idl>
39 #endif
41 #ifndef __com_sun_star_beans_PropertyValue_idl__
42 #include <com/sun/star/beans/PropertyValue.idl>
43 #endif
45 #ifndef __com_sun_star_frame_XStatusListener_idl__
46 #include <com/sun/star/frame/XStatusListener.idl>
47 #endif
50 //=============================================================================
52 module com { module sun { module star { module frame {
54 //=============================================================================
55 /** serves state information of objects which can be connected to
56 controls (e.g. toolbox controls).
58 <p>
59 Each state change is to be broadcasted to all registered
60 status listeners. The first notification should be performed
61 synchronously from <member>XDispatch::addStatusListener()</member>;
62 if not, controls may flicker. State listener must be aware of this
63 synchronous notification.
64 </p>
66 <p>
67 The state consists of enabled/disabled and a short descriptive text
68 of the function (e.g. "undo insert character"). It is to be broadcasted
69 whenever this state changes or the control should re-get the value
70 for the URL it is connected to. Additionally, a context-switch-event
71 is to be broadcasted whenever the object may be out of scope,
72 to force the state listener to requery the <type>XDispatch</type>.
73 </p>
75 @see Frame
76 @see FeatureStateEvent
78 published interface XDispatch: com::sun::star::uno::XInterface
80 //-------------------------------------------------------------------------
81 /** dispatches (executes) an URL asynchronously.
83 <p>
84 It is only allowed to dispatch URLs for which this <type>XDispatch</type>
85 was explicitely queried. Additional arguments ("'#..." or "?...") are allowed.
86 </p>
88 @param URL
89 fully parsed URL describing the feature which should be dispatched (=executed)
91 @param Arguments
92 optional arguments for this request.
93 They depend on the real implementation of the dipsatch object.
95 @example
96 <listing>
97 <i><font COLOR="#949494">// some code for a click-handler (Java)</font></i>
98 void <strong>myOnClick</strong>(<em>String</em> sURL,<em>String</em> sTargetFrame,<em>com.sun.star.beans.PropertyValue[]</em> lArguments)
100 &nbsp;&nbsp;com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];
101 &nbsp;&nbsp;aURL[0] = new com.sun.star.util.URL();
102 &nbsp;&nbsp;aURL[0].Complete = sURL;
104 &nbsp;&nbsp;com.sun.star.util.XURLTransformer xParser = (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
105 &nbsp;&nbsp;&nbsp;&nbsp;com.sun.star.util.XURLTransformer.class,
106 &nbsp;&nbsp;&nbsp;&nbsp;mxServiceManager.createInstance("com.sun.star.util.URLTransformer"));
108 &nbsp;&nbsp;xParser.parseStrict(aURL);
110 &nbsp;&nbsp;com.sun.star.frame.XDispatch xDispatcher = mxFrame.queryDispatch(aURL[0], sTargetFrame, com.sun.star.frame.FrameSearchFlag.GLOBAL);
112 &nbsp;&nbsp;if(xDispatcher!=null)
113 &nbsp;&nbsp;&nbsp;&nbsp;xDispatcher.dispatch(aURL[0], lArguments);
115 </listing>
117 [oneway] void dispatch(
118 [in] com::sun::star::util::URL URL,
119 [in] sequence<com::sun::star::beans::PropertyValue> Arguments);
121 //-------------------------------------------------------------------------
122 /** registers a listener of a control for a specific URL
123 at this object to receive status events.
126 It is only allowed to register URLs for which this <type>XDispatch</type>
127 was explicitely queried. Additional arguments ("#..." or "?...") will be ignored.
128 </p>
129 Note: Notifications can't be guaranteed! This will be a part of interface <type>XNotifyingDispatch</type>.
131 @param Control
132 listener that wishes to be informed
134 @param URL
135 the URL (without additional arguments) the listener wishes to be registered for.
136 A listener can be registered for more than one URL at the same time.
138 @see XStatusListener
139 @see XDispatch::removeStatusListener()
141 [oneway] void addStatusListener(
142 [in] XStatusListener Control,
143 [in] com::sun::star::util::URL URL);
145 //-------------------------------------------------------------------------
146 /** unregisters a listener from a control.
148 @param Control
149 listener that wishes to be unregistered
151 @param URL
152 URL the listener was registered for.
153 Additional arguments ("#..." or "?...") will be ignored.
155 @see XStatusListener
156 @see XDispatch::addStatusListener()
158 [oneway] void removeStatusListener(
159 [in] XStatusListener Control,
160 [in] com::sun::star::util::URL URL);
163 //=============================================================================
165 }; }; }; };
167 #endif