LibreOffice Module ucbhelper (master)  1
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ucbhelper::ResultSetImplHelper Class Referenceabstract

This is an abstract base class for implementations of the service com.sun.star.ucb.DynamicResultSet, which is the result of the command "open" executed at a UCB folder content. More...

#include <resultsethelper.hxx>

Inheritance diagram for ucbhelper::ResultSetImplHelper:
[legend]
Collaboration diagram for ucbhelper::ResultSetImplHelper:
[legend]

Public Member Functions

 ResultSetImplHelper (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::ucb::OpenCommandArgument2 &rCommand)
 Constructor. More...
 
virtual ~ResultSetImplHelper () override
 Destructor. More...
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (const css::uno::Reference< css::lang::XEventListener > &Listener) override
 
virtual void SAL_CALL removeEventListener (const css::uno::Reference< css::lang::XEventListener > &Listener) override
 
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getStaticResultSet () override
 
virtual void SAL_CALL setListener (const css::uno::Reference< css::ucb::XDynamicResultSetListener > &Listener) override
 
virtual void SAL_CALL connectToCache (const css::uno::Reference< css::ucb::XDynamicResultSet > &xCache) override
 
virtual sal_Int16 SAL_CALL getCapabilities () override
 The implementation of this method always returns 0. More...
 

Protected Attributes

osl::Mutex m_aMutex
 
css::ucb::OpenCommandArgument2 m_aCommand
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet1
 
css::uno::Reference< css::sdbc::XResultSet > m_xResultSet2
 
css::uno::Reference< css::ucb::XDynamicResultSetListener > m_xListener
 

Private Member Functions

UCBHELPER_DLLPRIVATE void init (bool bStatic)
 
virtual UCBHELPER_DLLPRIVATE void initStatic ()=0
 Your implementation of this method has to fill the protected member m_xResultSet1. More...
 
virtual UCBHELPER_DLLPRIVATE void initDynamic ()=0
 Your implementation of this method has to fill the protected members m_xResultSet1 and m_xResultSet2 of this base class. More...
 

Private Attributes

std::unique_ptr< cppu::OInterfaceContainerHelperm_pDisposeEventListeners
 
bool m_bStatic
 
bool m_bInitDone
 

Detailed Description

This is an abstract base class for implementations of the service com.sun.star.ucb.DynamicResultSet, which is the result of the command "open" executed at a UCB folder content.

Features of the base class implementation:

Definition at line 53 of file resultsethelper.hxx.

Constructor & Destructor Documentation

ucbhelper::ResultSetImplHelper::ResultSetImplHelper ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::ucb::OpenCommandArgument2 &  rCommand 
)

Constructor.

Parameters
rxContextis a Service Manager.
rCommandis the parameter for the open command that produces this resultset.

Definition at line 51 of file resultsethelper.cxx.

References m_xContext.

ucbhelper::ResultSetImplHelper::~ResultSetImplHelper ( )
overridevirtual

Destructor.

Definition at line 63 of file resultsethelper.cxx.

Member Function Documentation

void SAL_CALL ucbhelper::ResultSetImplHelper::addEventListener ( const css::uno::Reference< css::lang::XEventListener > &  Listener)
overridevirtual

Definition at line 103 of file resultsethelper.cxx.

References m_aMutex, and m_pDisposeEventListeners.

void SAL_CALL ucbhelper::ResultSetImplHelper::connectToCache ( const css::uno::Reference< css::ucb::XDynamicResultSet > &  xCache)
overridevirtual

Definition at line 193 of file resultsethelper.cxx.

References m_aCommand, m_bStatic, m_xContext, m_xListener, and xTarget.

void SAL_CALL ucbhelper::ResultSetImplHelper::dispose ( void  )
overridevirtual

Definition at line 89 of file resultsethelper.cxx.

References m_aMutex, and m_pDisposeEventListeners.

sal_Int16 SAL_CALL ucbhelper::ResultSetImplHelper::getCapabilities ( )
overridevirtual

The implementation of this method always returns 0.

Override this method, if necessary.

Definition at line 185 of file resultsethelper.cxx.

OUString SAL_CALL ucbhelper::ResultSetImplHelper::getImplementationName ( )
overridevirtual

Definition at line 70 of file resultsethelper.cxx.

uno::Reference< sdbc::XResultSet > SAL_CALL ucbhelper::ResultSetImplHelper::getStaticResultSet ( )
overridevirtual

Definition at line 131 of file resultsethelper.cxx.

References init(), m_aMutex, m_xListener, and m_xResultSet1.

css::uno::Sequence< OUString > SAL_CALL ucbhelper::ResultSetImplHelper::getSupportedServiceNames ( )
overridevirtual

Definition at line 80 of file resultsethelper.cxx.

References DYNAMICRESULTSET_SERVICE_NAME.

void ucbhelper::ResultSetImplHelper::init ( bool  bStatic)
private
virtual UCBHELPER_DLLPRIVATE void ucbhelper::ResultSetImplHelper::initDynamic ( )
privatepure virtual

Your implementation of this method has to fill the protected members m_xResultSet1 and m_xResultSet2 of this base class.

Each of these resultsets must implement a complete static resultset ( service com.sun.star.ucb.ContentResultSet ). This method will be called at most once in the life of your implementation object. After this method was called, the type of this resultset will be "dynamic". There is no way to change the type afterwards. If this method gets called the client wants to use your resultset exclusively dynamically. This means, it is interested in getting notifications on changes of data of the resultset contents. ( These changes are to propagate by your implementation throw the member m_xListener of this base class ). If your implementation cannot detect changes of relevant data, you may fill m_xResultSet1 and m_xResultSet2 with the same static resultset implementation object. This normally will be the same instance you put into m_xResultSet1 when initStatic() is called.

Referenced by init().

virtual UCBHELPER_DLLPRIVATE void ucbhelper::ResultSetImplHelper::initStatic ( )
privatepure virtual

Your implementation of this method has to fill the protected member m_xResultSet1.

This resultset must implement a complete static resultset ( service com.sun.star.ucb.ContentResultSet ). This method will be called at most once in the life of your implementation object. After this method was called, the type of this resultset will be "static". There is no way to change the type afterwards. If this method gets called the client wants to use your resultset exclusively statically. You may deploy this factum to optimize your implementation (i.e. "switch off" all changes detection code in your implementation). Note that you may use the class ucb::ResultSet to implement the static resultset, that is required here.

Referenced by init().

void SAL_CALL ucbhelper::ResultSetImplHelper::removeEventListener ( const css::uno::Reference< css::lang::XEventListener > &  Listener)
overridevirtual

Definition at line 116 of file resultsethelper.cxx.

References m_aMutex, and m_pDisposeEventListeners.

void SAL_CALL ucbhelper::ResultSetImplHelper::setListener ( const css::uno::Reference< css::ucb::XDynamicResultSetListener > &  Listener)
overridevirtual

Definition at line 144 of file resultsethelper.cxx.

References init(), m_aMutex, m_bStatic, m_xListener, m_xResultSet1, and m_xResultSet2.

sal_Bool SAL_CALL ucbhelper::ResultSetImplHelper::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 75 of file resultsethelper.cxx.

References cppu::supportsService().

Member Data Documentation

css::ucb::OpenCommandArgument2 ucbhelper::ResultSetImplHelper::m_aCommand
protected

Definition at line 64 of file resultsethelper.hxx.

Referenced by connectToCache().

osl::Mutex ucbhelper::ResultSetImplHelper::m_aMutex
protected
bool ucbhelper::ResultSetImplHelper::m_bInitDone
private

Definition at line 60 of file resultsethelper.hxx.

Referenced by init().

bool ucbhelper::ResultSetImplHelper::m_bStatic
private

Definition at line 59 of file resultsethelper.hxx.

Referenced by connectToCache(), init(), and setListener().

std::unique_ptr<cppu::OInterfaceContainerHelper> ucbhelper::ResultSetImplHelper::m_pDisposeEventListeners
private

Definition at line 58 of file resultsethelper.hxx.

Referenced by addEventListener(), dispose(), and removeEventListener().

css::uno::Reference< css::uno::XComponentContext > ucbhelper::ResultSetImplHelper::m_xContext
protected

Definition at line 65 of file resultsethelper.hxx.

Referenced by connectToCache().

css::uno::Reference< css::ucb::XDynamicResultSetListener > ucbhelper::ResultSetImplHelper::m_xListener
protected

Definition at line 71 of file resultsethelper.hxx.

Referenced by connectToCache(), getStaticResultSet(), and setListener().

css::uno::Reference< css::sdbc::XResultSet > ucbhelper::ResultSetImplHelper::m_xResultSet1
protected

Definition at line 67 of file resultsethelper.hxx.

Referenced by getStaticResultSet(), init(), and setListener().

css::uno::Reference< css::sdbc::XResultSet > ucbhelper::ResultSetImplHelper::m_xResultSet2
protected

Definition at line 69 of file resultsethelper.hxx.

Referenced by init(), and setListener().


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