1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef FORMS_FORMOPERATIONS_HXX 29*cdf0e10cSrcweir #define FORMS_FORMOPERATIONS_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir /** === begin UNO includes === **/ 32*cdf0e10cSrcweir #include <com/sun/star/form/runtime/XFormOperations.hpp> 33*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 34*cdf0e10cSrcweir #include <com/sun/star/form/XForm.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/form/XLoadable.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/util/XModifyListener.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 41*cdf0e10cSrcweir /** === end UNO includes === **/ 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir #include <comphelper/componentcontext.hxx> 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx> 46*cdf0e10cSrcweir #include <cppuhelper/compbase6.hxx> 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir //........................................................................ 49*cdf0e10cSrcweir namespace frm 50*cdf0e10cSrcweir { 51*cdf0e10cSrcweir //........................................................................ 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir //==================================================================== 54*cdf0e10cSrcweir //= FormOperations 55*cdf0e10cSrcweir //==================================================================== 56*cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper6 < ::com::sun::star::form::runtime::XFormOperations 57*cdf0e10cSrcweir , ::com::sun::star::lang::XInitialization 58*cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo 59*cdf0e10cSrcweir , ::com::sun::star::beans::XPropertyChangeListener 60*cdf0e10cSrcweir , ::com::sun::star::util::XModifyListener 61*cdf0e10cSrcweir , ::com::sun::star::sdbc::XRowSetListener 62*cdf0e10cSrcweir > FormOperations_Base; 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir class FormOperations :public ::cppu::BaseMutex 65*cdf0e10cSrcweir ,public FormOperations_Base 66*cdf0e10cSrcweir { 67*cdf0e10cSrcweir public: 68*cdf0e10cSrcweir class MethodGuard; 69*cdf0e10cSrcweir 70*cdf0e10cSrcweir private: 71*cdf0e10cSrcweir ::comphelper::ComponentContext m_aContext; 72*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > m_xController; 73*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xCursor; 74*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate > m_xUpdateCursor; 75*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xCursorProperties; 76*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable > m_xLoadableForm; 77*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFeatureInvalidation > 78*cdf0e10cSrcweir m_xFeatureInvalidation; 79*cdf0e10cSrcweir mutable ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > 80*cdf0e10cSrcweir m_xParser; 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir bool m_bInitializedParser; 83*cdf0e10cSrcweir bool m_bActiveControlModified; 84*cdf0e10cSrcweir bool m_bConstructed; 85*cdf0e10cSrcweir #ifdef DBG_UTIL 86*cdf0e10cSrcweir mutable long 87*cdf0e10cSrcweir m_nMethodNestingLevel; 88*cdf0e10cSrcweir #endif 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir public: 91*cdf0e10cSrcweir FormOperations( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxContext ); 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir // XServiceInfo - static versions 94*cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException); 95*cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException); 96*cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 97*cdf0e10cSrcweir Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir struct MethodAccess { friend class MethodGuard; private: MethodAccess() { } }; 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir inline void enterMethod( MethodAccess ) const 102*cdf0e10cSrcweir { 103*cdf0e10cSrcweir m_aMutex.acquire(); 104*cdf0e10cSrcweir impl_checkDisposed_throw(); 105*cdf0e10cSrcweir #ifdef DBG_UTIL 106*cdf0e10cSrcweir ++m_nMethodNestingLevel; 107*cdf0e10cSrcweir #endif 108*cdf0e10cSrcweir } 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir inline void leaveMethod( MethodAccess ) const 111*cdf0e10cSrcweir { 112*cdf0e10cSrcweir m_aMutex.release(); 113*cdf0e10cSrcweir #ifdef DBG_UTIL 114*cdf0e10cSrcweir --m_nMethodNestingLevel; 115*cdf0e10cSrcweir #endif 116*cdf0e10cSrcweir } 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir protected: 119*cdf0e10cSrcweir virtual ~FormOperations(); 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir // XInitialization 122*cdf0e10cSrcweir virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir // XServiceInfo 125*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 126*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 127*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); 128*cdf0e10cSrcweir 129*cdf0e10cSrcweir // XFormOperations 130*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > SAL_CALL getCursor() throw (::com::sun::star::uno::RuntimeException); 131*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate > SAL_CALL getUpdateCursor() throw (::com::sun::star::uno::RuntimeException); 132*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > SAL_CALL getController() throw (::com::sun::star::uno::RuntimeException); 133*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFeatureInvalidation > SAL_CALL getFeatureInvalidation() throw (::com::sun::star::uno::RuntimeException); 134*cdf0e10cSrcweir virtual void SAL_CALL setFeatureInvalidation(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFeatureInvalidation > & the_value) throw (::com::sun::star::uno::RuntimeException); 135*cdf0e10cSrcweir virtual ::com::sun::star::form::runtime::FeatureState SAL_CALL getState(::sal_Int16 Feature) throw (::com::sun::star::uno::RuntimeException); 136*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isEnabled(::sal_Int16 Feature) throw (::com::sun::star::uno::RuntimeException); 137*cdf0e10cSrcweir virtual void SAL_CALL execute(::sal_Int16 Feature) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::WrappedTargetException); 138*cdf0e10cSrcweir virtual void SAL_CALL executeWithArguments(::sal_Int16 Feature, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::WrappedTargetException); 139*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL commitCurrentRecord(::sal_Bool & RecordInserted) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::sdbc::SQLException); 140*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL commitCurrentControl() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::sdbc::SQLException); 141*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isInsertionRow() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::WrappedTargetException); 142*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isModifiedRow() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::WrappedTargetException); 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir // XRowSetListener 145*cdf0e10cSrcweir virtual void SAL_CALL cursorMoved( const ::com::sun::star::lang::EventObject& event ) throw (::com::sun::star::uno::RuntimeException); 146*cdf0e10cSrcweir virtual void SAL_CALL rowChanged( const ::com::sun::star::lang::EventObject& event ) throw (::com::sun::star::uno::RuntimeException); 147*cdf0e10cSrcweir virtual void SAL_CALL rowSetChanged( const ::com::sun::star::lang::EventObject& event ) throw (::com::sun::star::uno::RuntimeException); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir // XModifyListener 150*cdf0e10cSrcweir virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& _rSource ) throw( ::com::sun::star::uno::RuntimeException ); 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir // XPropertyChangeListener 153*cdf0e10cSrcweir virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException); 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir // XEventListener 156*cdf0e10cSrcweir virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir // XComponent/OComponentHelper 159*cdf0e10cSrcweir virtual void SAL_CALL disposing(); 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir private: 162*cdf0e10cSrcweir // service constructors 163*cdf0e10cSrcweir void createWithFormController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >& _rxController ); 164*cdf0e10cSrcweir void createWithForm( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm ); 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir /** determines whether or not we're already disposed 167*cdf0e10cSrcweir */ 168*cdf0e10cSrcweir inline bool impl_isDisposed_nothrow() const { return !m_xCursor.is(); } 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir /** checks whether the instance is already disposed, and throws an exception if so 171*cdf0e10cSrcweir */ 172*cdf0e10cSrcweir void impl_checkDisposed_throw() const; 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir /** initializes the instance after m_xController has been set 175*cdf0e10cSrcweir @precond 176*cdf0e10cSrcweir m_xController is not <NULL/> 177*cdf0e10cSrcweir */ 178*cdf0e10cSrcweir void impl_initFromController_throw(); 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir /** initializes the instance after m_xCursor has been set 181*cdf0e10cSrcweir @precond 182*cdf0e10cSrcweir m_xCursor is not <NULL/> 183*cdf0e10cSrcweir */ 184*cdf0e10cSrcweir void impl_initFromForm_throw(); 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir /// invalidate the full palette of features which we know 187*cdf0e10cSrcweir void impl_invalidateAllSupportedFeatures_nothrow( MethodGuard& _rClearForCallback ) const; 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir /** invalidate the features which depend on the "modified" state of the current control 190*cdf0e10cSrcweir of our controller 191*cdf0e10cSrcweir */ 192*cdf0e10cSrcweir void impl_invalidateModifyDependentFeatures_nothrow( MethodGuard& _rClearForCallback ) const; 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir /** ensures that our parse is initialized, or at least that we attempted to do so 195*cdf0e10cSrcweir @precond 196*cdf0e10cSrcweir we're not disposed 197*cdf0e10cSrcweir */ 198*cdf0e10cSrcweir void impl_ensureInitializedParser_nothrow(); 199*cdf0e10cSrcweir 200*cdf0e10cSrcweir /// disposes our parser, if we have one 201*cdf0e10cSrcweir void impl_disposeParser_nothrow(); 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir /** determines whether our cursor can be moved left 204*cdf0e10cSrcweir @precond hasCursor() 205*cdf0e10cSrcweir */ 206*cdf0e10cSrcweir bool impl_canMoveLeft_throw() const; 207*cdf0e10cSrcweir 208*cdf0e10cSrcweir /** determines whether our cursor can be moved right 209*cdf0e10cSrcweir @precond hasCursor() 210*cdf0e10cSrcweir */ 211*cdf0e10cSrcweir bool impl_canMoveRight_throw() const; 212*cdf0e10cSrcweir 213*cdf0e10cSrcweir /// determines whether we're positioned on the insertion row 214*cdf0e10cSrcweir bool impl_isInsertionRow_throw() const; 215*cdf0e10cSrcweir 216*cdf0e10cSrcweir /// retrieves the RowCount property of the form 217*cdf0e10cSrcweir sal_Int32 impl_getRowCount_throw() const; 218*cdf0e10cSrcweir 219*cdf0e10cSrcweir /// retrieves the RowCountFinal property of the form 220*cdf0e10cSrcweir bool impl_isRowCountFinal_throw() const; 221*cdf0e10cSrcweir 222*cdf0e10cSrcweir /// retrieves the IsModified property of the form 223*cdf0e10cSrcweir bool impl_isModifiedRow_throw() const; 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir /// determines whether we can parse the query of our form 226*cdf0e10cSrcweir bool impl_isParseable_throw() const; 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir /// determines if we have an active filter or order condition 229*cdf0e10cSrcweir bool impl_hasFilterOrOrder_throw() const; 230*cdf0e10cSrcweir 231*cdf0e10cSrcweir /// determines whether our form is in "insert-only" mode 232*cdf0e10cSrcweir bool impl_isInsertOnlyForm_throw() const; 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir /** retrieces the column to which the current control of our controller is bound 235*cdf0e10cSrcweir @precond 236*cdf0e10cSrcweir m_xController.is() 237*cdf0e10cSrcweir */ 238*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 239*cdf0e10cSrcweir impl_getCurrentBoundField_nothrow( ) const; 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir /** returns the control model of the current control 242*cdf0e10cSrcweir 243*cdf0e10cSrcweir If the current control is a grid control, then the returned model is the 244*cdf0e10cSrcweir model of the current <em>column</em> in the grid. 245*cdf0e10cSrcweir 246*cdf0e10cSrcweir @precond 247*cdf0e10cSrcweir m_xController.is() 248*cdf0e10cSrcweir */ 249*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > 250*cdf0e10cSrcweir impl_getCurrentControlModel_throw() const; 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir /// determines if we have a valid cursor 253*cdf0e10cSrcweir inline bool impl_hasCursor_nothrow() const { return m_xCursorProperties.is(); } 254*cdf0e10cSrcweir 255*cdf0e10cSrcweir /** determines the model position from a grid control column's view position 256*cdf0e10cSrcweir 257*cdf0e10cSrcweir A grid control can have columns which are currently hidden, so the index of a 258*cdf0e10cSrcweir column in the view is not necessarily the same as its index in the model. 259*cdf0e10cSrcweir */ 260*cdf0e10cSrcweir sal_Int16 impl_gridView2ModelPos_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxColumns, sal_Int16 _nViewPos ) const; 261*cdf0e10cSrcweir 262*cdf0e10cSrcweir /** moves our cursor one position to the left, caring for different possible 263*cdf0e10cSrcweir cursor states. 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir Before the movement is done, the current row is saved, if necessary. 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir @precond 268*cdf0e10cSrcweir canMoveLeft() 269*cdf0e10cSrcweir */ 270*cdf0e10cSrcweir bool impl_moveLeft_throw() const; 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir /** moves our cursor one position to the right, caring for different possible 273*cdf0e10cSrcweir cursor states. 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir Before the movement is done, the current row is saved, if necessary. 276*cdf0e10cSrcweir 277*cdf0e10cSrcweir @precond 278*cdf0e10cSrcweir canMoveRight() 279*cdf0e10cSrcweir */ 280*cdf0e10cSrcweir bool impl_moveRight_throw( ) const; 281*cdf0e10cSrcweir 282*cdf0e10cSrcweir /** impl-version of commitCurrentRecord, which can be called without caring for 283*cdf0e10cSrcweir an output parameter, and within const-contexts 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir @precond 286*cdf0e10cSrcweir our mutex is locked 287*cdf0e10cSrcweir */ 288*cdf0e10cSrcweir bool impl_commitCurrentRecord_throw( sal_Bool* _pRecordInserted = NULL ) const; 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir /** impl-version of commitCurrentControl, which can be called in const-contexts 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir @precond 293*cdf0e10cSrcweir our mutex is locked 294*cdf0e10cSrcweir */ 295*cdf0e10cSrcweir bool impl_commitCurrentControl_throw() const; 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir /// resets all control models in our own form 298*cdf0e10cSrcweir void impl_resetAllControls_nothrow() const; 299*cdf0e10cSrcweir 300*cdf0e10cSrcweir /// executes the "auto sort ascending" and "auto sort descending" features 301*cdf0e10cSrcweir void impl_executeAutoSort_throw( bool _bUp ) const; 302*cdf0e10cSrcweir 303*cdf0e10cSrcweir /// executes the "auto filter" feature 304*cdf0e10cSrcweir void impl_executeAutoFilter_throw( ) const; 305*cdf0e10cSrcweir 306*cdf0e10cSrcweir /// executes the interactive sort resp. filter feature 307*cdf0e10cSrcweir void impl_executeFilterOrSort_throw( bool _bFilter ) const; 308*cdf0e10cSrcweir 309*cdf0e10cSrcweir private: 310*cdf0e10cSrcweir /// typedef for member method of this class 311*cdf0e10cSrcweir typedef void (FormOperations::*Action)( const void* ) const; 312*cdf0e10cSrcweir 313*cdf0e10cSrcweir /** calls a member function, catches SQLExceptions, extends them with additional context information, 314*cdf0e10cSrcweir and rethrows them 315*cdf0e10cSrcweir 316*cdf0e10cSrcweir @param _pAction 317*cdf0e10cSrcweir the member function to call 318*cdf0e10cSrcweir @param _pParam 319*cdf0e10cSrcweir the parameters to pass to the member function 320*cdf0e10cSrcweir @param _nErrorResourceId 321*cdf0e10cSrcweir the id of the resources string to use as error message 322*cdf0e10cSrcweir */ 323*cdf0e10cSrcweir void impl_doActionInSQLContext_throw( Action _pAction, const void* _pParam, sal_uInt16 _nErrorResourceId ) const; 324*cdf0e10cSrcweir 325*cdf0e10cSrcweir // parameter structure for appendOrderByColumn 326*cdf0e10cSrcweir struct param_appendOrderByColumn 327*cdf0e10cSrcweir { 328*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 329*cdf0e10cSrcweir xField; 330*cdf0e10cSrcweir bool bUp; 331*cdf0e10cSrcweir }; 332*cdf0e10cSrcweir void impl_appendOrderByColumn_throw( const void* _pActionParam ) const; 333*cdf0e10cSrcweir 334*cdf0e10cSrcweir // parameter structure for appendFilterByColumn 335*cdf0e10cSrcweir struct param_appendFilterByColumn 336*cdf0e10cSrcweir { 337*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 338*cdf0e10cSrcweir xField; 339*cdf0e10cSrcweir }; 340*cdf0e10cSrcweir void impl_appendFilterByColumn_throw( const void* _pActionParam ) const; 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir private: 343*cdf0e10cSrcweir FormOperations(); // never implemented 344*cdf0e10cSrcweir FormOperations( const FormOperations& ); // never implemented 345*cdf0e10cSrcweir FormOperations& operator=( const FormOperations& ); // never implemented 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir public: 348*cdf0e10cSrcweir class MethodGuard 349*cdf0e10cSrcweir { 350*cdf0e10cSrcweir FormOperations& m_rOwner; 351*cdf0e10cSrcweir bool m_bCleared; 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir public: 354*cdf0e10cSrcweir inline MethodGuard( FormOperations& _rOwner ) 355*cdf0e10cSrcweir :m_rOwner( _rOwner ) 356*cdf0e10cSrcweir ,m_bCleared( false ) 357*cdf0e10cSrcweir { 358*cdf0e10cSrcweir m_rOwner.enterMethod( FormOperations::MethodAccess() ); 359*cdf0e10cSrcweir } 360*cdf0e10cSrcweir 361*cdf0e10cSrcweir inline ~MethodGuard() 362*cdf0e10cSrcweir { 363*cdf0e10cSrcweir clear(); 364*cdf0e10cSrcweir } 365*cdf0e10cSrcweir 366*cdf0e10cSrcweir inline void clear() 367*cdf0e10cSrcweir { 368*cdf0e10cSrcweir if ( !m_bCleared ) 369*cdf0e10cSrcweir m_rOwner.leaveMethod( FormOperations::MethodAccess() ); 370*cdf0e10cSrcweir m_bCleared = true; 371*cdf0e10cSrcweir } 372*cdf0e10cSrcweir }; 373*cdf0e10cSrcweir }; 374*cdf0e10cSrcweir 375*cdf0e10cSrcweir //........................................................................ 376*cdf0e10cSrcweir } // namespace frm 377*cdf0e10cSrcweir //........................................................................ 378*cdf0e10cSrcweir 379*cdf0e10cSrcweir #endif // FORMS_FORMOPERATIONS_HXX 380