LibreOffice Module comphelper (master)  1
Namespaces | Macros | Functions
uno3.hxx File Reference
#include <com/sun/star/uno/XAggregation.hpp>
#include <comphelper/sequence.hxx>
Include dependency graph for uno3.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 comphelper
 

Macros

#define DECLARE_UNO3_DEFAULTS(classname, baseclass)
 used for declaring UNO3-Defaults, i.e. More...
 
#define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass)
 used for declaring UNO3-Defaults, i.e. More...
 
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)
 Use this macro to forward XComponent methods to base class. More...
 
#define DECLARE_XINTERFACE()
 
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
 
#define IMPLEMENT_FORWARD_XINTERFACE2(classname, refcountbase, baseclass2)
 
#define IMPLEMENT_FORWARD_XINTERFACE3(classname, refcountbase, baseclass2, baseclass3)
 
#define DECLARE_XTYPEPROVIDER()
 
#define IMPLEMENT_GET_IMPLEMENTATION_ID(classname)
 
#define IMPLEMENT_FORWARD_XTYPEPROVIDER2(classname, baseclass1, baseclass2)
 
#define IMPLEMENT_FORWARD_XTYPEPROVIDER3(classname, baseclass1, baseclass2, baseclass3)
 

Functions

template<class iface >
bool comphelper::query_aggregation (const css::uno::Reference< css::uno::XAggregation > &_rxAggregate, css::uno::Reference< iface > &_rxOut)
 ask for an iface of an aggregated object usage:
Reference<XFoo> xFoo;
if (query_aggregation(xAggregatedObject, xFoo))
... More...
 

Macro Definition Documentation

#define DECLARE_UNO3_AGG_DEFAULTS (   classname,
  baseclass 
)
Value:
virtual void SAL_CALL acquire() throw() override { baseclass::acquire(); } \
virtual void SAL_CALL release() throw() override { baseclass::release(); } \
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override \
{ return baseclass::queryInterface(_rType); }
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)

used for declaring UNO3-Defaults, i.e.

acquire/release if you want to forward all queryInterfaces to the base class, (e.g. if you override queryAggregation)

Definition at line 38 of file uno3.hxx.

#define DECLARE_UNO3_DEFAULTS (   classname,
  baseclass 
)
Value:
virtual void SAL_CALL acquire() throw() override { baseclass::acquire(); } \
virtual void SAL_CALL release() throw() override { baseclass::release(); }

used for declaring UNO3-Defaults, i.e.

acquire/release

Definition at line 31 of file uno3.hxx.

#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS (   classname,
  baseclass,
  implhelper 
)
Value:
virtual void SAL_CALL acquire() throw() override { baseclass::acquire(); } \
virtual void SAL_CALL release() throw() override { baseclass::release(); } \
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override \
{ return baseclass::queryInterface(_rType); } \
virtual void SAL_CALL dispose() override \
{ \
implhelper::dispose(); \
} \
virtual void SAL_CALL addEventListener( \
css::uno::Reference< css::lang::XEventListener > const & xListener ) override \
{ \
implhelper::addEventListener(xListener); \
} \
virtual void SAL_CALL removeEventListener( \
css::uno::Reference< css::lang::XEventListener > const & xListener ) override \
{ \
implhelper::removeEventListener(xListener); \
}
void dispose()
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)

Use this macro to forward XComponent methods to base class.

When using the ::cppu::WeakComponentImplHelper base classes to implement a UNO interface, a problem occurs when the interface itself already derives from XComponent (like e.g. awt::XWindow or awt::XControl): ::cppu::WeakComponentImplHelper is then still abstract. Using this macro in the most derived class definition provides overrides for the XComponent methods, forwarding them to the given baseclass.

Parameters
classnameName of the class this macro is issued within
baseclassName of the baseclass that should have the XInterface methods forwarded to - that's usually the WeakComponentImplHelperN base
implhelperName of the baseclass that should have the XComponent methods forwarded to - in the case of the WeakComponentImplHelper, that would be ::cppu::WeakComponentImplHelperBase

Definition at line 66 of file uno3.hxx.

#define DECLARE_XINTERFACE ( )
Value:
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; \
virtual void SAL_CALL acquire() throw() override; \
virtual void SAL_CALL release() throw() override;
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)

Definition at line 90 of file uno3.hxx.

#define DECLARE_XTYPEPROVIDER ( )
Value:
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; \
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;

Definition at line 126 of file uno3.hxx.

#define IMPLEMENT_FORWARD_REFCOUNT (   classname,
  refcountbase 
)
Value:
void SAL_CALL classname::acquire() throw() { refcountbase::acquire(); } \
void SAL_CALL classname::release() throw() { refcountbase::release(); }

Definition at line 95 of file uno3.hxx.

#define IMPLEMENT_FORWARD_XINTERFACE2 (   classname,
  refcountbase,
  baseclass2 
)
Value:
IMPLEMENT_FORWARD_REFCOUNT( classname, refcountbase ) \
css::uno::Any SAL_CALL classname::queryInterface( const css::uno::Type& _rType ) \
{ \
css::uno::Any aReturn = refcountbase::queryInterface( _rType ); \
if ( !aReturn.hasValue() ) \
aReturn = baseclass2::queryInterface( _rType ); \
return aReturn; \
}
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
Definition: uno3.hxx:95

Definition at line 99 of file uno3.hxx.

#define IMPLEMENT_FORWARD_XINTERFACE3 (   classname,
  refcountbase,
  baseclass2,
  baseclass3 
)
Value:
IMPLEMENT_FORWARD_REFCOUNT( classname, refcountbase ) \
css::uno::Any SAL_CALL classname::queryInterface( const css::uno::Type& _rType ) \
{ \
css::uno::Any aReturn = refcountbase::queryInterface( _rType ); \
if ( !aReturn.hasValue() ) \
{ \
aReturn = baseclass2::queryInterface( _rType ); \
if ( !aReturn.hasValue() ) \
aReturn = baseclass3::queryInterface( _rType ); \
} \
return aReturn; \
}
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
Definition: uno3.hxx:95

Definition at line 109 of file uno3.hxx.

#define IMPLEMENT_FORWARD_XTYPEPROVIDER2 (   classname,
  baseclass1,
  baseclass2 
)
Value:
css::uno::Sequence< css::uno::Type > SAL_CALL classname::getTypes( ) \
{ \
return ::comphelper::concatSequences( \
baseclass1::getTypes(), \
baseclass2::getTypes() \
); \
} \
#define IMPLEMENT_GET_IMPLEMENTATION_ID(classname)
Definition: uno3.hxx:130

Definition at line 136 of file uno3.hxx.

#define IMPLEMENT_FORWARD_XTYPEPROVIDER3 (   classname,
  baseclass1,
  baseclass2,
  baseclass3 
)
Value:
css::uno::Sequence< css::uno::Type > SAL_CALL classname::getTypes( ) \
{ \
return ::comphelper::concatSequences( \
baseclass1::getTypes(), \
baseclass2::getTypes(), \
baseclass3::getTypes() \
); \
} \
#define IMPLEMENT_GET_IMPLEMENTATION_ID(classname)
Definition: uno3.hxx:130

Definition at line 147 of file uno3.hxx.

#define IMPLEMENT_GET_IMPLEMENTATION_ID (   classname)
Value:
css::uno::Sequence< sal_Int8 > SAL_CALL classname::getImplementationId( ) \
{ \
return css::uno::Sequence<sal_Int8>(); \
}

Definition at line 130 of file uno3.hxx.