LibreOffice Module extensions (master) 1
|
#include <oleobjw.hxx>
Public Member Functions | |
IUnknownWrapper (Reference< XMultiServiceFactory > const &xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass) | |
~IUnknownWrapper () override | |
Any SAL_CALL | queryInterface (const Type &t) override |
virtual Reference< XIntrospectionAccess > SAL_CALL | getIntrospection () override |
virtual Any SAL_CALL | invoke (const OUString &aFunctionName, const Sequence< Any > &aParams, Sequence< sal_Int16 > &aOutParamIndex, Sequence< Any > &aOutParam) override |
virtual void SAL_CALL | setValue (const OUString &aPropertyName, const Any &aValue) override |
virtual Any SAL_CALL | getValue (const OUString &aPropertyName) override |
virtual sal_Bool SAL_CALL | hasMethod (const OUString &aName) override |
virtual sal_Bool SAL_CALL | hasProperty (const OUString &aName) override |
virtual Any SAL_CALL | createBridge (const Any &modelDepObject, const Sequence< sal_Int8 > &aProcessId, sal_Int16 sourceModelType, sal_Int16 destModelType) override |
virtual void SAL_CALL | initialize (const Sequence< Any > &aArguments) override |
virtual OUString SAL_CALL | getDefaultPropertyName () override |
virtual OUString SAL_CALL | getDefaultMethodName () override |
virtual css::uno::Any SAL_CALL | invokeGetProperty (const OUString &aFunctionName, const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Sequence< ::sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam) override |
virtual css::uno::Any SAL_CALL | invokePutProperty (const OUString &aFunctionName, const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Sequence< ::sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam) override |
virtual css::uno::Any SAL_CALL | directInvoke (const OUString &aName, const css::uno::Sequence< css::uno::Any > &aParams) override |
virtual sal_Bool SAL_CALL | hasMember (const OUString &aName) override |
Any | invokeWithDispIdComTlb (FuncDesc &aFuncDesc, const OUString &sFuncName, const Sequence< Any > &Params, Sequence< sal_Int16 > &OutParamIndex, Sequence< Any > &OutParam) |
Public Member Functions inherited from UnoConversionUtilities< IUnknownWrapper > | |
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) |
Protected Types | |
enum | JScriptDetermination { JScriptUndefined =0 , NoJScript , IsJScript } |
Protected Member Functions | |
virtual Any | invokeWithDispIdUnoTlb (const OUString &sFunctionName, const Sequence< Any > &Params, Sequence< sal_Int16 > &OutParamIndex, Sequence< Any > &OutParam) |
virtual Any | invokeWithDispIdComTlb (const OUString &sFuncName, const Sequence< Any > &Params, Sequence< sal_Int16 > &OutParamIndex, Sequence< Any > &OutParam) |
virtual Reference< XInterface > | createUnoWrapperInstance () override |
virtual Reference< XInterface > | createComWrapperInstance () override |
void | getFuncDesc (const OUString &sFuncName, FUNCDESC **pFuncDesc) |
Obtains a FUNCDESC structure for a function. More... | |
void | getPropDesc (const OUString &sFuncName, FUNCDESC **pFuncDescGet, FUNCDESC **pFuncDescPut, VARDESC **pVarDesc) |
Obtains a FUNCDESC structures or a VARDESC structure for a property. More... | |
void | getMethodInfo (std::u16string_view sName, TypeDescription &methodDescription) |
void | getAttributeInfo (std::u16string_view sName, TypeDescription &attributeInfo) |
TypeDescription | getInterfaceMemberDescOfCurrentCall (std::u16string_view sName) |
ITypeInfo * | getTypeInfo () |
Returns always a valid ITypeInfo interface or throws a BridgeRuntimeError. More... | |
bool | getDispid (const OUString &sFuncName, DISPID *id) |
Returns the DISPID for a function or property name. More... | |
VARTYPE | getUserDefinedElementType (ITypeInfo *pTypeInfo, const DWORD nHrefType) |
VARTYPE | getElementTypeDesc (const TYPEDESC *desc) |
Gets the element type in a VARIANT like style. More... | |
void | buildComTlbIndex () |
Iterates over all functions and put the names and indices into the map m_mapComFunc of type TLBFuncIndexMap. More... | |
void | getFuncDescForInvoke (const OUString &sFuncName, const Sequence< Any > &seqArgs, FUNCDESC **pFuncDesc) |
Returns a FUNCDESC structure which contains type information about the current XInvocation::invoke call. More... | |
bool | isJScriptObject () |
Protected Member Functions inherited from UnoConversionUtilities< IUnknownWrapper > | |
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 () |
Protected Attributes | |
Sequence< Type > | m_seqTypes |
CComPtr< IUnknown > | m_spUnknown |
CComPtr< IDispatch > | m_spDispatch |
OUString | m_sTypeName |
bool | m_bOriginalDispatch |
This value is set during XInitialization::initialize. More... | |
DispIdMap | m_dispIdMap |
Reference< XIdlClass > * | m_pxIdlClass |
JScriptDetermination | m_eJScript |
TLBFuncIndexMap | m_mapComFunc |
bool | m_bComTlbIndexInit |
CComPtr< ITypeInfo > | m_spTypeInfo |
OUString | m_sDefaultMember |
bool | m_bHasDfltMethod |
bool | m_bHasDfltProperty |
Protected Attributes inherited from UnoConversionUtilities< IUnknownWrapper > | |
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 |
Additional Inherited Members | |
Static Public Member Functions inherited from UnoConversionUtilities< IUnknownWrapper > | |
static bool | isJScriptArray (const VARIANT *pvar) |
Static Protected Member Functions inherited from UnoConversionUtilities< IUnknownWrapper > | |
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) |
Definition at line 55 of file oleobjw.hxx.
|
protected |
Enumerator | |
---|---|
JScriptUndefined | |
NoJScript | |
IsJScript |
Definition at line 230 of file oleobjw.hxx.
IUnknownWrapper::IUnknownWrapper | ( | Reference< XMultiServiceFactory > const & | xFactory, |
sal_uInt8 | unoWrapperClass, | ||
sal_uInt8 | comWrapperClass | ||
) |
Definition at line 82 of file oleobjw.cxx.
References xFactory.
Referenced by createComWrapperInstance().
|
override |
Definition at line 91 of file oleobjw.cxx.
References AdapterToWrapperMap, ComPtrToWrapperMap, get(), getBridgeMutex(), m_spUnknown, o2u_attachCurrentThread(), and WrapperToAdapterMap.
|
protected |
Iterates over all functions and put the names and indices into the map m_mapComFunc of type TLBFuncIndexMap.
Call the function every time before accessing the map. Throws a BridgeRuntimeError on failure.
Definition at line 2377 of file oleobjw.cxx.
References getBridgeMutex(), getTypeInfo(), i, m_bComTlbIndexInit, and m_mapComFunc.
Referenced by getFuncDesc(), and getPropDesc().
|
overridevirtual |
Definition at line 679 of file oleobjw.cxx.
References Any, m_bOriginalDispatch, m_spDispatch, m_spUnknown, o2u_attachCurrentThread(), OLE, and UNO.
|
overrideprotectedvirtual |
Implements UnoConversionUtilities< IUnknownWrapper >.
Definition at line 1518 of file oleobjw.cxx.
References IUnknownWrapper(), UnoConversionUtilities< IUnknownWrapper >::m_nComWrapperClass, UnoConversionUtilities< IUnknownWrapper >::m_nUnoWrapperClass, and UnoConversionUtilities< IUnknownWrapper >::m_smgr.
|
overrideprotectedvirtual |
Implements UnoConversionUtilities< IUnknownWrapper >.
Definition at line 1501 of file oleobjw.cxx.
References INTERFACE_OLE_WRAPPER_IMPL, UnoConversionUtilities< IUnknownWrapper >::m_nComWrapperClass, UnoConversionUtilities< IUnknownWrapper >::m_nUnoWrapperClass, UnoConversionUtilities< IUnknownWrapper >::m_smgr, and UNO_OBJECT_WRAPPER_REMOTE_OPT.
|
overridevirtual |
Definition at line 1241 of file oleobjw.cxx.
References aName, any, Any, UnoConversionUtilities< IUnknownWrapper >::anyToVariant(), cppu::UnoType< typename T >::get(), getDispid(), getTypeInfo(), hr, if(), m_spDispatch, o2u_attachCurrentThread(), v, UnoConversionUtilities< IUnknownWrapper >::variantToAny(), VT_ERROR, and VT_VARIANT.
|
protected |
Definition at line 1537 of file oleobjw.cxx.
References getInterfaceMemberDescOfCurrentCall(), and sName.
Referenced by getValue().
|
inlineoverridevirtual |
Definition at line 98 of file oleobjw.hxx.
References m_sDefaultMember.
|
inlineoverridevirtual |
Definition at line 95 of file oleobjw.hxx.
References m_sDefaultMember.
|
protected |
Returns the DISPID for a function or property name.
If true is returned then id contains a valid DISPID.
Definition at line 2163 of file oleobjw.cxx.
References hr, and m_spDispatch.
Referenced by directInvoke(), getFuncDesc(), getPropDesc(), and hasMember().
|
protected |
Gets the element type in a VARIANT like style.
E.g. if desc->lptdesc contains a VT_PTR than it is replaced by VT_BYREF and VT_SAFEARRAY is replaced by VT_ARRAY If the TYPEDESC describes an SAFEARRAY then varType is a combination of VT_ARRAY and the element type. The argument desc must be obtained from FUNCDESC::lprgelemdescParam[i].tdesc where FUNCDESC was obtained from the ITypeInfo belonging to wrapped IDispatch.
Definition at line 2351 of file oleobjw.cxx.
References getElementTypeDesc(), getTypeInfo(), getUserDefinedElementType(), VT_ARRAY, VT_BYREF, and VT_NULL.
Referenced by getElementTypeDesc(), invokeWithDispIdComTlb(), and setValue().
|
protected |
Obtains a FUNCDESC structure for a function.
Fills the FUNCDESC structure if ITypeInfo provides information for the function of name sFuncName or pFuncDesc will not be filled in. May throw a BridgeRuntimeError.
Definition at line 2170 of file oleobjw.cxx.
References buildComTlbIndex(), getDispid(), getTypeInfo(), m_mapComFunc, and p.
Referenced by getFuncDescForInvoke(), hasMethod(), initialize(), and invokeWithDispIdUnoTlb().
|
protected |
Returns a FUNCDESC structure which contains type information about the current XInvocation::invoke call.
The FUNCDESC either describes a method, a property put or a property get operation. It uses the types com.sun.star.bridge.oleautomation.PropertyPutArgument which can be contained in the sequence of in-arguments of invoke to determine if the call is a property put or property get operation. If no adequate FUNCDESC was found, an IllegalArgumentException is thrown. Therefore it is safe to assume that the returned FUNCDESC* is not NULL.
IllegalArgumentException | Thrown if no adequate FUNCDESC could be found. |
Definition at line 2110 of file oleobjw.cxx.
References Any, FuncDesc::Detach(), getFuncDesc(), getPropDesc(), and getTypeInfo().
Referenced by invokeWithDispIdComTlb().
|
protected |
Definition at line 1549 of file oleobjw.cxx.
References m_seqTypes, and sName.
Referenced by getAttributeInfo(), and getMethodInfo().
|
overridevirtual |
Definition at line 134 of file oleobjw.cxx.
|
protected |
Definition at line 1526 of file oleobjw.cxx.
References getInterfaceMemberDescOfCurrentCall(), and sName.
Referenced by invoke(), and invokeWithDispIdUnoTlb().
|
protected |
Obtains a FUNCDESC structures or a VARDESC structure for a property.
pFuncDescPut may also contain a structure for a "propertyputref" operation. If pFuncDesc contains a "put ref" or "put" FUNCDESC depends on what was found first in the type description. Fills the FUNCDESC structure if ITypeInfo provides information for the respective property functions or the structures will not be filled in. May throw a BridgeRuntimeError.
Definition at line 2237 of file oleobjw.cxx.
References buildComTlbIndex(), getDispid(), getTypeInfo(), i, m_mapComFunc, and p.
Referenced by getFuncDescForInvoke(), getValue(), hasMethod(), hasProperty(), initialize(), invokeGetProperty(), invokePutProperty(), and setValue().
|
protected |
Returns always a valid ITypeInfo interface or throws a BridgeRuntimeError.
The returned interface does not need to be AddRef'ed as long as it is locally used. The interface is kept in the instance of this class.
Definition at line 2457 of file oleobjw.cxx.
References getBridgeMutex(), m_spDispatch, and m_spTypeInfo.
Referenced by buildComTlbIndex(), directInvoke(), getElementTypeDesc(), getFuncDesc(), getFuncDescForInvoke(), getPropDesc(), getValue(), hasMethod(), hasProperty(), initialize(), invokeGetProperty(), invokePutProperty(), invokeWithDispIdComTlb(), invokeWithDispIdUnoTlb(), and setValue().
|
protected |
Definition at line 2307 of file oleobjw.cxx.
References getUserDefinedElementType(), and VT_NULL.
Referenced by getElementTypeDesc(), and getUserDefinedElementType().
|
overridevirtual |
Definition at line 433 of file oleobjw.cxx.
References Any, Exception, getAttributeInfo(), cppu::getCaughtException(), getPropDesc(), getTypeInfo(), hr, index, m_spDispatch, m_sTypeName, BridgeRuntimeError::message, o2u_attachCurrentThread(), sName, and UnoConversionUtilities< IUnknownWrapper >::variantToAny().
|
overridevirtual |
Definition at line 1486 of file oleobjw.cxx.
References aName, getDispid(), m_spDispatch, and o2u_attachCurrentThread().
|
overridevirtual |
Definition at line 577 of file oleobjw.cxx.
References aName, Exception, cppu::getCaughtException(), getFuncDesc(), getPropDesc(), getTypeInfo(), m_spDispatch, BridgeRuntimeError::message, and o2u_attachCurrentThread().
|
overridevirtual |
Definition at line 627 of file oleobjw.cxx.
References aName, Exception, cppu::getCaughtException(), getPropDesc(), getTypeInfo(), m_spDispatch, BridgeRuntimeError::message, and o2u_attachCurrentThread().
Definition at line 1161 of file oleobjw.cxx.
References aArguments, Exception, cppu::getCaughtException(), getFuncDesc(), getPropDesc(), getTypeInfo(), m_bHasDfltMethod, m_bHasDfltProperty, m_bOriginalDispatch, m_sDefaultMember, m_seqTypes, m_spDispatch, m_spUnknown, BridgeRuntimeError::message, and o2u_attachCurrentThread().
|
overridevirtual |
Definition at line 202 of file oleobjw.cxx.
References Any, Exception, cppu::getCaughtException(), getMethodInfo(), invokeWithDispIdComTlb(), invokeWithDispIdUnoTlb(), m_spDispatch, BridgeRuntimeError::message, and o2u_attachCurrentThread().
|
overridevirtual |
Definition at line 141 of file oleobjw.cxx.
References Any, Exception, cppu::getCaughtException(), getPropDesc(), getTypeInfo(), invokeWithDispIdComTlb(), and o2u_attachCurrentThread().
|
overridevirtual |
Definition at line 171 of file oleobjw.cxx.
References Any, Exception, cppu::getCaughtException(), getPropDesc(), getTypeInfo(), invokeWithDispIdComTlb(), and o2u_attachCurrentThread().
|
protectedvirtual |
Definition at line 1628 of file oleobjw.cxx.
References Any, getFuncDescForInvoke(), getTypeInfo(), and invokeWithDispIdComTlb().
Any IUnknownWrapper::invokeWithDispIdComTlb | ( | FuncDesc & | aFuncDesc, |
const OUString & | sFuncName, | ||
const Sequence< Any > & | Params, | ||
Sequence< sal_Int16 > & | OutParamIndex, | ||
Sequence< Any > & | OutParam | ||
) |
Definition at line 1640 of file oleobjw.cxx.
References Any, UnoConversionUtilities< IUnknownWrapper >::anyToVariant(), getElementTypeDesc(), getTypeInfo(), hr, i, m_spDispatch, result, type, v, UnoConversionUtilities< IUnknownWrapper >::variantToAny(), VT_BYREF, VT_DECIMAL, VT_EMPTY, VT_ERROR, and VT_VARIANT.
Referenced by invoke(), invokeGetProperty(), invokePutProperty(), and invokeWithDispIdComTlb().
|
protectedvirtual |
Definition at line 725 of file oleobjw.cxx.
References Any, UnoConversionUtilities< IUnknownWrapper >::anyToVariant(), getFuncDesc(), getMethodInfo(), getTypeInfo(), hr, i, isJScriptObject(), m_spDispatch, UnoConversionUtilities< IUnknownWrapper >::variantToAny(), VT_ARRAY, VT_BOOL, VT_BSTR, VT_BYREF, VT_EMPTY, VT_I2, VT_I4, VT_R4, VT_R8, VT_UI1, and VT_VARIANT.
Referenced by invoke().
|
protected |
Definition at line 1590 of file oleobjw.cxx.
References IsJScript, JSCRIPT_ID, JSCRIPT_ID_PROPERTY, JScriptUndefined, m_eJScript, m_spDispatch, name, NoJScript, result, and VT_BSTR.
Referenced by invokeWithDispIdUnoTlb().
Definition at line 116 of file oleobjw.cxx.
References Any, m_bHasDfltMethod, m_bHasDfltProperty, m_spDispatch, queryInterface(), and t.
Referenced by queryInterface().
|
overridevirtual |
Definition at line 264 of file oleobjw.cxx.
References UnoConversionUtilities< IUnknownWrapper >::anyToVariant(), Exception, cppu::getCaughtException(), getElementTypeDesc(), getPropDesc(), getTypeInfo(), hr, m_spDispatch, BridgeRuntimeError::message, o2u_attachCurrentThread(), SAL_WARN, VT_ARRAY, VT_BYREF, VT_DECIMAL, VT_TYPEMASK, and VT_VARIANT.
|
protected |
Definition at line 236 of file oleobjw.hxx.
Referenced by buildComTlbIndex().
|
protected |
Definition at line 240 of file oleobjw.hxx.
Referenced by initialize(), and queryInterface().
|
protected |
Definition at line 241 of file oleobjw.hxx.
Referenced by initialize(), and queryInterface().
|
protected |
This value is set during XInitialization::initialize.
It indicates that the COM interface was transported as VT_DISPATCH in a VARIANT rather than a VT_UNKNOWN
Definition at line 224 of file oleobjw.hxx.
Referenced by createBridge(), and initialize().
|
protected |
Definition at line 225 of file oleobjw.hxx.
|
protected |
Definition at line 231 of file oleobjw.hxx.
Referenced by isJScriptObject().
|
protected |
Definition at line 234 of file oleobjw.hxx.
Referenced by buildComTlbIndex(), getFuncDesc(), and getPropDesc().
|
protected |
Definition at line 226 of file oleobjw.hxx.
|
protected |
Definition at line 239 of file oleobjw.hxx.
Referenced by getDefaultMethodName(), getDefaultPropertyName(), and initialize().
Definition at line 217 of file oleobjw.hxx.
Referenced by getInterfaceMemberDescOfCurrentCall(), and initialize().
|
protected |
Definition at line 219 of file oleobjw.hxx.
Referenced by createBridge(), directInvoke(), getDispid(), getTypeInfo(), getValue(), hasMember(), hasMethod(), hasProperty(), initialize(), invoke(), invokeWithDispIdComTlb(), invokeWithDispIdUnoTlb(), isJScriptObject(), queryInterface(), and setValue().
|
protected |
Definition at line 238 of file oleobjw.hxx.
Referenced by getTypeInfo().
|
protected |
Definition at line 218 of file oleobjw.hxx.
Referenced by createBridge(), initialize(), and ~IUnknownWrapper().
|
protected |
Definition at line 220 of file oleobjw.hxx.
Referenced by getValue().