LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / forms / source / component / DatabaseForm.hxx
blob4e7a670d0d23f2ffa981aecd79bf7ba5949ca83c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <sal/config.h>
24 #include <string_view>
25 #include <vector>
27 #include <propertybaghelper.hxx>
28 #include <com/sun/star/sdb/XSQLErrorListener.hpp>
29 #include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp>
30 #include <com/sun/star/form/FormSubmitMethod.hpp>
31 #include <com/sun/star/form/FormSubmitEncoding.hpp>
32 #include <com/sun/star/form/XSubmit.hpp>
33 #include <com/sun/star/form/XReset.hpp>
34 #include <com/sun/star/form/XDatabaseParameterBroadcaster2.hpp>
35 #include <com/sun/star/sdb/XCompletedExecution.hpp>
36 #include <com/sun/star/sdbc/XRowSet.hpp>
37 #include <com/sun/star/sdbcx/XDeleteRows.hpp>
38 #include <com/sun/star/sdbc/XResultSetUpdate.hpp>
39 #include <com/sun/star/sdb/XRowSetApproveListener.hpp>
40 #include <com/sun/star/sdb/XRowSetApproveBroadcaster.hpp>
41 #include <com/sun/star/form/NavigationBarMode.hpp>
42 #include <com/sun/star/form/XLoadable.hpp>
43 #include <com/sun/star/form/XLoadListener.hpp>
44 #include <com/sun/star/form/XForm.hpp>
45 #include <com/sun/star/awt/XTabControllerModel.hpp>
46 #include <com/sun/star/sdbc/XRowSetListener.hpp>
47 #include <com/sun/star/sdbc/XCloseable.hpp>
48 #include <com/sun/star/container/XNamed.hpp>
49 #include <com/sun/star/lang/XServiceInfo.hpp>
50 #include <com/sun/star/sdbc/XParameters.hpp>
51 #include <com/sun/star/sdbc/XConnection.hpp>
52 #include <com/sun/star/task/XInteractionHandler.hpp>
53 #include <com/sun/star/beans/XPropertyContainer.hpp>
54 #include <com/sun/star/beans/XPropertyAccess.hpp>
55 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
58 #include <tools/link.hxx>
59 #include <InterfaceContainer.hxx>
61 #include <connectivity/parameters.hxx>
62 #include <connectivity/filtermanager.hxx>
63 #include <connectivity/warningscontainer.hxx>
65 #include <listenercontainers.hxx>
66 #include <comphelper/propmultiplex.hxx>
67 #include <comphelper/uno3.hxx>
68 #include <cppuhelper/implbase12.hxx>
69 #include <cppuhelper/implbase4.hxx>
70 #include <cppuhelper/implbase7.hxx>
71 #include <rtl/ref.hxx>
73 namespace com::sun::star::sdbc { class SQLException; }
75 class Timer;
76 class INetMIMEMessage;
79 namespace frm
83 //= html tools
86 const sal_uInt16 SUCCESSFUL_REPRESENT_TEXT = 0x0001;
87 const sal_uInt16 SUCCESSFUL_REPRESENT_FILE = 0x0002;
90 class HtmlSuccessfulObj
92 public:
93 OUString aName;
94 OUString aValue;
95 sal_uInt16 nRepresentation;
97 HtmlSuccessfulObj( const OUString& _rName, const OUString& _rValue,
98 sal_uInt16 _nRepresent = SUCCESSFUL_REPRESENT_TEXT )
99 :aName( _rName )
100 ,aValue( _rValue )
101 ,nRepresentation( _nRepresent )
106 typedef std::vector<HtmlSuccessfulObj> HtmlSuccessfulObjList;
109 class OGroupManager;
110 class OFormSubmitResetThread;
111 typedef ::cppu::ImplHelper12 < css::form::XForm
112 , css::awt::XTabControllerModel
113 , css::form::XLoadListener
114 , css::sdbc::XRowSetListener
115 , css::sdb::XRowSetApproveListener
116 , css::form::XDatabaseParameterBroadcaster2
117 , css::sdb::XSQLErrorListener
118 , css::sdb::XSQLErrorBroadcaster
119 , css::form::XReset
120 , css::form::XSubmit
121 , css::form::XLoadable
122 , css::container::XNamed
123 > ODatabaseForm_BASE1;
126 typedef ::cppu::ImplHelper4 < css::lang::XServiceInfo
127 , css::beans::XPropertyContainer
128 , css::beans::XPropertyAccess
129 , css::sdbc::XWarningsSupplier
130 > ODatabaseForm_BASE2;
132 typedef ::cppu::ImplHelper7< css::sdbc::XCloseable,
133 css::sdbc::XRowSet,
134 css::sdb::XCompletedExecution,
135 css::sdb::XRowSetApproveBroadcaster,
136 css::sdbc::XResultSetUpdate,
137 css::sdbcx::XDeleteRows,
138 css::sdbc::XParameters > ODatabaseForm_BASE3;
141 class ODatabaseForm :public OFormComponents
142 ,public OPropertySetAggregationHelper
143 ,public OPropertyChangeListener
144 ,public ODatabaseForm_BASE1
145 ,public ODatabaseForm_BASE2
146 ,public ODatabaseForm_BASE3
147 ,public IPropertyBagHelperContext
149 friend class OFormSubmitResetThread;
151 // listener administration
152 ::comphelper::OInterfaceContainerHelper2 m_aLoadListeners;
153 ::comphelper::OInterfaceContainerHelper2 m_aRowSetApproveListeners;
154 ::comphelper::OInterfaceContainerHelper2 m_aSubmitListeners;
155 ::comphelper::OInterfaceContainerHelper2 m_aErrorListeners;
156 ResetListeners m_aResetListeners;
157 ::osl::Mutex m_aResetSafety;
158 css::uno::Any m_aCycle;
159 css::uno::Any m_aIgnoreResult; // set when we are a subform and our master form positioned on a new row
160 css::uno::Sequence< OUString > m_aMasterFields;
161 css::uno::Sequence< OUString > m_aDetailFields;
163 // the object doin' most of the work - an SDB-rowset
164 css::uno::Reference< css::uno::XAggregation> m_xAggregate;
165 // same object, interface as member because of performance reasons
166 css::uno::Reference< css::sdbc::XRowSet> m_xAggregateAsRowSet;
168 PropertyBagHelper m_aPropertyBagHelper;
169 ::dbtools::WarningsContainer m_aWarnings;
170 rtl::Reference<OPropertyChangeMultiplexer> m_xAggregatePropertyMultiplexer;
171 // Management of the Control Groups
172 rtl::Reference<OGroupManager> m_pGroupManager;
173 ::dbtools::ParameterManager m_aParameterManager;
174 ::dbtools::FilterManager m_aFilterManager;
175 std::unique_ptr<Timer> m_pLoadTimer;
177 rtl::Reference<OFormSubmitResetThread> m_pThread;
178 OUString m_sCurrentErrorContext;
179 // will be used as additional context information
180 // when an exception is caught and forwarded to the listeners
182 sal_Int32 m_nResetsPending;
183 // <overwritten_properties>
184 sal_Int32 m_nPrivileges;
185 bool m_bInsertOnly;
186 // </overwritten_properties>
188 // <properties>
189 css::uno::Any m_aControlBorderColorFocus;
190 css::uno::Any m_aControlBorderColorMouse;
191 css::uno::Any m_aControlBorderColorInvalid;
192 css::uno::Any m_aDynamicControlBorder;
193 OUString m_sName;
194 OUString m_aTargetURL;
195 OUString m_aTargetFrame;
196 css::form::FormSubmitMethod m_eSubmitMethod;
197 css::form::FormSubmitEncoding m_eSubmitEncoding;
198 css::form::NavigationBarMode m_eNavigation;
199 bool m_bAllowInsert : 1;
200 bool m_bAllowUpdate : 1;
201 bool m_bAllowDelete : 1;
202 // </properties>
203 bool m_bLoaded : 1;
204 bool m_bSubForm : 1;
205 bool m_bForwardingConnection : 1; // true if we're setting the ActiveConnection on the aggregate
206 bool m_bSharingConnection : 1; // true if the connection we're using is shared with our parent
208 public:
209 explicit ODatabaseForm(const css::uno::Reference< css::uno::XComponentContext>& _rxFactory);
210 ODatabaseForm( const ODatabaseForm& _cloneSource );
211 virtual ~ODatabaseForm() override;
213 // UNO binding
214 DECLARE_UNO3_AGG_DEFAULTS(ODatabaseForm, OFormComponents)
215 virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type& _rType) override;
217 // XTypeProvider
218 virtual css::uno::Sequence< css::uno::Type> SAL_CALL getTypes( ) override;
219 virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) override;
221 // css::lang::XComponent
222 virtual void SAL_CALL disposing() override;
224 // property handling
225 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
226 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
227 virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle ) const override;
228 virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any& rConvertedValue, css::uno::Any& rOldValue, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
229 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any& rValue) override;
231 css::uno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle ) override;
232 void fire( sal_Int32 * pnHandles, const css::uno::Any * pNewValues, const css::uno::Any * pOldValues, sal_Int32 nCount );
234 // IPropertyBagHelperContext
235 virtual ::osl::Mutex& getMutex() override;
236 virtual void describeFixedAndAggregateProperties(
237 css::uno::Sequence< css::beans::Property >& _out_rFixedProperties,
238 css::uno::Sequence< css::beans::Property >& _out_rAggregateProperties
239 ) const override;
240 virtual css::uno::Reference< css::beans::XMultiPropertySet >
241 getPropertiesInterface() override;
243 // css::beans::XPropertyState
244 virtual css::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle) override;
245 virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle) override;
246 virtual css::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const override;
248 // css::sdbc::XSQLErrorBroadcaster
249 virtual void SAL_CALL addSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener>& _rxListener) override;
250 virtual void SAL_CALL removeSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener>& _rxListener) override;
252 // css::form::XForm
253 // nothing to implement
255 // css::form::XReset
256 virtual void SAL_CALL reset() override;
257 virtual void SAL_CALL addResetListener(const css::uno::Reference< css::form::XResetListener>& _rxListener) override;
258 virtual void SAL_CALL removeResetListener(const css::uno::Reference< css::form::XResetListener>& _rxListener) override;
260 // css::form::XSubmit
261 virtual void SAL_CALL submit(const css::uno::Reference< css::awt::XControl>& aControl, const css::awt::MouseEvent& aMouseEvt) override;
262 virtual void SAL_CALL addSubmitListener(const css::uno::Reference< css::form::XSubmitListener>& _rxListener) override;
263 virtual void SAL_CALL removeSubmitListener(const css::uno::Reference< css::form::XSubmitListener>& _rxListener) override;
265 // css::container::XChild
266 virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getParent() override { return OFormComponents::getParent(); }
267 virtual void SAL_CALL setParent(const css::uno::Reference<css::uno::XInterface>& Parent) override;
269 // css::container::XNamed
270 virtual OUString SAL_CALL getName() override;
271 virtual void SAL_CALL setName(const OUString& aName) override;
273 // css::awt::XTabControllerModel
274 virtual sal_Bool SAL_CALL getGroupControl() override;
275 virtual void SAL_CALL setGroupControl(sal_Bool /*_bGroupControl*/) override { }
276 virtual void SAL_CALL setControlModels(const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& _rControls) override;
277 virtual css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > > SAL_CALL getControlModels() override;
278 virtual void SAL_CALL setGroup(const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& _rGroup, const OUString& _rGroupName) override;
279 virtual sal_Int32 SAL_CALL getGroupCount() override;
280 virtual void SAL_CALL getGroup(sal_Int32 _nGroup, css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& _rxGroup, OUString& _rName) override;
281 virtual void SAL_CALL getGroupByName(const OUString& _rName, css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& _rxGroup) override;
283 // css::lang::XEventListener
284 virtual void SAL_CALL disposing(const css::lang::EventObject& _rSource) override;
286 // css::form::XLoadListener
287 virtual void SAL_CALL loaded(const css::lang::EventObject& aEvent) override;
288 virtual void SAL_CALL unloading(const css::lang::EventObject& aEvent) override;
289 virtual void SAL_CALL unloaded(const css::lang::EventObject& aEvent) override;
290 virtual void SAL_CALL reloading(const css::lang::EventObject& aEvent) override;
291 virtual void SAL_CALL reloaded(const css::lang::EventObject& aEvent) override;
293 // css::form::XLoadable
294 virtual void SAL_CALL load() override;
295 virtual void SAL_CALL unload() override;
296 virtual void SAL_CALL reload() override;
297 virtual sal_Bool SAL_CALL isLoaded() override;
298 virtual void SAL_CALL addLoadListener(const css::uno::Reference< css::form::XLoadListener>& _rxListener) override;
299 virtual void SAL_CALL removeLoadListener(const css::uno::Reference< css::form::XLoadListener>& _rxListener) override;
301 // css::sdbc::XCloseable
302 virtual void SAL_CALL close() override;
304 // css::sdbc::XRowSetListener
305 virtual void SAL_CALL cursorMoved(const css::lang::EventObject& event) override;
306 virtual void SAL_CALL rowChanged(const css::lang::EventObject& event) override;
307 virtual void SAL_CALL rowSetChanged(const css::lang::EventObject& event) override;
309 // css::sdb::XRowSetApproveListener
310 virtual sal_Bool SAL_CALL approveCursorMove(const css::lang::EventObject& event) override;
311 virtual sal_Bool SAL_CALL approveRowChange(const css::sdb::RowChangeEvent& event) override;
312 virtual sal_Bool SAL_CALL approveRowSetChange(const css::lang::EventObject& event) override;
314 // css::sdb::XRowSetApproveBroadcaster
315 virtual void SAL_CALL addRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener>& _rxListener) override;
316 virtual void SAL_CALL removeRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener>& _rxListener) override;
318 // com::sun:star::form::XDatabaseParameterBroadcaster2
319 virtual void SAL_CALL addDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& _rxListener) override;
320 virtual void SAL_CALL removeDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& _rxListener) override;
322 // com::sun:star::form::XDatabaseParameterBroadcaster
323 virtual void SAL_CALL addParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& _rxListener) override;
324 virtual void SAL_CALL removeParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& _rxListener) override;
326 // css::sdbc::XRowSet
327 virtual void SAL_CALL execute() override;
328 virtual void SAL_CALL addRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener>& _rxListener) override;
329 virtual void SAL_CALL removeRowSetListener(const css::uno::Reference< css::sdbc::XRowSetListener>& _rxListener) override;
331 // css::sdb::XCompletedExecution
332 virtual void SAL_CALL executeWithCompletion( const css::uno::Reference< css::task::XInteractionHandler >& handler ) override;
334 // css::sdbc::XResultSet
335 virtual sal_Bool SAL_CALL next() override;
336 virtual sal_Bool SAL_CALL isBeforeFirst() override;
337 virtual sal_Bool SAL_CALL isAfterLast() override;
338 virtual sal_Bool SAL_CALL isFirst() override;
339 virtual sal_Bool SAL_CALL isLast() override;
340 virtual void SAL_CALL beforeFirst() override;
341 virtual void SAL_CALL afterLast() override;
342 virtual sal_Bool SAL_CALL first() override;
343 virtual sal_Bool SAL_CALL last() override;
344 virtual sal_Int32 SAL_CALL getRow() override;
345 virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override;
346 virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override;
347 virtual sal_Bool SAL_CALL previous() override;
348 virtual void SAL_CALL refreshRow() override;
349 virtual sal_Bool SAL_CALL rowUpdated() override;
350 virtual sal_Bool SAL_CALL rowInserted() override;
351 virtual sal_Bool SAL_CALL rowDeleted() override;
352 virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getStatement() override;
354 // css::sdbc::XResultSetUpdate
355 virtual void SAL_CALL insertRow() override;
356 virtual void SAL_CALL updateRow() override;
357 virtual void SAL_CALL deleteRow() override;
358 virtual void SAL_CALL cancelRowUpdates() override;
359 virtual void SAL_CALL moveToInsertRow() override;
360 virtual void SAL_CALL moveToCurrentRow() override;
362 // css::sdbcx::XDeleteRows
363 virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows(const css::uno::Sequence< css::uno::Any>& rows) override;
365 // css::lang::XServiceInfo
366 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
367 virtual OUString SAL_CALL getImplementationName() override;
368 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
370 // css::io::XPersistObject
371 virtual OUString SAL_CALL getServiceName() override;
372 virtual void SAL_CALL write(const css::uno::Reference< css::io::XObjectOutputStream>& _rxOutStream) override;
373 virtual void SAL_CALL read(const css::uno::Reference< css::io::XObjectInputStream>& _rxInStream) override;
375 // css::sdbc::XSQLErrorListener
376 virtual void SAL_CALL errorOccured(const css::sdb::SQLErrorEvent& aEvent) override;
378 // css::sdbc::XParameters
379 virtual void SAL_CALL setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) override;
380 virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName) override;
381 virtual void SAL_CALL setBoolean(sal_Int32 parameterIndex, sal_Bool x) override;
382 virtual void SAL_CALL setByte(sal_Int32 parameterIndex, sal_Int8 x) override;
383 virtual void SAL_CALL setShort(sal_Int32 parameterIndex, sal_Int16 x) override;
384 virtual void SAL_CALL setInt(sal_Int32 parameterIndex, sal_Int32 x) override;
385 virtual void SAL_CALL setLong(sal_Int32 parameterIndex, sal_Int64 x) override;
386 virtual void SAL_CALL setFloat(sal_Int32 parameterIndex, float x) override;
387 virtual void SAL_CALL setDouble(sal_Int32 parameterIndex, double x) override;
388 virtual void SAL_CALL setString(sal_Int32 parameterIndex, const OUString& x) override;
389 virtual void SAL_CALL setBytes(sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 >& x) override;
390 virtual void SAL_CALL setDate(sal_Int32 parameterIndex, const css::util::Date& x) override;
391 virtual void SAL_CALL setTime(sal_Int32 parameterIndex, const css::util::Time& x) override;
392 virtual void SAL_CALL setTimestamp(sal_Int32 parameterIndex, const css::util::DateTime& x) override;
393 virtual void SAL_CALL setBinaryStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream>& x, sal_Int32 length) override;
394 virtual void SAL_CALL setCharacterStream(sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream>& x, sal_Int32 length) override;
395 virtual void SAL_CALL setObject(sal_Int32 parameterIndex, const css::uno::Any& x) override;
396 virtual void SAL_CALL setObjectWithInfo(sal_Int32 parameterIndex, const css::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale) override;
397 virtual void SAL_CALL setRef(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef>& x) override;
398 virtual void SAL_CALL setBlob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob>& x) override;
399 virtual void SAL_CALL setClob(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob>& x) override;
400 virtual void SAL_CALL setArray(sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray>& x) override;
401 virtual void SAL_CALL clearParameters() override;
403 // XPropertyChangeListener
404 virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
406 // XPropertyContainer
407 virtual void SAL_CALL addProperty( const OUString& Name, ::sal_Int16 Attributes, const css::uno::Any& DefaultValue ) override;
408 virtual void SAL_CALL removeProperty( const OUString& Name ) override;
410 // XPropertyAccess
411 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues( ) override;
412 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< css::beans::PropertyValue >& aProps ) override;
413 using OPropertySetAggregationHelper::setPropertyValues;
415 // XWarningsSupplier
416 virtual css::uno::Any SAL_CALL getWarnings( ) override;
417 virtual void SAL_CALL clearWarnings( ) override;
419 // XCloneable
420 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
422 protected:
423 // OPropertySetAggregationHelper overridables
424 virtual void forwardingPropertyValue( sal_Int32 _nHandle ) override;
425 virtual void forwardedPropertyValue( sal_Int32 _nHandle ) override;
427 // OInterfaceContainer overridables
428 virtual void implInserted( const ElementDescription* _pElement ) override;
429 virtual void implRemoved(const css::uno::Reference<css::uno::XInterface>& _rxObject) override;
431 // OPropertyChangeListener
432 virtual void _propertyChanged( const css::beans::PropertyChangeEvent& ) override;
434 private:
435 bool executeRowSet(::osl::ResettableMutexGuard& _rClearForNotifies, bool bMoveToFirst,
436 const css::uno::Reference< css::task::XInteractionHandler >& _rxCompletionHandler);
437 bool fillParameters(::osl::ResettableMutexGuard& _rClearForNotifies,
438 const css::uno::Reference< css::task::XInteractionHandler >& _rxCompletionHandler);
439 void updateParameterInfo();
440 bool hasValidParent() const;
442 // impl methods
443 /// @throws css::uno::RuntimeException
444 void load_impl(bool bCausedByParentForm, bool bMoveToFirst = true,
445 const css::uno::Reference< css::task::XInteractionHandler >& _rxCompletionHandler = css::uno::Reference< css::task::XInteractionHandler >());
446 /// @throws css::uno::RuntimeException
447 void reload_impl(bool bMoveToFirst,
448 const css::uno::Reference< css::task::XInteractionHandler >& _rxCompletionHandler = css::uno::Reference< css::task::XInteractionHandler >());
449 void submit_impl(const css::uno::Reference< css::awt::XControl>& Control, const css::awt::MouseEvent& MouseEvt);
450 void reset_impl(bool _bApproveByListeners);
452 bool implEnsureConnection();
454 // connection sharing
456 /// checks if we can re-use (aka share) the connection of the given parent
457 bool canShareConnection( const css::uno::Reference< css::beans::XPropertySet >& _rxParentProps );
459 /// starts sharing the connection with the parent
460 void doShareConnection( const css::uno::Reference< css::beans::XPropertySet >& _rxParentProps );
462 /// stops sharing the connection with the parent
463 void stopSharingConnection( );
465 /// called when the connection which we share with our parent is being disposed
466 void disposingSharedConnection( const css::uno::Reference< css::sdbc::XConnection >& _rxConn );
468 /// checks if we currently share our connection with our parent
469 bool isSharingConnection( ) const { return m_bSharingConnection; }
471 /** calls our row set approval listeners
473 @param _rEvent
474 the event to notify
475 @param _bAllowSQLException
476 <TRUE/> if SQLExceptions are allowed to leave the method
477 @param _rGuard
478 the guard to be cleared before actually calling into the listeners, but after making
479 a copy of the listeners array to operate on.
480 @return
481 <TRUE/> if and only if the execution has been approved
483 bool impl_approveRowChange_throw(
484 const css::lang::EventObject& _rEvent,
485 const bool _bAllowSQLException,
486 ::osl::ClearableMutexGuard& _rGuard
489 /// invalidate all our parameter-related stuff
490 void invalidateParameters();
492 void saveInsertOnlyState( );
493 void restoreInsertOnlyState( );
495 // error handling
496 void onError(const css::sdb::SQLErrorEvent& _rEvent);
497 void onError(const css::sdbc::SQLException&, const OUString& _rContextDescription);
499 // html tools
500 OUString GetDataEncoded(bool _bURLEncoded,const css::uno::Reference< css::awt::XControl>& SubmitButton, const css::awt::MouseEvent& MouseEvt);
501 css::uno::Sequence<sal_Int8> GetDataMultiPartEncoded(const css::uno::Reference< css::awt::XControl>& SubmitButton, const css::awt::MouseEvent& MouseEvt,
502 OUString& rContentType);
504 void AppendComponent(HtmlSuccessfulObjList& rList, const css::uno::Reference< css::beans::XPropertySet>& xComponentSet, std::u16string_view rNamePrefix,
505 const css::uno::Reference< css::awt::XControl>& rxSubmitButton, const css::awt::MouseEvent& MouseEvt);
507 void FillSuccessfulList(HtmlSuccessfulObjList& rList, const css::uno::Reference< css::awt::XControl>& rxSubmitButton, const css::awt::MouseEvent& MouseEvt);
509 static void InsertTextPart(INetMIMEMessage& rParent, std::u16string_view rName, std::u16string_view rData);
510 static void InsertFilePart(INetMIMEMessage& rParent, std::u16string_view rName, const OUString& rFileName);
511 static void Encode(OUString& rString);
513 css::uno::Reference< css::sdbc::XConnection > getConnection();
515 void impl_createLoadTimer();
517 void impl_construct();
519 DECL_LINK( OnTimeout, Timer*, void );
520 protected:
521 using OPropertySetHelper::getPropertyValues;
525 } // namespace frm
527 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */