LibreOffice Module extensions (master) 1
|
All methods are allowed to throw at least a BridgeRuntimeError. More...
#include <unoconversionutilities.hxx>
Public Member Functions | |
UnoConversionUtilities (const Reference< XMultiServiceFactory > &smgr) | |
UnoConversionUtilities (const Reference< XMultiServiceFactory > &xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass) | |
virtual | ~UnoConversionUtilities () |
void | anyToVariant (VARIANT *pVariant, const Any &rAny) |
converts only into oleautomation types, that is there is no VT_I1, VT_UI2, VT_UI4 a sal_Unicode character is converted into a BSTR. More... | |
void | anyToVariant (VARIANT *pVariant, const Any &rAny, VARTYPE type) |
SAFEARRAY * | createUnoSequenceWrapper (const Any &rSeq) |
SAFEARRAY * | createUnoSequenceWrapper (const Any &rSeq, VARTYPE elemtype) |
void | createUnoObjectWrapper (const Any &rObj, VARIANT *pVar) |
void | variantToAny (const VARIANT *pVariant, Any &rAny, bool bReduceValueRange=true) |
void | variantToAny (const VARIANTARG *pArg, Any &rAny, const Type &ptype, bool bReduceValueRange=true) |
This method converts variants arguments in calls from COM -> UNO. More... | |
Any | createOleObjectWrapper (VARIANT *pVar, const Type &aType=Type()) |
bool | convertValueObject (const VARIANTARG *var, Any &any) |
void | dispatchExObject2Sequence (const VARIANTARG *pvar, Any &anySeq, const Type &type) |
Sequence< Any > | createOleArrayWrapperOfDim (SAFEARRAY *pArray, unsigned int dimCount, unsigned int actDim, LONG *index, VARTYPE type, const Type &unotype) |
Sequence< Any > | createOleArrayWrapper (SAFEARRAY *pArray, VARTYPE type, const Type &unotype=Type()) |
VARTYPE | mapTypeClassToVartype (TypeClass type) |
Reference< XSingleServiceFactory > | getInvocationFactory (const Any &anyObject) |
virtual Reference< XInterface > | createUnoWrapperInstance ()=0 |
virtual Reference< XInterface > | createComWrapperInstance ()=0 |
Sequence< Type > | getImplementedInterfaces (IUnknown *pUnk) |
Static Public Member Functions | |
static bool | isJScriptArray (const VARIANT *pvar) |
Protected Member Functions | |
Reference< XInterface > | createAdapter (const Sequence< Type > &types, const Reference< XInterface > &receiver) |
void | getElementCountAndTypeOfSequence (const Any &rSeq, sal_Int32 dim, Sequence< sal_Int32 > &seqElementCounts, TypeDescription &typeDesc) |
Reference< XTypeConverter > | getTypeConverter () |
Static Protected Member Functions | |
static bool | incrementMultidimensionalIndex (sal_Int32 dimensions, const sal_Int32 *parDimensionLength, sal_Int32 *parMultidimensionalIndex) |
static size_t | getOleElementSize (VARTYPE type) |
static Type | getElementTypeOfSequence (const Type &seqType) |
Protected Attributes | |
const sal_uInt8 | m_nUnoWrapperClass |
const sal_uInt8 | m_nComWrapperClass |
Reference< XMultiServiceFactory > | m_smgr |
Reference< XMultiServiceFactory > | m_smgrRemote |
Reference< XSingleServiceFactory > | m_xInvocationFactoryLocal |
Reference< XSingleServiceFactory > | m_xInvocationFactoryRemote |
Private Attributes | |
Reference< XTypeConverter > | m_typeConverter |
All methods are allowed to throw at least a BridgeRuntimeError.
Definition at line 125 of file unoconversionutilities.hxx.
|
inlineexplicit |
Definition at line 128 of file unoconversionutilities.hxx.
|
inline |
Definition at line 134 of file unoconversionutilities.hxx.
References xFactory.
|
inlinevirtual |
Definition at line 139 of file unoconversionutilities.hxx.
void UnoConversionUtilities< T >::anyToVariant | ( | VARIANT * | pVariant, |
const Any & | rAny | ||
) |
converts only into oleautomation types, that is there is no VT_I1, VT_UI2, VT_UI4 a sal_Unicode character is converted into a BSTR.
com.sun.star.lang.IllegalArgumentException | If the any was inappropriate for conversion. |
com.sun.star.script.CannotConvertException | The any contains a type class for which no conversion is provided. |
Definition at line 715 of file unoconversionutilities.hxx.
References createUnoTypeWrapper(), Currency, d, Decimal, Exception, hr, type, value, VT_ARRAY, VT_BOOL, VT_BSTR, VT_CY, VT_DATE, VT_DECIMAL, VT_ERROR, VT_I2, VT_I4, VT_R4, VT_R8, VT_UI1, and VT_VARIANT.
void UnoConversionUtilities< T >::anyToVariant | ( | VARIANT * | pVariant, |
const Any & | rAny, | ||
VARTYPE | type | ||
) |
Definition at line 635 of file unoconversionutilities.hxx.
References Exception, hr, type, VT_ARRAY, VT_BYREF, and VT_VARIANT.
bool UnoConversionUtilities< T >::convertValueObject | ( | const VARIANTARG * | var, |
Any & | any | ||
) |
|
protected |
Definition at line 1860 of file unoconversionutilities.hxx.
References AdapterToWrapperMap, INTERFACE_ADAPTER_FACTORY, VALUE, and WrapperToAdapterMap.
|
pure virtual |
Implemented in IUnknownWrapper, OleConverter, OleClient, and InterfaceOleWrapper.
Sequence< Any > UnoConversionUtilities< T >::createOleArrayWrapper | ( | SAFEARRAY * | pArray, |
VARTYPE | type, | ||
const Type & | unotype = Type() |
||
) |
Any UnoConversionUtilities< T >::createOleObjectWrapper | ( | VARIANT * | pVar, |
const Type & | aType = Type() |
||
) |
IllegalArgumentException | -if pVar does not contain VT_UNKNOWN or VT_DISPATCH or pVar is used for a particular UNO type which is not supported by pVar |
Definition at line 1678 of file unoconversionutilities.hxx.
References any, Any, ComPtrToWrapperMap, cppu::UnoType< typename T >::get(), getBridgeMutex(), VT_EMPTY, and WrapperToAdapterMap.
void UnoConversionUtilities< T >::createUnoObjectWrapper | ( | const Any & | rObj, |
VARIANT * | pVar | ||
) |
com.sun.star.lang.IllegalArgumentException | If rObj does not contain a struct or interface |
Definition at line 1375 of file unoconversionutilities.hxx.
References AdapterToWrapperMap, Any, convertSelfToCom(), getBridgeMutex(), getVarType(), and UnoObjToWrapperMap.
SAFEARRAY * UnoConversionUtilities< T >::createUnoSequenceWrapper | ( | const Any & | rSeq | ) |
com.sun.star.lang.IllegalArgumentException | If rSeq does not contain a sequence then the exception is thrown. |
Definition at line 1312 of file unoconversionutilities.hxx.
References Any, i, LONG, n, and VT_VARIANT.
SAFEARRAY * UnoConversionUtilities< T >::createUnoSequenceWrapper | ( | const Any & | rSeq, |
VARTYPE | elemtype | ||
) |
com.sun.star.lang.IllegalArgumentException | If rSeq does not contain a sequence or elemtype has no proper value then the exception is thrown. |
Definition at line 1044 of file unoconversionutilities.hxx.
References Any, i, VT_EMPTY, VT_NULL, and VT_VARIANT.
|
pure virtual |
Implemented in IUnknownWrapper, OleConverter, OleClient, InterfaceOleWrapper, and UnoObjectWrapperRemoteOpt.
void UnoConversionUtilities< T >::dispatchExObject2Sequence | ( | const VARIANTARG * | pvar, |
Any & | anySeq, | ||
const Type & | type | ||
) |
Definition at line 1968 of file unoconversionutilities.hxx.
References any, Any, Exception, hr, i, length, LONG, result, type, typelib_typedescription_release(), uno_destructData(), uno_sequence_construct(), uno_type_assignData(), and VT_I4.
|
protected |
Definition at line 1278 of file unoconversionutilities.hxx.
References Any, i, and typelib_typedescription_release().
|
staticprotected |
Definition at line 2207 of file unoconversionutilities.hxx.
References typelib_typedescription_release().
Sequence< Type > UnoConversionUtilities< T >::getImplementedInterfaces | ( | IUnknown * | pUnk | ) |
Definition at line 2312 of file unoconversionutilities.hxx.
References Any, hr, i, SUPPORTED_INTERFACES_PROP, SUPPORTED_INTERFACES_PROP2, and typeName.
Reference< XSingleServiceFactory > UnoConversionUtilities< T >::getInvocationFactory | ( | const Any & | anyObject | ) |
Definition at line 305 of file unoconversionutilities.hxx.
References getBridgeMutex(), and INVOCATION_SERVICE.
|
staticprotected |
|
protected |
Definition at line 2347 of file unoconversionutilities.hxx.
References getBridgeMutex().
|
staticprotected |
Definition at line 1199 of file unoconversionutilities.hxx.
|
static |
Definition at line 2250 of file unoconversionutilities.hxx.
References hr.
VARTYPE UnoConversionUtilities< T >::mapTypeClassToVartype | ( | TypeClass | type | ) |
void UnoConversionUtilities< T >::variantToAny | ( | const VARIANT * | pVariant, |
Any & | rAny, | ||
bool | bReduceValueRange = true |
||
) |
CannotConvertException | Thrown if the VARIANT contains a type that cannot be coerced in the expected Any. ArgumentIndex is 0. @IllegalArgumentException Thrown if the VARIANT is inappropriate for conversion. ArgumentPosition is -1, |
Definition at line 1483 of file unoconversionutilities.hxx.
References Currency, d, Decimal, Exception, getType(), hr, reduceRange(), sName, type, VT_ARRAY, VT_BOOL, VT_BSTR, VT_CY, VT_DATE, VT_DECIMAL, VT_EMPTY, VT_ERROR, VT_I1, VT_I2, VT_I4, VT_INT, VT_NULL, VT_R4, VT_R8, VT_UI1, VT_UI2, VT_UI4, and VT_UINT.
void UnoConversionUtilities< T >::variantToAny | ( | const VARIANTARG * | pArg, |
Any & | rAny, | ||
const Type & | ptype, | ||
bool | bReduceValueRange = true |
||
) |
This method converts variants arguments in calls from COM -> UNO.
Only then the expected UNO type is known.
CannotConvertException | Thrown if the VARIANT contains a type that cannot be coerced in the expected Any. ArgumentIndex is 0. @IllegalArgumentException Thrown if the VARIANT is inappropriate for conversion. ArgumentPosition is -1, |
Definition at line 326 of file unoconversionutilities.hxx.
References Any, Exception, getTypeConverter(), hr, value, VT_ARRAY, VT_BOOL, VT_BSTR, VT_DECIMAL, VT_I1, VT_I2, VT_I4, VT_NULL, VT_R4, VT_R8, VT_UI2, and VT_UI4.
|
protected |
Definition at line 231 of file unoconversionutilities.hxx.
|
protected |
Definition at line 230 of file unoconversionutilities.hxx.
|
protected |
Definition at line 239 of file unoconversionutilities.hxx.
|
protected |
Definition at line 243 of file unoconversionutilities.hxx.
|
private |
Definition at line 250 of file unoconversionutilities.hxx.
|
protected |
Definition at line 244 of file unoconversionutilities.hxx.
|
protected |
Definition at line 245 of file unoconversionutilities.hxx.