Tag: cws_src680_dba202f User: fs Date: 06/01/26 22:53:54 Modified: /dba/dbaccess/source/core/api/ RowSetBase.hxx
Log: RESYNC: (1.32-1.34); FILE MERGED File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: RowSetBase.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetBase.hxx?r1=1.32.70.1&r2=1.32.70.2 Delta lines: +54 -27 --------------------- --- RowSetBase.hxx 20 Jan 2006 14:51:45 -0000 1.32.70.1 +++ RowSetBase.hxx 27 Jan 2006 06:53:51 -0000 1.32.70.2 @@ -149,13 +149,11 @@ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes> m_xNumberFormatTypes; OEmptyCollection* m_pEmptyCollection; - sal_Int32 m_nRowCount; // contains the current count of rows which have been fetched sal_Int32 m_nLastColumnIndex; // the last column ask for, used for wasNull() - sal_Int32 m_nPosition; // is set only when a row was deleted + sal_Int32 m_nDeletedPosition; // is set only when a row was deleted sal_Int32 m_nResultSetType; // fetch property sal_Int32 m_nResultSetConcurrency; sal_Bool m_bClone; // I'm clone or not - sal_Bool m_bRowCountFinal; sal_Bool m_bIgnoreResult ; sal_Bool m_bBeforeFirst : 1; sal_Bool m_bAfterLast : 1; @@ -166,10 +164,6 @@ // fire a notification for all that are listening on column::VALUE property void firePropertyChange(const ORowSetRow& _rOldRow); virtual void fireRowcount() { } // fire if rowcount changed - virtual sal_Bool notifyAllListenersRowBeforeChange(::osl::ResettableMutexGuard& _rGuard,const ::com::sun::star::sdb::RowChangeEvent &rEvt) - {return sal_True; } // fire if rowcount changed - virtual void notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard,const ::com::sun::star::sdb::RowChangeEvent &rEvt) - {} // notify row changed virtual sal_Bool notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& _rGuard) {return sal_True; } // notify row changed virtual void notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard) { } // notify cursor moved @@ -190,12 +184,38 @@ // OPropertyStateContainer virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 _nHandle ) const; virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue,sal_Int32 nHandle) const; - // postions the cache which the currently bookmark m_aBookmark - void positionCache(); + + enum CursorMoveDirection + { + /// denotes a cursor move forward + MOVE_FORWARD, + /// denotes a cursor move backwards + MOVE_BACKWARD, + /// denotes no cursor move at all, used when the current row is to be refreshed only + MOVE_NONE_REFRESH_ONLY + }; + /** positions the cache in preparation of a cursor move + + Normally, the cache is simply moved to our bookmark (m_aBookmark). If however the current + row is deleted, then the cache is properly positioned for a following cursor movement in the + given direction. + + @param _ePrepareForDirection + the direction into which the cursor should be moved after the call. If we're currently not on + a deleted row, this parameter is ignored, since in this case the cache is simply moved to + m_aBookmark.</br> + If, however, we're currently on a deleted row, this is used to properly position the cache + using <member>m_nDeletedPosition</member>.<br/> + In this case, MOVE_NONE_REFRESH_ONLY is not supported. This is because the deleted row + (to which the RowSet currently points to) is not present in the cache. So, you cannot move the + cache to this row. + */ + void positionCache( CursorMoveDirection _ePrepareForDirection ); + // returns a value of a column of the current row const connectivity::ORowSetValue& getValue(sal_Int32 columnIndex); // sets the current and the bookmark - void setCurrentRow(sal_Bool _bMoved,const ORowSetRow& _rOldValues,::osl::ResettableMutexGuard& _rGuard); + void setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const ORowSetRow& _rOldValues, ::osl::ResettableMutexGuard& _rGuard); void checkPositioningAllowed() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // checks if the cache is null void checkCache(); @@ -227,6 +247,17 @@ */ sal_Bool isOnLast(); + /** returns the current row count + + This function takes into account that we might actually be positioned on a + deleted row, so that m_pCache->m_nRowCount does not really reflect the actual + count. + + @precond + Our mutext is locked. + */ + sal_Int32 impl_getRowCount() const; + public: virtual ~ORowSetBase(); @@ -315,18 +346,14 @@ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // ::com::sun::star::sdbc::XRowSet - virtual void SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) - { // when not implemented by derived classes then throw - throw ::com::sun::star::sdbc::SQLException(); - } - virtual void SAL_CALL addRowSetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >& listener ) throw(::com::sun::star::uno::RuntimeException) - { // when not implemented by derived classes then throw - throw ::com::sun::star::sdbc::SQLException(); - } - virtual void SAL_CALL removeRowSetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >& listener ) throw(::com::sun::star::uno::RuntimeException) - { // when not implemented by derived classes then throw - throw ::com::sun::star::sdbc::SQLException(); - } + virtual void SAL_CALL execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) = 0; + virtual void SAL_CALL addRowSetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >& listener ) throw(::com::sun::star::uno::RuntimeException) = 0; + virtual void SAL_CALL removeRowSetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >& listener ) throw(::com::sun::star::uno::RuntimeException) = 0; + + // is called when the rowset is going to delete this bookmark _rBookmark + void onDeleteRow( const ::com::sun::star::uno::Any& _rBookmark ); + // is called when the rowset has deleted this bookmark _rBookmark + void onDeletedRow( const ::com::sun::star::uno::Any& _rBookmark, sal_Int32 _nPos ); // ========================================================== // granular access control --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
