1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XDispatch.idl,v $
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
>
37 #ifndef __com_sun_star_util_URL_idl__
38 #include
<com
/sun
/star
/util
/URL.idl
>
41 #ifndef __com_sun_star_beans_PropertyValue_idl__
42 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
45 #ifndef __com_sun_star_frame_XStatusListener_idl__
46 #include
<com
/sun
/star
/frame
/XStatusListener.idl
>
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).
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.
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>.
76 @see FeatureStateEvent
78 published
interface XDispatch
: com
::sun
::star
::uno
::XInterface
80 //-------------------------------------------------------------------------
81 /** dispatches (executes) an URL asynchronously.
84 It is only allowed to dispatch URLs for which this <type>XDispatch</type>
85 was explicitely queried. Additional arguments ("'#..." or "?...") are allowed.
89 fully parsed URL describing the feature which should be dispatched (=executed)
92 optional arguments for this request.
93 They depend on the real implementation of the dipsatch object.
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 com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];
101 aURL[0] = new com.sun.star.util.URL();
102 aURL[0].Complete = sURL;
104 com.sun.star.util.XURLTransformer xParser = (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
105 com.sun.star.util.XURLTransformer.class,
106 mxServiceManager.createInstance("com.sun.star.util.URLTransformer"));
108 xParser.parseStrict(aURL);
110 com.sun.star.frame.XDispatch xDispatcher = mxFrame.queryDispatch(aURL[0], sTargetFrame, com.sun.star.frame.FrameSearchFlag.GLOBAL);
112 if(xDispatcher!=null)
113 xDispatcher.dispatch(aURL[0], lArguments);
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.
129 Note: Notifications can't be guaranteed! This will be a part of interface <type>XNotifyingDispatch</type>.
132 listener that wishes to be informed
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.
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.
149 listener that wishes to be unregistered
152 URL the listener was registered for.
153 Additional arguments ("#..." or "?...") will be ignored.
156 @see XDispatch::addStatusListener()
158 [oneway
] void removeStatusListener
(
159 [in] XStatusListener
Control,
160 [in] com
::sun
::star
::util
::URL URL
);
163 //=============================================================================