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