Bump version to 6.4-15
[LibreOffice.git] / svx / source / form / fmscriptingenv.cxx
blob5edf19daa4906d31c42e89fddefefad605dd72af
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <config_features.h>
22 #include <fmscriptingenv.hxx>
23 #include <svx/fmmodel.hxx>
25 #include <com/sun/star/awt/XControl.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/frame/Desktop.hpp>
28 #include <com/sun/star/frame/TerminationVetoException.hpp>
29 #include <com/sun/star/frame/XTerminateListener.hpp>
30 #include <com/sun/star/lang/DisposedException.hpp>
31 #include <com/sun/star/lang/EventObject.hpp>
32 #include <com/sun/star/lang/IllegalArgumentException.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/script/XScriptListener.hpp>
36 #include <tools/diagnose_ex.h>
37 #include <tools/debug.hxx>
38 #include <cppuhelper/implbase.hxx>
39 #include <cppuhelper/compbase.hxx>
40 #include <cppuhelper/supportsservice.hxx>
41 #include <comphelper/processfactory.hxx>
42 #include <vcl/svapp.hxx>
43 #include <osl/mutex.hxx>
44 #include <sfx2/objsh.hxx>
45 #include <sfx2/app.hxx>
46 #include <basic/basmgr.hxx>
48 #include <memory>
49 #include <set>
50 #include <utility>
52 using std::pair;
54 namespace svxform
58 using ::com::sun::star::uno::Reference;
59 using ::com::sun::star::script::XEventAttacherManager;
60 using ::com::sun::star::lang::IllegalArgumentException;
61 using ::com::sun::star::script::XScriptListener;
62 using ::com::sun::star::script::ScriptEvent;
63 using ::com::sun::star::lang::EventObject;
64 using ::com::sun::star::uno::Any;
65 using ::com::sun::star::uno::UNO_QUERY_THROW;
66 using ::com::sun::star::lang::DisposedException;
67 using ::com::sun::star::uno::RuntimeException;
68 using ::com::sun::star::uno::Exception;
69 using ::com::sun::star::uno::Sequence;
70 using ::com::sun::star::uno::XInterface;
71 using ::com::sun::star::awt::XControl;
72 using ::com::sun::star::beans::XPropertySet;
74 class FormScriptingEnvironment;
77 //= FormScriptListener
79 typedef ::cppu::WeakImplHelper < XScriptListener
80 > FormScriptListener_Base;
82 /** implements the XScriptListener interface, is used by FormScriptingEnvironment
84 class FormScriptListener :public FormScriptListener_Base
86 private:
87 ::osl::Mutex m_aMutex;
88 FormScriptingEnvironment *m_pScriptExecutor;
90 public:
91 explicit FormScriptListener( FormScriptingEnvironment * pScriptExecutor );
93 // XScriptListener
94 virtual void SAL_CALL firing( const ScriptEvent& aEvent ) override;
95 virtual Any SAL_CALL approveFiring( const ScriptEvent& aEvent ) override;
96 // XEventListener
97 virtual void SAL_CALL disposing( const EventObject& Source ) override;
99 // lifetime control
100 void dispose();
102 protected:
103 virtual ~FormScriptListener() override;
105 private:
106 /** determines whether calling a given method at a given listener interface can be done asynchronously
108 @param _rListenerType
109 the name of the UNO type whose method is to be checked
110 @param _rMethodName
111 the name of the method at the interface determined by _rListenerType
113 @return
114 <TRUE/> if and only if the method is declared <code>oneway</code>, i.e. can be called asynchronously
116 static bool impl_allowAsynchronousCall_nothrow( const OUString& _rListenerType, const OUString& _rMethodName );
118 /** determines whether the instance is already disposed
120 bool impl_isDisposed_nothrow() const { return !m_pScriptExecutor; }
122 /** fires the given script event in a thread-safe manner
124 This methods calls our script executor's doFireScriptEvent, with previously releasing the given mutex guard,
125 but ensuring that our script executor is not deleted between this release and the actual call.
127 @param _rGuard
128 a clearable guard to our mutex. Must be the only active guard to our mutex.
129 @param _rEvent
130 the event to fire
131 @param _pSynchronousResult
132 a place to take a possible result of the script call.
134 @precond
135 m_pScriptExecutor is not <NULL/>.
137 void impl_doFireScriptEvent_nothrow( ::osl::ClearableMutexGuard& _rGuard, const ScriptEvent& _rEvent, Any* _pSynchronousResult );
139 private:
140 DECL_LINK( OnAsyncScriptEvent, void*, void );
143 class FormScriptingEnvironment:
144 public IFormScriptingEnvironment
146 private:
147 typedef rtl::Reference<FormScriptListener> ListenerImplementation;
149 private:
150 ::osl::Mutex m_aMutex;
151 ListenerImplementation m_pScriptListener;
152 FmFormModel& m_rFormModel;
153 bool m_bDisposed;
155 public:
156 explicit FormScriptingEnvironment( FmFormModel& _rModel );
157 FormScriptingEnvironment(const FormScriptingEnvironment&) = delete;
158 FormScriptingEnvironment& operator=(const FormScriptingEnvironment&) = delete;
160 // callback for FormScriptListener
161 void doFireScriptEvent( const ScriptEvent& _rEvent, Any* _pSynchronousResult );
163 // IFormScriptingEnvironment
164 virtual void registerEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager ) override;
165 virtual void revokeEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager ) override;
166 virtual void dispose() override;
168 private:
169 void impl_registerOrRevoke_throw( const Reference< XEventAttacherManager >& _rxManager, bool _bRegister );
172 FormScriptListener::FormScriptListener( FormScriptingEnvironment* pScriptExecutor )
173 :m_pScriptExecutor( pScriptExecutor )
178 FormScriptListener::~FormScriptListener()
183 bool FormScriptListener::impl_allowAsynchronousCall_nothrow( const OUString& _rListenerType, const OUString& _rMethodName )
185 // This used to be implemented as:
186 // is (_rListenerType + "::" + _rMethodName) a oneway function?
187 // since we got rid of the notion of oneway, this is the list
188 // of oneway methods, autogenerated by postprocessing of
189 // commitdiff 90eac3e69749a9227c4b6902b1f3cef1e338c6d1
190 static const std::set<pair<OUString, OUString>> delayed_event_listeners{
191 pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleComponent","grabFocus"),
192 pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleEventBroadcaster","addAccessibleEventListener"),
193 pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleEventBroadcaster","removeAccessibleEventListener"),
194 pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleSelection","clearAccessibleSelection"),
195 pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleSelection","selectAllAccessibleChildren"),
196 pair<OUString,OUString>("com.sun.star.awt.XActionListener","actionPerformed"),
197 pair<OUString,OUString>("com.sun.star.awt.XActivateListener","windowActivated"),
198 pair<OUString,OUString>("com.sun.star.awt.XActivateListener","windowDeactivated"),
199 pair<OUString,OUString>("com.sun.star.awt.XAdjustmentListener","adjustmentValueChanged"),
200 pair<OUString,OUString>("com.sun.star.awt.XButton","addActionListener"),
201 pair<OUString,OUString>("com.sun.star.awt.XButton","removeActionListener"),
202 pair<OUString,OUString>("com.sun.star.awt.XButton","setLabel"),
203 pair<OUString,OUString>("com.sun.star.awt.XButton","setActionCommand"),
204 pair<OUString,OUString>("com.sun.star.awt.XCheckBox","addItemListener"),
205 pair<OUString,OUString>("com.sun.star.awt.XCheckBox","removeItemListener"),
206 pair<OUString,OUString>("com.sun.star.awt.XCheckBox","setState"),
207 pair<OUString,OUString>("com.sun.star.awt.XCheckBox","setLabel"),
208 pair<OUString,OUString>("com.sun.star.awt.XCheckBox","enableTriState"),
209 pair<OUString,OUString>("com.sun.star.awt.XComboBox","addItemListener"),
210 pair<OUString,OUString>("com.sun.star.awt.XComboBox","removeItemListener"),
211 pair<OUString,OUString>("com.sun.star.awt.XComboBox","addActionListener"),
212 pair<OUString,OUString>("com.sun.star.awt.XComboBox","removeActionListener"),
213 pair<OUString,OUString>("com.sun.star.awt.XComboBox","addItem"),
214 pair<OUString,OUString>("com.sun.star.awt.XComboBox","addItems"),
215 pair<OUString,OUString>("com.sun.star.awt.XComboBox","removeItems"),
216 pair<OUString,OUString>("com.sun.star.awt.XComboBox","setDropDownLineCount"),
217 pair<OUString,OUString>("com.sun.star.awt.XControl","setContext"),
218 pair<OUString,OUString>("com.sun.star.awt.XControl","createPeer"),
219 pair<OUString,OUString>("com.sun.star.awt.XControl","setDesignMode"),
220 pair<OUString,OUString>("com.sun.star.awt.XControlContainer","setStatusText"),
221 pair<OUString,OUString>("com.sun.star.awt.XControlContainer","addControl"),
222 pair<OUString,OUString>("com.sun.star.awt.XControlContainer","removeControl"),
223 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setValue"),
224 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setMin"),
225 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setMax"),
226 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setFirst"),
227 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setLast"),
228 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setSpinSize"),
229 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setDecimalDigits"),
230 pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setStrictFormat"),
231 pair<OUString,OUString>("com.sun.star.awt.XDateField","setDate"),
232 pair<OUString,OUString>("com.sun.star.awt.XDateField","setMin"),
233 pair<OUString,OUString>("com.sun.star.awt.XDateField","setMax"),
234 pair<OUString,OUString>("com.sun.star.awt.XDateField","setFirst"),
235 pair<OUString,OUString>("com.sun.star.awt.XDateField","setLast"),
236 pair<OUString,OUString>("com.sun.star.awt.XDateField","setLongFormat"),
237 pair<OUString,OUString>("com.sun.star.awt.XDateField","setStrictFormat"),
238 pair<OUString,OUString>("com.sun.star.awt.XDialog","setTitle"),
239 pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","addEventHandler"),
240 pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","removeEventHandler"),
241 pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","addErrorHandler"),
242 pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","removeErrorHandler"),
243 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","addTopWindowListener"),
244 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","removeTopWindowListener"),
245 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","addKeyHandler"),
246 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","removeKeyHandler"),
247 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","addFocusListener"),
248 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","removeFocusListener"),
249 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","fireFocusGained"),
250 pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","fireFocusLost"),
251 pair<OUString,OUString>("com.sun.star.awt.XFileDialog","setPath"),
252 pair<OUString,OUString>("com.sun.star.awt.XFileDialog","setFilters"),
253 pair<OUString,OUString>("com.sun.star.awt.XFileDialog","setCurrentFilter"),
254 pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","setText"),
255 pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","setURL"),
256 pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","setAlignment"),
257 pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","addActionListener"),
258 pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","removeActionListener"),
259 pair<OUString,OUString>("com.sun.star.awt.XFixedText","setText"),
260 pair<OUString,OUString>("com.sun.star.awt.XFixedText","setAlignment"),
261 pair<OUString,OUString>("com.sun.star.awt.XFocusListener","focusGained"),
262 pair<OUString,OUString>("com.sun.star.awt.XFocusListener","focusLost"),
263 pair<OUString,OUString>("com.sun.star.awt.XGraphics","setFont"),
264 pair<OUString,OUString>("com.sun.star.awt.XGraphics","selectFont"),
265 pair<OUString,OUString>("com.sun.star.awt.XGraphics","setTextColor"),
266 pair<OUString,OUString>("com.sun.star.awt.XGraphics","setTextFillColor"),
267 pair<OUString,OUString>("com.sun.star.awt.XGraphics","setLineColor"),
268 pair<OUString,OUString>("com.sun.star.awt.XGraphics","setFillColor"),
269 pair<OUString,OUString>("com.sun.star.awt.XGraphics","setRasterOp"),
270 pair<OUString,OUString>("com.sun.star.awt.XGraphics","setClipRegion"),
271 pair<OUString,OUString>("com.sun.star.awt.XGraphics","intersectClipRegion"),
272 pair<OUString,OUString>("com.sun.star.awt.XGraphics","push"),
273 pair<OUString,OUString>("com.sun.star.awt.XGraphics","pop"),
274 pair<OUString,OUString>("com.sun.star.awt.XGraphics","copy"),
275 pair<OUString,OUString>("com.sun.star.awt.XGraphics","draw"),
276 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPixel"),
277 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawLine"),
278 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawRect"),
279 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawRoundedRect"),
280 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPolyLine"),
281 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPolygon"),
282 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPolyPolygon"),
283 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawEllipse"),
284 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawArc"),
285 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPie"),
286 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawChord"),
287 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawGradient"),
288 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawText"),
289 pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawTextArray"),
290 pair<OUString,OUString>("com.sun.star.awt.XImageButton","addActionListener"),
291 pair<OUString,OUString>("com.sun.star.awt.XImageButton","removeActionListener"),
292 pair<OUString,OUString>("com.sun.star.awt.XImageButton","setActionCommand"),
293 pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","init"),
294 pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","setColorModel"),
295 pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","setPixelsByBytes"),
296 pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","setPixelsByLongs"),
297 pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","complete"),
298 pair<OUString,OUString>("com.sun.star.awt.XImageProducer","addConsumer"),
299 pair<OUString,OUString>("com.sun.star.awt.XImageProducer","removeConsumer"),
300 pair<OUString,OUString>("com.sun.star.awt.XImageProducer","startProduction"),
301 pair<OUString,OUString>("com.sun.star.awt.XItemEventBroadcaster","addItemListener"),
302 pair<OUString,OUString>("com.sun.star.awt.XItemEventBroadcaster","removeItemListener"),
303 pair<OUString,OUString>("com.sun.star.awt.XItemListener","itemStateChanged"),
304 pair<OUString,OUString>("com.sun.star.awt.XKeyListener","keyPressed"),
305 pair<OUString,OUString>("com.sun.star.awt.XKeyListener","keyReleased"),
306 pair<OUString,OUString>("com.sun.star.awt.XListBox","addItemListener"),
307 pair<OUString,OUString>("com.sun.star.awt.XListBox","removeItemListener"),
308 pair<OUString,OUString>("com.sun.star.awt.XListBox","addActionListener"),
309 pair<OUString,OUString>("com.sun.star.awt.XListBox","removeActionListener"),
310 pair<OUString,OUString>("com.sun.star.awt.XListBox","addItem"),
311 pair<OUString,OUString>("com.sun.star.awt.XListBox","addItems"),
312 pair<OUString,OUString>("com.sun.star.awt.XListBox","removeItems"),
313 pair<OUString,OUString>("com.sun.star.awt.XListBox","selectItemPos"),
314 pair<OUString,OUString>("com.sun.star.awt.XListBox","selectItemsPos"),
315 pair<OUString,OUString>("com.sun.star.awt.XListBox","selectItem"),
316 pair<OUString,OUString>("com.sun.star.awt.XListBox","setMultipleMode"),
317 pair<OUString,OUString>("com.sun.star.awt.XListBox","setDropDownLineCount"),
318 pair<OUString,OUString>("com.sun.star.awt.XListBox","makeVisible"),
319 pair<OUString,OUString>("com.sun.star.awt.XMenu","addMenuListener"),
320 pair<OUString,OUString>("com.sun.star.awt.XMenu","removeMenuListener"),
321 pair<OUString,OUString>("com.sun.star.awt.XMenu","insertItem"),
322 pair<OUString,OUString>("com.sun.star.awt.XMenu","removeItem"),
323 pair<OUString,OUString>("com.sun.star.awt.XMenu","enableItem"),
324 pair<OUString,OUString>("com.sun.star.awt.XMenu","setItemText"),
325 pair<OUString,OUString>("com.sun.star.awt.XMenu","setPopupMenu"),
326 pair<OUString,OUString>("com.sun.star.awt.XMenuListener","highlight"),
327 pair<OUString,OUString>("com.sun.star.awt.XMenuListener","select"),
328 pair<OUString,OUString>("com.sun.star.awt.XMenuListener","activate"),
329 pair<OUString,OUString>("com.sun.star.awt.XMenuListener","deactivate"),
330 pair<OUString,OUString>("com.sun.star.awt.XMessageBox","setCaptionText"),
331 pair<OUString,OUString>("com.sun.star.awt.XMessageBox","setMessageText"),
332 pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mousePressed"),
333 pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mouseReleased"),
334 pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mouseEntered"),
335 pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mouseExited"),
336 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setValue"),
337 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setMin"),
338 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setMax"),
339 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setFirst"),
340 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setLast"),
341 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setSpinSize"),
342 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setDecimalDigits"),
343 pair<OUString,OUString>("com.sun.star.awt.XNumericField","setStrictFormat"),
344 pair<OUString,OUString>("com.sun.star.awt.XPaintListener","windowPaint"),
345 pair<OUString,OUString>("com.sun.star.awt.XPatternField","setMasks"),
346 pair<OUString,OUString>("com.sun.star.awt.XPatternField","setString"),
347 pair<OUString,OUString>("com.sun.star.awt.XPatternField","setStrictFormat"),
348 pair<OUString,OUString>("com.sun.star.awt.XPointer","setType"),
349 pair<OUString,OUString>("com.sun.star.awt.XPopupMenu","insertSeparator"),
350 pair<OUString,OUString>("com.sun.star.awt.XPopupMenu","setDefaultItem"),
351 pair<OUString,OUString>("com.sun.star.awt.XPopupMenu","checkItem"),
352 pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setForegroundColor"),
353 pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setBackgroundColor"),
354 pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setRange"),
355 pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setValue"),
356 pair<OUString,OUString>("com.sun.star.awt.XProgressMonitor","addText"),
357 pair<OUString,OUString>("com.sun.star.awt.XProgressMonitor","removeText"),
358 pair<OUString,OUString>("com.sun.star.awt.XProgressMonitor","updateText"),
359 pair<OUString,OUString>("com.sun.star.awt.XRadioButton","addItemListener"),
360 pair<OUString,OUString>("com.sun.star.awt.XRadioButton","removeItemListener"),
361 pair<OUString,OUString>("com.sun.star.awt.XRadioButton","setState"),
362 pair<OUString,OUString>("com.sun.star.awt.XRadioButton","setLabel"),
363 pair<OUString,OUString>("com.sun.star.awt.XRegion","clear"),
364 pair<OUString,OUString>("com.sun.star.awt.XRegion","move"),
365 pair<OUString,OUString>("com.sun.star.awt.XRegion","unionRectangle"),
366 pair<OUString,OUString>("com.sun.star.awt.XRegion","intersectRectangle"),
367 pair<OUString,OUString>("com.sun.star.awt.XRegion","excludeRectangle"),
368 pair<OUString,OUString>("com.sun.star.awt.XRegion","xOrRectangle"),
369 pair<OUString,OUString>("com.sun.star.awt.XRegion","unionRegion"),
370 pair<OUString,OUString>("com.sun.star.awt.XRegion","intersectRegion"),
371 pair<OUString,OUString>("com.sun.star.awt.XRegion","excludeRegion"),
372 pair<OUString,OUString>("com.sun.star.awt.XRegion","xOrRegion"),
373 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","addAdjustmentListener"),
374 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","removeAdjustmentListener"),
375 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setValue"),
376 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setValues"),
377 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setMaximum"),
378 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setLineIncrement"),
379 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setBlockIncrement"),
380 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setVisibleSize"),
381 pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setOrientation"),
382 pair<OUString,OUString>("com.sun.star.awt.XSpinField","addSpinListener"),
383 pair<OUString,OUString>("com.sun.star.awt.XSpinField","removeSpinListener"),
384 pair<OUString,OUString>("com.sun.star.awt.XSpinField","up"),
385 pair<OUString,OUString>("com.sun.star.awt.XSpinField","down"),
386 pair<OUString,OUString>("com.sun.star.awt.XSpinField","first"),
387 pair<OUString,OUString>("com.sun.star.awt.XSpinField","last"),
388 pair<OUString,OUString>("com.sun.star.awt.XSpinField","enableRepeat"),
389 pair<OUString,OUString>("com.sun.star.awt.XSpinListener","up"),
390 pair<OUString,OUString>("com.sun.star.awt.XSpinListener","down"),
391 pair<OUString,OUString>("com.sun.star.awt.XSpinListener","first"),
392 pair<OUString,OUString>("com.sun.star.awt.XSpinListener","last"),
393 pair<OUString,OUString>("com.sun.star.awt.XSpinValue","addAdjustmentListener"),
394 pair<OUString,OUString>("com.sun.star.awt.XSpinValue","removeAdjustmentListener"),
395 pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setValue"),
396 pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setValues"),
397 pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setMinimum"),
398 pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setMaximum"),
399 pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setSpinIncrement"),
400 pair<OUString,OUString>("com.sun.star.awt.XTabController","setModel"),
401 pair<OUString,OUString>("com.sun.star.awt.XTabController","setContainer"),
402 pair<OUString,OUString>("com.sun.star.awt.XTabController","autoTabOrder"),
403 pair<OUString,OUString>("com.sun.star.awt.XTabController","activateTabOrder"),
404 pair<OUString,OUString>("com.sun.star.awt.XTabController","activateFirst"),
405 pair<OUString,OUString>("com.sun.star.awt.XTabController","activateLast"),
406 pair<OUString,OUString>("com.sun.star.awt.XTabControllerModel","setGroupControl"),
407 pair<OUString,OUString>("com.sun.star.awt.XTabControllerModel","setControlModels"),
408 pair<OUString,OUString>("com.sun.star.awt.XTabControllerModel","setGroup"),
409 pair<OUString,OUString>("com.sun.star.awt.XTextComponent","addTextListener"),
410 pair<OUString,OUString>("com.sun.star.awt.XTextComponent","removeTextListener"),
411 pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setText"),
412 pair<OUString,OUString>("com.sun.star.awt.XTextComponent","insertText"),
413 pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setSelection"),
414 pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setEditable"),
415 pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setMaxTextLen"),
416 pair<OUString,OUString>("com.sun.star.awt.XTextEditField","setEchoChar"),
417 pair<OUString,OUString>("com.sun.star.awt.XTextListener","textChanged"),
418 pair<OUString,OUString>("com.sun.star.awt.XTimeField","setTime"),
419 pair<OUString,OUString>("com.sun.star.awt.XTimeField","setMin"),
420 pair<OUString,OUString>("com.sun.star.awt.XTimeField","setMax"),
421 pair<OUString,OUString>("com.sun.star.awt.XTimeField","setFirst"),
422 pair<OUString,OUString>("com.sun.star.awt.XTimeField","setLast"),
423 pair<OUString,OUString>("com.sun.star.awt.XTimeField","setStrictFormat"),
424 pair<OUString,OUString>("com.sun.star.awt.XTopWindow","addTopWindowListener"),
425 pair<OUString,OUString>("com.sun.star.awt.XTopWindow","removeTopWindowListener"),
426 pair<OUString,OUString>("com.sun.star.awt.XTopWindow","toFront"),
427 pair<OUString,OUString>("com.sun.star.awt.XTopWindow","toBack"),
428 pair<OUString,OUString>("com.sun.star.awt.XTopWindow","setMenuBar"),
429 pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowOpened"),
430 pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowClosing"),
431 pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowClosed"),
432 pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowMinimized"),
433 pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowNormalized"),
434 pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowActivated"),
435 pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowDeactivated"),
436 pair<OUString,OUString>("com.sun.star.awt.XUnoControlContainer","setTabControllers"),
437 pair<OUString,OUString>("com.sun.star.awt.XUnoControlContainer","addTabController"),
438 pair<OUString,OUString>("com.sun.star.awt.XUnoControlContainer","removeTabController"),
439 pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","addKeyHandler"),
440 pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","removeKeyHandler"),
441 pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","addMouseClickHandler"),
442 pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","removeMouseClickHandler"),
443 pair<OUString,OUString>("com.sun.star.awt.XVclContainer","addVclContainerListener"),
444 pair<OUString,OUString>("com.sun.star.awt.XVclContainer","removeVclContainerListener"),
445 pair<OUString,OUString>("com.sun.star.awt.XVclContainerListener","windowAdded"),
446 pair<OUString,OUString>("com.sun.star.awt.XVclContainerListener","windowRemoved"),
447 pair<OUString,OUString>("com.sun.star.awt.XVclContainerPeer","enableDialogControl"),
448 pair<OUString,OUString>("com.sun.star.awt.XVclContainerPeer","setTabOrder"),
449 pair<OUString,OUString>("com.sun.star.awt.XVclContainerPeer","setGroup"),
450 pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","setDesignMode"),
451 pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","enableClipSiblings"),
452 pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","setForeground"),
453 pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","setControlFont"),
454 pair<OUString,OUString>("com.sun.star.awt.XView","draw"),
455 pair<OUString,OUString>("com.sun.star.awt.XView","setZoom"),
456 pair<OUString,OUString>("com.sun.star.awt.XWindow","setPosSize"),
457 pair<OUString,OUString>("com.sun.star.awt.XWindow","setVisible"),
458 pair<OUString,OUString>("com.sun.star.awt.XWindow","setEnable"),
459 pair<OUString,OUString>("com.sun.star.awt.XWindow","setFocus"),
460 pair<OUString,OUString>("com.sun.star.awt.XWindow","addWindowListener"),
461 pair<OUString,OUString>("com.sun.star.awt.XWindow","removeWindowListener"),
462 pair<OUString,OUString>("com.sun.star.awt.XWindow","addFocusListener"),
463 pair<OUString,OUString>("com.sun.star.awt.XWindow","removeFocusListener"),
464 pair<OUString,OUString>("com.sun.star.awt.XWindow","addKeyListener"),
465 pair<OUString,OUString>("com.sun.star.awt.XWindow","removeKeyListener"),
466 pair<OUString,OUString>("com.sun.star.awt.XWindow","addMouseListener"),
467 pair<OUString,OUString>("com.sun.star.awt.XWindow","removeMouseListener"),
468 pair<OUString,OUString>("com.sun.star.awt.XWindow","addMouseMotionListener"),
469 pair<OUString,OUString>("com.sun.star.awt.XWindow","removeMouseMotionListener"),
470 pair<OUString,OUString>("com.sun.star.awt.XWindow","addPaintListener"),
471 pair<OUString,OUString>("com.sun.star.awt.XWindow","removePaintListener"),
472 pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowResized"),
473 pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowMoved"),
474 pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowShown"),
475 pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowHidden"),
476 pair<OUString,OUString>("com.sun.star.awt.XWindowListener2","windowEnabled"),
477 pair<OUString,OUString>("com.sun.star.awt.XWindowListener2","windowDisabled"),
478 pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","setPointer"),
479 pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","setBackground"),
480 pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","invalidate"),
481 pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","invalidateRect"),
482 pair<OUString,OUString>("com.sun.star.awt.grid.XGridSelectionListener","selectionChanged"),
483 pair<OUString,OUString>("com.sun.star.awt.tab.XTabPageContainer","addTabPageContainerListener"),
484 pair<OUString,OUString>("com.sun.star.awt.tab.XTabPageContainer","removeTabPageContainerListener"),
485 pair<OUString,OUString>("com.sun.star.awt.tab.XTabPageContainerListener","tabPageActivated"),
486 pair<OUString,OUString>("com.sun.star.configuration.backend.XBackendChangesNotifier","addChangesListener"),
487 pair<OUString,OUString>("com.sun.star.configuration.backend.XBackendChangesNotifier","removeChangesListener"),
488 pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboard","setContents"),
489 pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardListener","changedContents"),
490 pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardNotifier","addClipboardListener"),
491 pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardNotifier","removeClipboardListener"),
492 pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardOwner","lostOwnership"),
493 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XAutoscroll","autoscroll"),
494 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragGestureListener","dragGestureRecognized"),
495 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragGestureRecognizer","addDragGestureListener"),
496 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragGestureRecognizer","removeDragGestureListener"),
497 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSource","startDrag"),
498 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceContext","setCursor"),
499 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceContext","setImage"),
500 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceContext","transferablesFlavorsChanged"),
501 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragDropEnd"),
502 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragEnter"),
503 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragExit"),
504 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragOver"),
505 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dropActionChanged"),
506 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTarget","addDropTargetListener"),
507 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTarget","removeDropTargetListener"),
508 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTarget","setDefaultActions"),
509 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDragContext","acceptDrag"),
510 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDragContext","rejectDrag"),
511 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDropContext","acceptDrop"),
512 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDropContext","rejectDrop"),
513 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDropContext","dropComplete"),
514 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dragEnter"),
515 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dragExit"),
516 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dragOver"),
517 pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dropActionChanged"),
518 pair<OUString,OUString>("com.sun.star.document.XEventBroadcaster","addEventListener"),
519 pair<OUString,OUString>("com.sun.star.document.XEventBroadcaster","removeEventListener"),
520 pair<OUString,OUString>("com.sun.star.document.XEventListener","notifyEvent"),
521 pair<OUString,OUString>("com.sun.star.document.XStorageChangeListener","notifyStorageChange"),
522 pair<OUString,OUString>("com.sun.star.drawing.XControlShape","setControl"),
523 pair<OUString,OUString>("com.sun.star.form.XApproveActionBroadcaster","addApproveActionListener"),
524 pair<OUString,OUString>("com.sun.star.form.XApproveActionBroadcaster","removeApproveActionListener"),
525 pair<OUString,OUString>("com.sun.star.form.XBoundControl","setLock"),
526 pair<OUString,OUString>("com.sun.star.form.XChangeBroadcaster","addChangeListener"),
527 pair<OUString,OUString>("com.sun.star.form.XChangeBroadcaster","removeChangeListener"),
528 pair<OUString,OUString>("com.sun.star.form.XChangeListener","changed"),
529 pair<OUString,OUString>("com.sun.star.form.XConfirmDeleteBroadcaster","addConfirmDeleteListener"),
530 pair<OUString,OUString>("com.sun.star.form.XConfirmDeleteBroadcaster","removeConfirmDeleteListener"),
531 pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster","addParameterListener"),
532 pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster","removeParameterListener"),
533 pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster2","addDatabaseParameterListener"),
534 pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster2","removeDatabaseParameterListener"),
535 pair<OUString,OUString>("com.sun.star.form.XErrorBroadcaster","addErrorListener"),
536 pair<OUString,OUString>("com.sun.star.form.XErrorBroadcaster","removeErrorListener"),
537 pair<OUString,OUString>("com.sun.star.form.XFormController","addActivateListener"),
538 pair<OUString,OUString>("com.sun.star.form.XFormController","removeActivateListener"),
539 pair<OUString,OUString>("com.sun.star.form.XFormControllerListener","formActivated"),
540 pair<OUString,OUString>("com.sun.star.form.XFormControllerListener","formDeactivated"),
541 pair<OUString,OUString>("com.sun.star.form.XGrid","setCurrentColumnPosition"),
542 pair<OUString,OUString>("com.sun.star.form.XGridPeer","setColumns"),
543 pair<OUString,OUString>("com.sun.star.form.XLoadListener","loaded"),
544 pair<OUString,OUString>("com.sun.star.form.XLoadListener","unloading"),
545 pair<OUString,OUString>("com.sun.star.form.XLoadListener","unloaded"),
546 pair<OUString,OUString>("com.sun.star.form.XLoadListener","reloading"),
547 pair<OUString,OUString>("com.sun.star.form.XLoadListener","reloaded"),
548 pair<OUString,OUString>("com.sun.star.form.XLoadable","load"),
549 pair<OUString,OUString>("com.sun.star.form.XLoadable","unload"),
550 pair<OUString,OUString>("com.sun.star.form.XLoadable","reload"),
551 pair<OUString,OUString>("com.sun.star.form.XLoadable","addLoadListener"),
552 pair<OUString,OUString>("com.sun.star.form.XLoadable","removeLoadListener"),
553 pair<OUString,OUString>("com.sun.star.form.XPositioningListener","positioned"),
554 pair<OUString,OUString>("com.sun.star.form.XReset","reset"),
555 pair<OUString,OUString>("com.sun.star.form.XReset","addResetListener"),
556 pair<OUString,OUString>("com.sun.star.form.XReset","removeResetListener"),
557 pair<OUString,OUString>("com.sun.star.form.XResetListener","resetted"),
558 pair<OUString,OUString>("com.sun.star.form.XSubmit","submit"),
559 pair<OUString,OUString>("com.sun.star.form.XSubmit","addSubmitListener"),
560 pair<OUString,OUString>("com.sun.star.form.XSubmit","removeSubmitListener"),
561 pair<OUString,OUString>("com.sun.star.form.XUpdateBroadcaster","addUpdateListener"),
562 pair<OUString,OUString>("com.sun.star.form.XUpdateBroadcaster","removeUpdateListener"),
563 pair<OUString,OUString>("com.sun.star.frame.XBrowseHistoryRegistry","updateViewData"),
564 pair<OUString,OUString>("com.sun.star.frame.XBrowseHistoryRegistry","createNewEntry"),
565 pair<OUString,OUString>("com.sun.star.frame.XConfigManager","addPropertyChangeListener"),
566 pair<OUString,OUString>("com.sun.star.frame.XConfigManager","removePropertyChangeListener"),
567 pair<OUString,OUString>("com.sun.star.frame.XConfigManager","flush"),
568 pair<OUString,OUString>("com.sun.star.frame.XDesktop","addTerminateListener"),
569 pair<OUString,OUString>("com.sun.star.frame.XDesktop","removeTerminateListener"),
570 pair<OUString,OUString>("com.sun.star.frame.XDispatch","dispatch"),
571 pair<OUString,OUString>("com.sun.star.frame.XDispatch","addStatusListener"),
572 pair<OUString,OUString>("com.sun.star.frame.XDispatch","removeStatusListener"),
573 pair<OUString,OUString>("com.sun.star.frame.XDocumentTemplates","update"),
574 pair<OUString,OUString>("com.sun.star.frame.XFrame","setCreator"),
575 pair<OUString,OUString>("com.sun.star.frame.XFrame","setName"),
576 pair<OUString,OUString>("com.sun.star.frame.XFrame","activate"),
577 pair<OUString,OUString>("com.sun.star.frame.XFrame","deactivate"),
578 pair<OUString,OUString>("com.sun.star.frame.XFrame","addFrameActionListener"),
579 pair<OUString,OUString>("com.sun.star.frame.XFrame","removeFrameActionListener"),
580 pair<OUString,OUString>("com.sun.star.frame.XFrameActionListener","frameAction"),
581 pair<OUString,OUString>("com.sun.star.frame.XFrameLoader","load"),
582 pair<OUString,OUString>("com.sun.star.frame.XFrameLoader","cancel"),
583 pair<OUString,OUString>("com.sun.star.frame.XLoadEventListener","loadFinished"),
584 pair<OUString,OUString>("com.sun.star.frame.XLoadEventListener","loadCancelled"),
585 pair<OUString,OUString>("com.sun.star.frame.XModel","connectController"),
586 pair<OUString,OUString>("com.sun.star.frame.XModel","disconnectController"),
587 pair<OUString,OUString>("com.sun.star.frame.XModel","lockControllers"),
588 pair<OUString,OUString>("com.sun.star.frame.XModel","unlockControllers"),
589 pair<OUString,OUString>("com.sun.star.frame.XNotifyingDispatch","dispatchWithNotification"),
590 pair<OUString,OUString>("com.sun.star.frame.XRecordableDispatch","dispatchAndRecord"),
591 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","addSessionManagerListener"),
592 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","removeSessionManagerListener"),
593 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","queryInteraction"),
594 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","interactionDone"),
595 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","saveDone"),
596 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener","doSave"),
597 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener","approveInteraction"),
598 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener","shutdownCanceled"),
599 pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener2","doQuit"),
600 pair<OUString,OUString>("com.sun.star.frame.XStatusListener","statusChanged"),
601 pair<OUString,OUString>("com.sun.star.frame.XTask","tileWindows"),
602 pair<OUString,OUString>("com.sun.star.frame.XTask","arrangeWindowsVertical"),
603 pair<OUString,OUString>("com.sun.star.frame.XTask","arrangeWindowsHorizontal"),
604 pair<OUString,OUString>("com.sun.star.frame.XWindowArranger","arrange"),
605 pair<OUString,OUString>("com.sun.star.inspection.XPropertyControlContext","activateNextControl"),
606 pair<OUString,OUString>("com.sun.star.inspection.XPropertyControlObserver","focusGained"),
607 pair<OUString,OUString>("com.sun.star.inspection.XPropertyControlObserver","valueChanged"),
608 pair<OUString,OUString>("com.sun.star.mozilla.XCloseSessionListener","sessionClosed"),
609 pair<OUString,OUString>("com.sun.star.mozilla.XMenuProxy","addMenuProxyListener"),
610 pair<OUString,OUString>("com.sun.star.mozilla.XMenuProxy","removeMenuProxyListener"),
611 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","start"),
612 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","stop"),
613 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","destroy"),
614 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","createWindow"),
615 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","newStream"),
616 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","newURL"),
617 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstanceNotifySink","notifyURL"),
618 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","showStatusMessage"),
619 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","enableScripting"),
620 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","newStream"),
621 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","getURL"),
622 pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","postURL"),
623 pair<OUString,OUString>("com.sun.star.mozilla.XPluginWindowPeer","setChildWindow"),
624 pair<OUString,OUString>("com.sun.star.script.vba.XVBACompatibility","addVBAScriptListener"),
625 pair<OUString,OUString>("com.sun.star.script.vba.XVBACompatibility","removeVBAScriptListener"),
626 pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccess","addDatabaseAccessListener"),
627 pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccess","removeDatabaseAccessListener"),
628 pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccessListener","connectionChanged"),
629 pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccessListener","connectionClosing"),
630 pair<OUString,OUString>("com.sun.star.sdb.XRowSetApproveBroadcaster","addRowSetApproveListener"),
631 pair<OUString,OUString>("com.sun.star.sdb.XRowSetApproveBroadcaster","removeRowSetApproveListener"),
632 pair<OUString,OUString>("com.sun.star.sdb.XRowSetChangeListener","onRowSetChanged"),
633 pair<OUString,OUString>("com.sun.star.sdb.XRowSetSupplier","setRowSet"),
634 pair<OUString,OUString>("com.sun.star.sdb.XRowsChangeListener","rowsChanged"),
635 pair<OUString,OUString>("com.sun.star.sdb.XSQLErrorBroadcaster","addSQLErrorListener"),
636 pair<OUString,OUString>("com.sun.star.sdb.XSQLErrorBroadcaster","removeSQLErrorListener"),
637 pair<OUString,OUString>("com.sun.star.sdbc.XRowSet","addRowSetListener"),
638 pair<OUString,OUString>("com.sun.star.sdbc.XRowSet","removeRowSetListener"),
639 pair<OUString,OUString>("com.sun.star.sdbc.XRowSetListener","cursorMoved"),
640 pair<OUString,OUString>("com.sun.star.sdbc.XRowSetListener","rowChanged"),
641 pair<OUString,OUString>("com.sun.star.sdbc.XRowSetListener","rowSetChanged"),
642 pair<OUString,OUString>("com.sun.star.sheet.XCalculatable","enableAutomaticCalculation"),
643 pair<OUString,OUString>("com.sun.star.sheet.XVolatileResult","addResultListener"),
644 pair<OUString,OUString>("com.sun.star.sheet.XVolatileResult","removeResultListener"),
645 pair<OUString,OUString>("com.sun.star.task.XJobExecutor","trigger"),
646 pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","start"),
647 pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","end"),
648 pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","setText"),
649 pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","setValue"),
650 pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","reset"),
651 pair<OUString,OUString>("com.sun.star.text.XSimpleText","insertString"),
652 pair<OUString,OUString>("com.sun.star.text.XTextCursor","collapseToStart"),
653 pair<OUString,OUString>("com.sun.star.text.XTextCursor","collapseToEnd"),
654 pair<OUString,OUString>("com.sun.star.text.XTextRange","setString"),
655 pair<OUString,OUString>("com.sun.star.text.XTextViewCursor","setVisible"),
656 pair<OUString,OUString>("com.sun.star.ucb.XCommandProcessor","abort"),
657 pair<OUString,OUString>("com.sun.star.ucb.XCommandProcessor2","releaseCommandIdentifier"),
658 pair<OUString,OUString>("com.sun.star.ucb.XContent","addContentEventListener"),
659 pair<OUString,OUString>("com.sun.star.ucb.XContent","removeContentEventListener"),
660 pair<OUString,OUString>("com.sun.star.ucb.XContentProviderManager","deregisterContentProvider"),
661 pair<OUString,OUString>("com.sun.star.ucb.XContentTransmitter","transmit"),
662 pair<OUString,OUString>("com.sun.star.ucb.XPropertySetRegistry","removePropertySet"),
663 pair<OUString,OUString>("com.sun.star.ui.XUIConfigurationListener","elementInserted"),
664 pair<OUString,OUString>("com.sun.star.ui.XUIConfigurationListener","elementRemoved"),
665 pair<OUString,OUString>("com.sun.star.ui.XUIConfigurationListener","elementReplaced"),
666 pair<OUString,OUString>("com.sun.star.ui.dialogs.XFilePickerNotifier","addFilePickerListener"),
667 pair<OUString,OUString>("com.sun.star.ui.dialogs.XFilePickerNotifier","removeFilePickerListener"),
668 pair<OUString,OUString>("com.sun.star.util.XBroadcaster","lockBroadcasts"),
669 pair<OUString,OUString>("com.sun.star.util.XBroadcaster","unlockBroadcasts"),
670 pair<OUString,OUString>("com.sun.star.util.XChangesListener","changesOccurred"),
671 pair<OUString,OUString>("com.sun.star.util.XChangesNotifier","addChangesListener"),
672 pair<OUString,OUString>("com.sun.star.util.XChangesNotifier","removeChangesListener"),
673 pair<OUString,OUString>("com.sun.star.util.XCloseBroadcaster","addCloseListener"),
674 pair<OUString,OUString>("com.sun.star.util.XCloseBroadcaster","removeCloseListener"),
675 pair<OUString,OUString>("com.sun.star.util.XFlushable","addFlushListener"),
676 pair<OUString,OUString>("com.sun.star.util.XFlushable","removeFlushListener"),
677 pair<OUString,OUString>("com.sun.star.util.XModeChangeListener","modeChanged"),
678 pair<OUString,OUString>("com.sun.star.util.XModifyBroadcaster","addModifyListener"),
679 pair<OUString,OUString>("com.sun.star.util.XModifyBroadcaster","removeModifyListener"),
680 pair<OUString,OUString>("com.sun.star.util.XRefreshable","addRefreshListener"),
681 pair<OUString,OUString>("com.sun.star.util.XRefreshable","removeRefreshListener"),
682 pair<OUString,OUString>("com.sun.star.util.XSearchDescriptor","setSearchString"),
683 pair<OUString,OUString>("com.sun.star.view.XPrintJobBroadcaster","addPrintJobListener"),
684 pair<OUString,OUString>("com.sun.star.view.XPrintJobBroadcaster","removePrintJobListener"),
685 pair<OUString,OUString>("com.sun.star.view.XPrintJobListener","printJobEvent"),
686 pair<OUString,OUString>("com.sun.star.view.XPrintableBroadcaster","addPrintableListener"),
687 pair<OUString,OUString>("com.sun.star.view.XPrintableBroadcaster","removePrintableListener"),
688 pair<OUString,OUString>("com.sun.star.view.XPrintableListener","stateChanged"),
689 pair<OUString,OUString>("com.sun.star.view.XSelectionChangeListener","selectionChanged"),
690 pair<OUString,OUString>("com.sun.star.beans.XMultiPropertySet","addPropertiesChangeListener"),
691 pair<OUString,OUString>("com.sun.star.beans.XMultiPropertySet","removePropertiesChangeListener"),
692 pair<OUString,OUString>("com.sun.star.beans.XMultiPropertySet","firePropertiesChangeEvent"),
693 pair<OUString,OUString>("com.sun.star.beans.XPropertiesChangeNotifier","addPropertiesChangeListener"),
694 pair<OUString,OUString>("com.sun.star.beans.XPropertiesChangeNotifier","removePropertiesChangeListener"),
695 pair<OUString,OUString>("com.sun.star.container.XContainer","addContainerListener"),
696 pair<OUString,OUString>("com.sun.star.container.XContainer","removeContainerListener"),
697 pair<OUString,OUString>("com.sun.star.container.XContainerListener","elementInserted"),
698 pair<OUString,OUString>("com.sun.star.container.XContainerListener","elementRemoved"),
699 pair<OUString,OUString>("com.sun.star.container.XContainerListener","elementReplaced"),
700 pair<OUString,OUString>("com.sun.star.container.XNamed","setName"),
701 pair<OUString,OUString>("com.sun.star.io.XDataExporter","exportData"),
702 pair<OUString,OUString>("com.sun.star.io.XDataExporter","cancel"),
703 pair<OUString,OUString>("com.sun.star.io.XDataImporter","importData"),
704 pair<OUString,OUString>("com.sun.star.io.XDataImporter","cancel"),
705 pair<OUString,OUString>("com.sun.star.io.XDataTransferEventListener","finished"),
706 pair<OUString,OUString>("com.sun.star.io.XDataTransferEventListener","cancelled"),
707 pair<OUString,OUString>("com.sun.star.lang.XConnectionPointContainer","advise"),
708 pair<OUString,OUString>("com.sun.star.lang.XConnectionPointContainer","unadvise"),
709 pair<OUString,OUString>("com.sun.star.script.XAllListener","firing"),
710 pair<OUString,OUString>("com.sun.star.uno.XInterface","acquire"),
711 pair<OUString,OUString>("com.sun.star.uno.XInterface","release"),
712 pair<OUString,OUString>("com.sun.star.uno.XReference","dispose")};
714 pair<OUString,OUString> k(_rListenerType, _rMethodName);
715 return delayed_event_listeners.find(k) != delayed_event_listeners.end();
719 void FormScriptListener::impl_doFireScriptEvent_nothrow( ::osl::ClearableMutexGuard& _rGuard, const ScriptEvent& _rEvent, Any* _pSynchronousResult )
721 OSL_PRECOND( m_pScriptExecutor, "FormScriptListener::impl_doFireScriptEvent_nothrow: this will crash!" );
723 _rGuard.clear();
724 m_pScriptExecutor->doFireScriptEvent( _rEvent, _pSynchronousResult );
728 void SAL_CALL FormScriptListener::firing( const ScriptEvent& _rEvent )
730 if ( _rEvent.ScriptType == "VBAInterop" )
731 return; // not handled here
733 ::osl::ClearableMutexGuard aGuard( m_aMutex );
735 if ( impl_isDisposed_nothrow() )
736 return;
738 if ( !impl_allowAsynchronousCall_nothrow( _rEvent.ListenerType.getTypeName(), _rEvent.MethodName ) )
740 impl_doFireScriptEvent_nothrow( aGuard, _rEvent, nullptr );
741 return;
744 acquire();
745 Application::PostUserEvent( LINK( this, FormScriptListener, OnAsyncScriptEvent ), new ScriptEvent( _rEvent ) );
749 Any SAL_CALL FormScriptListener::approveFiring( const ScriptEvent& _rEvent )
751 Any aResult;
753 ::osl::ClearableMutexGuard aGuard( m_aMutex );
754 if ( !impl_isDisposed_nothrow() )
755 impl_doFireScriptEvent_nothrow( aGuard, _rEvent, &aResult );
757 return aResult;
761 void SAL_CALL FormScriptListener::disposing( const EventObject& /*Source*/ )
763 // not interested in
767 void FormScriptListener::dispose()
769 ::osl::MutexGuard aGuard( m_aMutex );
770 m_pScriptExecutor = nullptr;
773 // tdf#88985 If LibreOffice tries to exit during the execution of a macro
774 // then: detect the effort, stop basic execution, block until the macro
775 // returns due to that stop, then restart the quit. This avoids the app
776 // exiting and destroying itself until the macro is parked at a safe place
777 // to do that.
778 class QuitGuard
780 private:
782 class TerminateListener : public cppu::WeakComponentImplHelper<css::frame::XTerminateListener,
783 css::lang::XServiceInfo>
785 private:
786 css::uno::Reference<css::frame::XDesktop2> m_xDesktop;
787 osl::Mutex maMutex;
788 bool mbQuitBlocked;
789 public:
790 // XTerminateListener
791 virtual void SAL_CALL queryTermination(const css::lang::EventObject& /*rEvent*/) override
793 mbQuitBlocked = true;
794 #if HAVE_FEATURE_SCRIPTING
795 StarBASIC::Stop();
796 #endif
797 throw css::frame::TerminationVetoException();
800 virtual void SAL_CALL notifyTermination(const css::lang::EventObject& /*rEvent*/) override
802 mbQuitBlocked = false;
805 using cppu::WeakComponentImplHelperBase::disposing;
807 virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) override
809 const bool bShutDown = (rEvent.Source == m_xDesktop);
810 if (bShutDown && m_xDesktop.is())
812 m_xDesktop->removeTerminateListener(this);
813 m_xDesktop.clear();
817 // XServiceInfo
818 virtual OUString SAL_CALL getImplementationName() override
820 return "com.sun.star.comp.svx.StarBasicQuitGuard";
823 virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
825 return cppu::supportsService(this, ServiceName);
828 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
830 return { "com.sun.star.svx.StarBasicQuitGuard" };
833 public:
834 TerminateListener()
835 : cppu::WeakComponentImplHelper<css::frame::XTerminateListener,
836 css::lang::XServiceInfo>(maMutex)
837 , mbQuitBlocked(false)
841 void start()
843 css::uno::Reference<css::uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
844 m_xDesktop = css::frame::Desktop::create(xContext);
845 m_xDesktop->addTerminateListener(this);
848 void stop()
850 if (!m_xDesktop.is())
851 return;
852 m_xDesktop->removeTerminateListener(this);
853 if (mbQuitBlocked)
854 m_xDesktop->terminate();
858 rtl::Reference<TerminateListener> mxListener;
859 public:
860 QuitGuard()
861 : mxListener(new TerminateListener)
863 mxListener->start();
866 ~QuitGuard()
868 mxListener->stop();
872 IMPL_LINK( FormScriptListener, OnAsyncScriptEvent, void*, p, void )
874 ScriptEvent* _pEvent = static_cast<ScriptEvent*>(p);
875 OSL_PRECOND( _pEvent != nullptr, "FormScriptListener::OnAsyncScriptEvent: invalid event!" );
876 if ( !_pEvent )
877 return;
880 ::osl::ClearableMutexGuard aGuard( m_aMutex );
882 if ( !impl_isDisposed_nothrow() )
884 QuitGuard aQuitGuard;
885 impl_doFireScriptEvent_nothrow( aGuard, *_pEvent, nullptr );
889 delete _pEvent;
890 // we acquired ourself immediately before posting the event
891 release();
894 FormScriptingEnvironment::FormScriptingEnvironment( FmFormModel& _rModel )
895 :m_rFormModel( _rModel )
896 ,m_bDisposed( false )
898 m_pScriptListener = ListenerImplementation( new FormScriptListener( this ) );
899 // note that this is a cyclic reference between the FormScriptListener and the FormScriptingEnvironment
900 // This cycle is broken up when our instance is disposed.
903 void FormScriptingEnvironment::impl_registerOrRevoke_throw( const Reference< XEventAttacherManager >& _rxManager, bool _bRegister )
905 ::osl::MutexGuard aGuard( m_aMutex );
907 if ( !_rxManager.is() )
908 throw IllegalArgumentException();
909 if ( m_bDisposed )
910 throw DisposedException();
914 if ( _bRegister )
915 _rxManager->addScriptListener( m_pScriptListener.get() );
916 else
917 _rxManager->removeScriptListener( m_pScriptListener.get() );
919 catch( const RuntimeException& ) { throw; }
920 catch( const Exception& )
922 DBG_UNHANDLED_EXCEPTION("svx");
927 void FormScriptingEnvironment::registerEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager )
929 impl_registerOrRevoke_throw( _rxManager, true );
933 void FormScriptingEnvironment::revokeEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager )
935 impl_registerOrRevoke_throw( _rxManager, false );
939 IFormScriptingEnvironment::~IFormScriptingEnvironment()
944 namespace
946 class NewStyleUNOScript
948 SfxObjectShell& m_rObjectShell;
949 const OUString m_sScriptCode;
951 public:
952 NewStyleUNOScript( SfxObjectShell& _rObjectShell, const OUString& _rScriptCode )
953 :m_rObjectShell( _rObjectShell )
954 ,m_sScriptCode( _rScriptCode )
958 void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult );
962 void NewStyleUNOScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult )
964 Sequence< sal_Int16 > aOutArgsIndex;
965 Sequence< Any > aOutArgs;
966 EventObject aEvent;
967 Any aCaller;
968 if ( _rArguments.hasElements() && ( _rArguments[ 0 ] >>= aEvent ) )
972 Reference< XControl > xControl( aEvent.Source, UNO_QUERY_THROW );
973 Reference< XPropertySet > xProps( xControl->getModel(), UNO_QUERY_THROW );
974 aCaller = xProps->getPropertyValue("Name");
976 catch( Exception& ) {}
978 m_rObjectShell.CallXScript( m_sScriptCode, _rArguments, _rSynchronousResult, aOutArgsIndex, aOutArgs, true, aCaller.hasValue() ? &aCaller : nullptr );
983 void FormScriptingEnvironment::doFireScriptEvent( const ScriptEvent& _rEvent, Any* _pSynchronousResult )
985 #if !HAVE_FEATURE_SCRIPTING
986 (void) _rEvent;
987 (void) _pSynchronousResult;
988 (void) m_rFormModel;
989 #else
990 SolarMutexClearableGuard aSolarGuard;
991 ::osl::ClearableMutexGuard aGuard( m_aMutex );
993 if ( m_bDisposed )
994 return;
996 // SfxObjectShellRef is good here since the model controls the lifetime of the object
997 SfxObjectShellRef xObjectShell = m_rFormModel.GetObjectShell();
998 if( !xObjectShell.is() )
999 return;
1001 // the script to execute
1002 std::shared_ptr< NewStyleUNOScript > pScript;
1004 if ( _rEvent.ScriptType != "StarBasic" )
1006 pScript.reset( new NewStyleUNOScript( *xObjectShell, _rEvent.ScriptCode ) );
1008 else
1010 OUString sScriptCode = _rEvent.ScriptCode;
1011 OUString sMacroLocation;
1013 // is there a location in the script name ("application" or "document")?
1014 sal_Int32 nPrefixLen = sScriptCode.indexOf( ':' );
1015 DBG_ASSERT( 0 <= nPrefixLen, "FormScriptingEnvironment::doFireScriptEvent: Basic script name in old format encountered!" );
1017 if ( 0 <= nPrefixLen )
1019 // and it has such a prefix
1020 sMacroLocation = sScriptCode.copy( 0, nPrefixLen );
1021 DBG_ASSERT( sMacroLocation == "document"
1022 || sMacroLocation == "application",
1023 "FormScriptingEnvironment::doFireScriptEvent: invalid (unknown) prefix!" );
1025 // strip the prefix: the SfxObjectShell::CallScript knows nothing about such prefixes
1026 sScriptCode = sScriptCode.copy( nPrefixLen + 1 );
1029 if ( sMacroLocation.isEmpty() )
1031 // legacy format: use the app-wide Basic, if it has a respective method, otherwise fall back to the doc's Basic
1032 if ( SfxApplication::GetBasicManager()->HasMacro( sScriptCode ) )
1033 sMacroLocation = "application";
1034 else
1035 sMacroLocation = "document";
1038 OUString sScriptURI = "vnd.sun.star.script:" +
1039 sScriptCode +
1040 "?language=Basic&location=" +
1041 sMacroLocation;
1043 pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) );
1046 assert(pScript && "FormScriptingEnvironment::doFireScriptEvent: no script to execute!");
1048 aGuard.clear();
1049 aSolarGuard.clear();
1051 Any aIgnoreResult;
1052 pScript->invoke( _rEvent.Arguments, _pSynchronousResult ? *_pSynchronousResult : aIgnoreResult );
1053 pScript.reset();
1056 // object shells are not thread safe, so guard the destruction
1057 SolarMutexGuard aSolarGuarsReset;
1058 xObjectShell = nullptr;
1060 #endif
1064 void FormScriptingEnvironment::dispose()
1066 ::osl::MutexGuard aGuard( m_aMutex );
1067 m_bDisposed = true;
1068 m_pScriptListener->dispose();
1069 m_pScriptListener.clear();
1073 PFormScriptingEnvironment createDefaultFormScriptingEnvironment( FmFormModel& _rModel )
1075 return new FormScriptingEnvironment( _rModel );
1082 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */