LibreOffice: XDispatch Interface Reference

LibreOffice LibreOffice 24.8 SDK API Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
XDispatch Interface Referencepublished

serves state information of objects which can be connected to controls (e.g. More...

`import <XDispatch.idl;`

Inheritance diagram for XDispatch:

## Public Member Functions
void | dispatch ([in] com::sun::star::util::URL URL, [in] sequence< com::sun::star::beans::PropertyValue > Arguments)
| dispatches (executes) a URL
void | addStatusListener ([in] XStatusListener Control, [in] com::sun::star::util::URL URL)
| registers a listener of a control for a specific URL at this object to receive status events.
void | removeStatusListener ([in] XStatusListener Control, [in] com::sun::star::util::URL URL)
| unregisters a listener from a control.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Detailed Description

serves state information of objects which can be connected to controls (e.g.

toolbox controls).

Each state change is to be broadcasted to all registered status listeners. The first notification should be performed synchronously from XDispatch::addStatusListener(); if not, controls may flicker. State listener must be aware of this synchronous notification.

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 XDispatch.

See also
  Frame
  FeatureStateEvent

## Member Function Documentation

## ◆ addStatusListener()

void addStatusListener | ( | [in] XStatusListener | Control,
|  | [in] com::sun::star::util::URL | URL )

registers a listener of a control for a specific URL at this object to receive status events.

It is only allowed to register URLs for which this XDispatch was explicitly queried. Additional arguments ("#..." or "?...") will be ignored.

Note: Notifications can't be guaranteed! This will be a part of interface XNotifyingDispatch.

Parameters

  Control | listener that wishes to be informed
  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 also
  XStatusListener
  XDispatch::removeStatusListener()

## ◆ dispatch()

void dispatch | ( | [in] com::sun::star::util::URL | URL,
|  | [in] sequence< com::sun::star::beans::PropertyValue > | Arguments )

dispatches (executes) a URL

It is only allowed to dispatch URLs for which this XDispatch was explicitly queried. Additional arguments ("'#..." or "?...") are allowed.

Parameters

  URL | fully parsed URL describing the feature which should be dispatched (=executed)
  Arguments | optional arguments for this request (see com::sun::star::document::MediaDescriptor) They depend on the real implementation of the dispatch object.

Controlling synchronous or asynchronous mode happens via readonly boolean Flag SynchronMode

By default, and absent any arguments, "SynchronMode" is considered `FALSE` and the execution is performed asynchronously (i.e. dispatch() returns immediately, and the action is performed in the background). But when set to `TRUE`, dispatch() processes the request synchronously

- this call will block until it has finished.

some code for a click-handler (Java)

void myOnClick(String sURL,String sTargetFrame,
com.sun.star.beans.PropertyValue[] lArguments)
{
com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];
aURL[0] = new com.sun.star.util.URL();
aURL[0].Complete = sURL;
com.sun.star.util.XURLTransformer xParser =
(com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
com.sun.star.util.XURLTransformer.class,
mxServiceManager.createInstance("com.sun.star.util.URLTransformer"));
xParser.parseStrict(aURL);
com.sun.star.frame.XDispatch xDispatcher =
mxFrame.queryDispatch(aURL[0], sTargetFrame, com.sun.star.frame.FrameSearchFlag.GLOBAL);
if(xDispatcher!=null)
xDispatcher.dispatch(aURL[0], lArguments);
}
com::sun::star::frame::XDispatch
serves state information of objects which can be connected to controls (e.g.
Definition XDispatch.idl:48
com::sun::star::frame::XDispatch::dispatch
void dispatch([in] com::sun::star::util::URL URL, [in] sequence< com::sun::star::beans::PropertyValue > Arguments)
dispatches (executes) a URL
com::sun::star::uno::XInterface::queryInterface
any queryInterface([in] type aType)
queries for a new interface to an existing UNO object.
com::sun::star::util::XURLTransformer
supports parsing and assembling of URLs
Definition XURLTransformer.idl:31
com::sun::star::util::XURLTransformer::parseStrict
boolean parseStrict([inout] com::sun::star::util::URL aURL)
parses the string in URL::Complete which should contain a syntactically complete URL.
com::sun::star::beans
Java beans-like property access and introspection.
Definition Ambiguous.idl:20
com::sun::star::frame::FrameSearchFlag
these types describe the algorithm to be used to search a frame
Definition FrameSearchFlag.idl:38
com::sun::star::frame
Desktop environment framework interfaces.
Definition AppDispatchProvider.idl:21
com::sun::star::util
Miscellaneous interfaces for sorting, connecting objects etc.
Definition XVndSunStarExpandUrl.idl:20
com::sun::star
the module com::sun::star is the root module of the UNO API.
Definition Ambiguous.idl:20
com::sun
Definition Ambiguous.idl:20
com
Definition Ambiguous.idl:20
com::sun::star::beans::PropertyValue
specifies a property value.
Definition PropertyValue.idl:28
com::sun::star::util::URL
represents the structure of a Uniform Resource Locator.
Definition generated_idl_chapter_refs.idl:3995
com::sun::star::util::URL::Complete
string Complete
contains the string representation of the complete URL, for example, http://www.sun....
Definition URL.idl:53

## ◆ removeStatusListener()

void removeStatusListener | ( | [in] XStatusListener | Control,
|  | [in] com::sun::star::util::URL | URL )

unregisters a listener from a control.

Parameters

  Control | listener that wishes to be unregistered
  URL | URL the listener was registered for. Additional arguments ("#..." or "?...") will be ignored.

See also
  XStatusListener
  XDispatch::addStatusListener()

The documentation for this interface was generated from the following file:

- com/sun/star/frame/XDispatch.idl