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