blob: 1bd5d4c03f155ba73ab52228d2a91ef1c6eb8778 [file] [log] [blame]
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef __com_sun_star_frame_XDispatch_idl__
#define __com_sun_star_frame_XDispatch_idl__
#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif
#ifndef __com_sun_star_util_URL_idl__
#include <com/sun/star/util/URL.idl>
#endif
#ifndef __com_sun_star_beans_PropertyValue_idl__
#include <com/sun/star/beans/PropertyValue.idl>
#endif
#ifndef __com_sun_star_frame_XStatusListener_idl__
#include <com/sun/star/frame/XStatusListener.idl>
#endif
//=============================================================================
module com { module sun { module star { module frame {
//=============================================================================
/** serves state information of objects which can be connected to
controls (e.g. toolbox controls).
<p>
Each state change is to be broadcasted to all registered
status listeners. The first notification should be performed
synchronously from <member>XDispatch::addStatusListener()</member>;
if not, controls may flicker. State listener must be aware of this
synchronous notification.
</p>
<p>
The state consists of enabled/disabled and a short descriptive text
of the function (e.g. "undo insert character"). It is to be broadcasted
whenever this state changes or the control should re-get the value
for the URL it is connected to. Additionally, a context-switch-event
is to be broadcasted whenever the object may be out of scope,
to force the state listener to requery the <type>XDispatch</type>.
</p>
@see Frame
@see FeatureStateEvent
*/
published interface XDispatch: com::sun::star::uno::XInterface
{
//-------------------------------------------------------------------------
/** dispatches (executes) an URL asynchronously.
<p>
It is only allowed to dispatch URLs for which this <type>XDispatch</type>
was explicitely queried. Additional arguments ("'#..." or "?...") are allowed.
</p>
@param URL
fully parsed URL describing the feature which should be dispatched (=executed)
@param Arguments
optional arguments for this request.
They depend on the real implementation of the dipsatch object.
@example
<listing>
<i><font COLOR="#949494">// some code for a click-handler (Java)</font></i>
void <strong>myOnClick</strong>(<em>String</em> sURL,<em>String</em> sTargetFrame,<em>com.sun.star.beans.PropertyValue[]</em> lArguments)
{
&nbsp;&nbsp;com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];
&nbsp;&nbsp;aURL[0] = new com.sun.star.util.URL();
&nbsp;&nbsp;aURL[0].Complete = sURL;
&nbsp;&nbsp;com.sun.star.util.XURLTransformer xParser = (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
&nbsp;&nbsp;&nbsp;&nbsp;com.sun.star.util.XURLTransformer.class,
&nbsp;&nbsp;&nbsp;&nbsp;mxServiceManager.createInstance("com.sun.star.util.URLTransformer"));
&nbsp;&nbsp;xParser.parseStrict(aURL);
&nbsp;&nbsp;com.sun.star.frame.XDispatch xDispatcher = mxFrame.queryDispatch(aURL[0], sTargetFrame, com.sun.star.frame.FrameSearchFlag.GLOBAL);
&nbsp;&nbsp;if(xDispatcher!=null)
&nbsp;&nbsp;&nbsp;&nbsp;xDispatcher.dispatch(aURL[0], lArguments);
}
</listing>
*/
[oneway] void dispatch(
[in] com::sun::star::util::URL URL,
[in] sequence<com::sun::star::beans::PropertyValue> Arguments);
//-------------------------------------------------------------------------
/** registers a listener of a control for a specific URL
at this object to receive status events.
<p>
It is only allowed to register URLs for which this <type>XDispatch</type>
was explicitely queried. Additional arguments ("#..." or "?...") will be ignored.
</p>
Note: Notifications can't be guaranteed! This will be a part of interface <type>XNotifyingDispatch</type>.
@param Control
listener that wishes to be informed
@param URL
the URL (without additional arguments) the listener wishes to be registered for.
A listener can be registered for more than one URL at the same time.
@see XStatusListener
@see XDispatch::removeStatusListener()
*/
[oneway] void addStatusListener(
[in] XStatusListener Control,
[in] com::sun::star::util::URL URL);
//-------------------------------------------------------------------------
/** unregisters a listener from a control.
@param Control
listener that wishes to be unregistered
@param URL
URL the listener was registered for.
Additional arguments ("#..." or "?...") will be ignored.
@see XStatusListener
@see XDispatch::addStatusListener()
*/
[oneway] void removeStatusListener(
[in] XStatusListener Control,
[in] com::sun::star::util::URL URL);
};
//=============================================================================
}; }; }; };
#endif