LibreOffice Module connectivity (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
dbtools::OAutoConnectionDisposer Class Referencefinal

#include <conncleanup.hxx>

Inheritance diagram for dbtools::OAutoConnectionDisposer:
[legend]
Collaboration diagram for dbtools::OAutoConnectionDisposer:
[legend]

Public Member Functions

 OAutoConnectionDisposer (const css::uno::Reference< css::sdbc::XRowSet > &_rxRowSet, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
 constructs an object More...
 

Private Member Functions

virtual void SAL_CALL propertyChange (const css::beans::PropertyChangeEvent &_rEvent) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &_rSource) override
 
virtual void SAL_CALL cursorMoved (const css::lang::EventObject &event) override
 
virtual void SAL_CALL rowChanged (const css::lang::EventObject &event) override
 
virtual void SAL_CALL rowSetChanged (const css::lang::EventObject &event) override
 
void clearConnection ()
 
void startRowSetListening ()
 
void stopRowSetListening ()
 
bool isRowSetListening () const
 
void startPropertyListening (const css::uno::Reference< css::beans::XPropertySet > &_rxProps)
 
void stopPropertyListening (const css::uno::Reference< css::beans::XPropertySet > &_rxEventSource)
 

Private Attributes

css::uno::Reference< css::sdbc::XConnection > m_xOriginalConnection
 
css::uno::Reference< css::sdbc::XRowSet > m_xRowSet
 
bool m_bRSListening: 1
 
bool m_bPropertyListening: 1
 

Detailed Description

Definition at line 43 of file conncleanup.hxx.

Constructor & Destructor Documentation

◆ OAutoConnectionDisposer()

dbtools::OAutoConnectionDisposer::OAutoConnectionDisposer ( const css::uno::Reference< css::sdbc::XRowSet > &  _rxRowSet,
const css::uno::Reference< css::sdbc::XConnection > &  _rxConnection 
)

constructs an object

The connection given will be set on the rowset (as ActiveConnection), and the object adds itself as property change listener for the connection. Once somebody sets a new ActiveConnection, the old one (the one given here) will be disposed.

Definition at line 40 of file conncleanup.cxx.

References dbtools::ACTIVE_CONNECTION_PROPERTY_NAME, Any, Exception, m_xOriginalConnection, startPropertyListening(), and TOOLS_WARN_EXCEPTION.

Member Function Documentation

◆ clearConnection()

void dbtools::OAutoConnectionDisposer::clearConnection ( )
private

Definition at line 195 of file conncleanup.cxx.

References Exception, m_xOriginalConnection, and TOOLS_WARN_EXCEPTION.

Referenced by disposing(), and rowSetChanged().

◆ cursorMoved()

void SAL_CALL dbtools::OAutoConnectionDisposer::cursorMoved ( const css::lang::EventObject &  event)
overrideprivatevirtual

Definition at line 211 of file conncleanup.cxx.

◆ disposing()

void SAL_CALL dbtools::OAutoConnectionDisposer::disposing ( const css::lang::EventObject &  _rSource)
overrideprivatevirtual

◆ isRowSetListening()

bool dbtools::OAutoConnectionDisposer::isRowSetListening ( ) const
inlineprivate

Definition at line 78 of file conncleanup.hxx.

Referenced by disposing(), and propertyChange().

◆ propertyChange()

void SAL_CALL dbtools::OAutoConnectionDisposer::propertyChange ( const css::beans::PropertyChangeEvent &  _rEvent)
overrideprivatevirtual

◆ rowChanged()

void SAL_CALL dbtools::OAutoConnectionDisposer::rowChanged ( const css::lang::EventObject &  event)
overrideprivatevirtual

Definition at line 215 of file conncleanup.cxx.

◆ rowSetChanged()

void SAL_CALL dbtools::OAutoConnectionDisposer::rowSetChanged ( const css::lang::EventObject &  event)
overrideprivatevirtual

Definition at line 219 of file conncleanup.cxx.

References clearConnection(), and stopRowSetListening().

◆ startPropertyListening()

void dbtools::OAutoConnectionDisposer::startPropertyListening ( const css::uno::Reference< css::beans::XPropertySet > &  _rxProps)
private

◆ startRowSetListening()

void dbtools::OAutoConnectionDisposer::startRowSetListening ( )
private

Definition at line 99 of file conncleanup.cxx.

References Exception, m_bRSListening, m_xRowSet, and TOOLS_WARN_EXCEPTION.

Referenced by propertyChange().

◆ stopPropertyListening()

void dbtools::OAutoConnectionDisposer::stopPropertyListening ( const css::uno::Reference< css::beans::XPropertySet > &  _rxEventSource)
private

◆ stopRowSetListening()

void dbtools::OAutoConnectionDisposer::stopRowSetListening ( )
private

Definition at line 115 of file conncleanup.cxx.

References Exception, m_bRSListening, m_xRowSet, and TOOLS_WARN_EXCEPTION.

Referenced by disposing(), propertyChange(), and rowSetChanged().

Member Data Documentation

◆ m_bPropertyListening

bool dbtools::OAutoConnectionDisposer::m_bPropertyListening
private

Definition at line 49 of file conncleanup.hxx.

Referenced by disposing(), startPropertyListening(), and stopPropertyListening().

◆ m_bRSListening

bool dbtools::OAutoConnectionDisposer::m_bRSListening
private

Definition at line 48 of file conncleanup.hxx.

Referenced by startRowSetListening(), and stopRowSetListening().

◆ m_xOriginalConnection

css::uno::Reference< css::sdbc::XConnection > dbtools::OAutoConnectionDisposer::m_xOriginalConnection
private

Definition at line 46 of file conncleanup.hxx.

Referenced by clearConnection(), OAutoConnectionDisposer(), and propertyChange().

◆ m_xRowSet

css::uno::Reference< css::sdbc::XRowSet > dbtools::OAutoConnectionDisposer::m_xRowSet
private

Definition at line 47 of file conncleanup.hxx.

Referenced by startRowSetListening(), and stopRowSetListening().


The documentation for this class was generated from the following files: