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 (css::uno::Reference< css::uno::XComponentContext > xContext, css::ucb::OpenCommandArgument2 aCommand)
 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

std::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

comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_aDisposeEventListeners
 
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

◆ ResultSetImplHelper()

ucbhelper::ResultSetImplHelper::ResultSetImplHelper ( css::uno::Reference< css::uno::XComponentContext >  xContext,
css::ucb::OpenCommandArgument2  aCommand 
)

Constructor.

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

Definition at line 47 of file resultsethelper.cxx.

References aCommand, and m_xContext.

◆ ~ResultSetImplHelper()

ucbhelper::ResultSetImplHelper::~ResultSetImplHelper ( )
overridevirtual

Destructor.

Definition at line 59 of file resultsethelper.cxx.

Member Function Documentation

◆ addEventListener()

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

◆ connectToCache()

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

Definition at line 185 of file resultsethelper.cxx.

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

◆ dispose()

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

◆ getCapabilities()

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

The implementation of this method always returns 0.

Override this method, if necessary.

Definition at line 177 of file resultsethelper.cxx.

◆ getImplementationName()

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

Definition at line 66 of file resultsethelper.cxx.

◆ getStaticResultSet()

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

Definition at line 123 of file resultsethelper.cxx.

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

◆ getSupportedServiceNames()

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

Definition at line 76 of file resultsethelper.cxx.

References ucbhelper::DYNAMICRESULTSET_SERVICE_NAME.

◆ init()

void ucbhelper::ResultSetImplHelper::init ( bool  bStatic)
private

◆ initDynamic()

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.

References dispose(), getImplementationName(), getSupportedServiceNames(), and supportsService().

Referenced by init().

◆ initStatic()

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().

◆ removeEventListener()

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

◆ setListener()

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

Definition at line 136 of file resultsethelper.cxx.

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

◆ supportsService()

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

Definition at line 71 of file resultsethelper.cxx.

References ServiceName, and cppu::supportsService().

Member Data Documentation

◆ m_aCommand

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

Definition at line 64 of file resultsethelper.hxx.

Referenced by connectToCache().

◆ m_aDisposeEventListeners

comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> ucbhelper::ResultSetImplHelper::m_aDisposeEventListeners
private

Definition at line 58 of file resultsethelper.hxx.

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

◆ m_aMutex

std::mutex ucbhelper::ResultSetImplHelper::m_aMutex
protected

◆ m_bInitDone

bool ucbhelper::ResultSetImplHelper::m_bInitDone
private

Definition at line 60 of file resultsethelper.hxx.

Referenced by init().

◆ m_bStatic

bool ucbhelper::ResultSetImplHelper::m_bStatic
private

Definition at line 59 of file resultsethelper.hxx.

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

◆ m_xContext

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

Definition at line 65 of file resultsethelper.hxx.

Referenced by connectToCache().

◆ m_xListener

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().

◆ m_xResultSet1

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().

◆ m_xResultSet2

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: