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_XDispatchRecorder_idl__
24#define __com_sun_star_frame_XDispatchRecorder_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_util_URL_idl__
31#include <com/sun/star/util/URL.idl>
32#endif
33
34#ifndef __com_sun_star_beans_PropertyValue_idl__
35#include <com/sun/star/beans/PropertyValue.idl>
36#endif
37
38//=============================================================================
39
40module com {  module sun {  module star {  module frame {
41
42 published interface XFrame;
43
44//=============================================================================
45/** provides recording functionality of dispatches
46
47    <p>
48    With such recorder it will be possible to record requests of type
49    <type>XDispatch</type> by using additional interface
50    <type>XRecordableDispatch</type>. The result of that will be a
51    a script which can be used to start the dispatch at later time again.
52    Such recorder objects are available on a <type>XDispatchRecorderSupplier</type>
53    which is provided by the <type>Frame</type> service.
54    </p>
55
56    @see Frame
57    @see XDispatchRecorderSupplier
58
59    @since OpenOffice 1.1.2
60 */
61published interface XDispatchRecorder: com::sun::star::uno::XInterface
62{
63	//-------------------------------------------------------------------------
64    /** initializes the recorder by passing the frame for which all
65        macro statements shall be recorded
66
67        @param Frame
68            it includes the document on which such requests shall be recorded
69    */
70    void startRecording( [in] com::sun::star::frame::XFrame Frame );
71
72        //-------------------------------------------------------------------------
73    /** stops the recording process
74
75        <p>
76        Must be called in pairs with <member>XDispatchRecorder::startRecording()</member>.
77        </p>
78
79        @attention  The recorder uses this method to control the lifetime of its internal
80                    used macro buffer. It will be cleared here. So the macro must be fetched
81                    before endRecording() is called.
82
83        @see        getRecordedMacro()
84    */
85    void endRecording();
86
87	//-------------------------------------------------------------------------
88    /** records a single dispatch call identified by its command URL
89
90        @param URL
91            the full parsed command URL
92
93        @param Arguments
94            optional arguments for the command URL
95            <br>
96            (see <type scope="com::sun::star::document">MediaDescriptor</type>
97             for further informations)
98    */
99    void recordDispatch(
100        [in] com::sun::star::util::URL URL,
101        [in] sequence<com::sun::star::beans::PropertyValue> Arguments);
102
103	//-------------------------------------------------------------------------
104    /** records a single dispatch call identified by its command URL, but
105        comments it out
106
107        <p>
108        This way calls that failed on execution can be documented.
109        </p>
110
111        @param URL
112            the full parsed command URL
113
114        @param Arguments
115            optional arguments for the command URL
116            <br>
117            (see <type scope="com::sun::star::document">MediaDescriptor</type>
118             for further informations)
119    */
120    void recordDispatchAsComment(
121        [in] com::sun::star::util::URL URL,
122        [in] sequence<com::sun::star::beans::PropertyValue> Arguments);
123
124	//-------------------------------------------------------------------------
125    /** returns the recorded source code
126
127        <p>
128        This method must be used before <member>endRecording()</member> is called!
129        Otherwhise the macro will be relased.
130        </p>
131
132        @returns
133            the recorded data as a string which can be interpreted as a script
134    */
135    string getRecordedMacro();
136};
137
138//=============================================================================
139
140}; }; }; };
141
142#endif
143