1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_frame_XRecordableDispatch_idl__
24#define __com_sun_star_frame_XRecordableDispatch_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_frame_XDispatchRecorder_idl__
31#include <com/sun/star/frame/XDispatchRecorder.idl>
32#endif
33
34#ifndef __com_sun_star_util_URL_idl__
35#include <com/sun/star/util/URL.idl>
36#endif
37
38//=============================================================================
39
40 module com {  module sun {  module star {  module frame {
41
42//=============================================================================
43/** extends an existing <type>XDispatch</type> implementation with functionality
44    for dispatch recording
45
46    <p>
47    This interface can be implemented as an additional one beside an existing
48    <type>XDispatch</type> one to provide record functionality of dispatches.
49    Because it's an additional interface the status events are available there
50    and not at this interface.
51    </p>
52
53    <p>
54    But normally this interface mustn't be used directly.
55    If a dispatch object is well known and recording was enabled
56    on a <type>XDispatchRecorderSupplier</type> it's possible to use method
57    <member>XDispatchRecorderSupplier::dispatchAndRecord()</member> of it
58    to make dispatch and recording automatically. The interface XRecordableDispatch
59    is used transparently there.
60    </p>
61
62    @example
63    <listing>
64        <i>XDispatch</i> xDispatcher = xFrame.queryDispatch(aURL,"",0);
65        <i>XRecordableDispatch</i> xRecordable = (<i>XRecordableDispatch</i>)UnoRuntime.queryInterface(
66        &nbsp;&nbsp;XRecordableDispatch.class,
67        &nbsp;&nbsp;xDispatcher);
68
69        xDispatcher.addStatusListener(this,aURL);
70
71        <b>if</b> (xRecordable!=<b>null</b>)
72        &nbsp;&nbsp;xRecordable.dispatchAndRecord(aURL,lArguments,xRecorder);
73        else
74        &nbsp;&nbsp;xDispatcher.dispatch(aURL,lArguments);
75        ...
76        xDispatcher.removeStatusListener(this,aURL);
77    </listing>
78
79    @see XDispatchRecorderSupplier
80    @see XDispatch
81
82    @since OpenOffice 1.1.2
83 */
84published interface XRecordableDispatch: com::sun::star::uno::XInterface
85{
86	//-------------------------------------------------------------------------
87    /** dispatch and record it
88
89        @param URL
90            full parsed URL which describe the feature which should be dispatched (executed)
91
92        @param Arguments
93            optional arguments for this request
94            (see <type scope="com::sun::star::document">MediaDescriptor</type> for details)
95
96        @param Recorder
97            object which can be used to record the request
98            (available on <member>XDispatchRecorderSupplier::getDispatchRecorder()</member>)
99     */
100    [oneway] void dispatchAndRecord(
101        [in] com::sun::star::util::URL URL,
102        [in] sequence<com::sun::star::beans::PropertyValue> Arguments,
103        [in] XDispatchRecorder Recorder);
104};
105
106//=============================================================================
107
108}; }; }; };
109
110#endif
111