20#ifndef INCLUDED_UNOTOOLS_SHAREDUNOCOMPONENT_HXX
21#define INCLUDED_UNOTOOLS_SHAREDUNOCOMPONENT_HXX
24#include <com/sun/star/uno/Reference.hxx>
135 template <
class INTERFACE,
class COMPONENT = DisposableComponent >
162 SharedUNOComponent(
const css::uno::BaseReference & _rRef, css::uno::UnoReference_QueryThrow _queryThrow )
164 set( _rRef, _queryThrow );
179 inline bool set(
const css::uno::BaseReference& _rRef, css::uno::UnoReference_Query _query );
181 inline void set(
const css::uno::BaseReference & _rRef, css::uno::UnoReference_QueryThrow _queryThrow );
183 inline void set(
const css::uno::Reference< INTERFACE >& _rRef, css::uno::UnoReference_SetThrow _setThrow );
188 operator const css::uno::Reference< INTERFACE >&()
const
193 const css::uno::Reference< INTERFACE >&
getTyped()
const
210 template <
class INTERFACE,
class COMPONENT >
213 return m_xTypedComponent.operator->();
217 template <
class INTERFACE,
class COMPONENT >
220 m_xComponent.reset(_eMode == TakeOwnership ?
new COMPONENT( _rxComponent ) :
nullptr);
221 m_xTypedComponent = _rxComponent;
226 template <
class INTERFACE,
class COMPONENT >
232 template <
class INTERFACE,
class COMPONENT >
235 return css::uno::Any(
value.getTyped() );
238 template <
class INTERFACE,
class COMPONENT >
241 reset( css::uno::Reference< INTERFACE >( _rRef, _queryThrow ), TakeOwnership );
244 template <
class INTERFACE,
class COMPONENT >
247 reset( css::uno::Reference< INTERFACE >( _rRef, _setThrow ), TakeOwnership );
250 template <
class INTERFACE,
class COMPONENT >
255 m_xTypedComponent.
set( m_xTypedComponent, _setThrow );
258 template <
class INTERFACE,
class COMPONENT >
261 reset( css::uno::Reference< INTERFACE >( _rRef, _query ) );
is a class which controls lifetime of a UNO component via ->XCloseable::close
CloseableComponent(const CloseableComponent &)=delete
CloseableComponent(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
constructs a ->CloseableComponent instance
::rtl::Reference< CloseableComponentImpl > m_pImpl
Our IMPL class.
CloseableComponent & operator=(const CloseableComponent &)=delete
is a class which controls lifetime of a UNO component via ->XComponent::dispose
DisposableComponent & operator=(const DisposableComponent &)=delete
DisposableComponent(const DisposableComponent &)=delete
DisposableComponent(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
constructs a ->DisposableComponent instance
css::uno::Reference< css::lang::XComponent > m_xComponent
is a helper class for sharing ownership of a UNO component
const css::uno::Reference< INTERFACE > & getTyped() const
css::uno::Reference< INTERFACE > m_xTypedComponent
void reset(const css::uno::Reference< INTERFACE > &_rxComponent, AssignmentMode _eMode=TakeOwnership)
assigns a new component, and releases the old one
INTERFACE *SAL_CALL operator->() const
void set(const css::uno::Reference< INTERFACE > &_rRef, css::uno::UnoReference_SetThrow _setThrow)
SharedUNOComponent(const css::uno::Reference< INTERFACE > &_rxComponent, AssignmentMode eMode=TakeOwnership)
void set(const SharedUNOComponent &_rComp, css::uno::UnoReference_SetThrow _setThrow)
SharedUNOComponent(const css::uno::BaseReference &_rRef, css::uno::UnoReference_QueryThrow _queryThrow)
void set(const css::uno::BaseReference &_rRef, css::uno::UnoReference_QueryThrow _queryThrow)
std::shared_ptr< Component > m_xComponent
bool set(const css::uno::BaseReference &_rRef, css::uno::UnoReference_Query _query)
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)
bool operator==(const SharedUNOComponent< INTERFACE, COMPONENT > &_rLHS, const css::uno::Reference< INTERFACE > &_rRHS)