Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
XPCDispTypeInfo Class Reference

Implements ITypeInfo interface for JSObjects. More...

#include <XPCDispPrivate.h>

Collaboration diagram for XPCDispTypeInfo:
Collaboration graph
[legend]

List of all members.

Classes

class  FuncDescArray
 Manages an array of FUNCDESC structs. More...

Public Member Functions

virtual ~XPCDispTypeInfo ()
STDMETHOD() GetTypeAttr (TYPEATTR __RPC_FAR *__RPC_FAR *ppTypeAttr)
STDMETHOD() GetTypeComp (ITypeComp __RPC_FAR *__RPC_FAR *ppTComp)
STDMETHOD() GetFuncDesc (UINT index, FUNCDESC __RPC_FAR *__RPC_FAR *ppFuncDesc)
STDMETHOD() GetVarDesc (UINT index, VARDESC __RPC_FAR *__RPC_FAR *ppVarDesc)
STDMETHOD() GetNames (MEMBERID memid, BSTR __RPC_FAR *rgBstrNames, UINT cMaxNames, UINT __RPC_FAR *pcNames)
STDMETHOD() GetRefTypeOfImplType (UINT index, HREFTYPE __RPC_FAR *pRefType)
STDMETHOD() GetImplTypeFlags (UINT index, INT __RPC_FAR *pImplTypeFlags)
STDMETHOD() GetIDsOfNames (LPOLESTR __RPC_FAR *rgszNames, UINT cNames, MEMBERID __RPC_FAR *pMemId)
STDMETHOD() Invoke (PVOID pvInstance, MEMBERID memid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr)
STDMETHOD() GetDocumentation (MEMBERID memid, BSTR __RPC_FAR *pBstrName, BSTR __RPC_FAR *pBstrDocString, DWORD __RPC_FAR *pdwHelpContext, BSTR __RPC_FAR *pBstrHelpFile)
STDMETHOD() GetDllEntry (MEMBERID memid, INVOKEKIND invKind, BSTR __RPC_FAR *pBstrDllName, BSTR __RPC_FAR *pBstrName, WORD __RPC_FAR *pwOrdinal)
STDMETHOD() GetRefTypeInfo (HREFTYPE hRefType, ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo)
STDMETHOD() AddressOfMember (MEMBERID memid, INVOKEKIND invKind, PVOID __RPC_FAR *ppv)
STDMETHOD() CreateInstance (IUnknown __RPC_FAR *pUnkOuter, REFIID riid, PVOID __RPC_FAR *ppvObj)
STDMETHOD() GetMops (MEMBERID memid, BSTR __RPC_FAR *pBstrMops)
STDMETHOD() GetContainingTypeLib (ITypeLib __RPC_FAR *__RPC_FAR *ppTLib, UINT __RPC_FAR *pIndex)
virtual void STDMETHODCALLTYPE ReleaseTypeAttr (TYPEATTR __RPC_FAR *pTypeAttr)
virtual void STDMETHODCALLTYPE ReleaseFuncDesc (FUNCDESC __RPC_FAR *pFuncDesc)
virtual void STDMETHODCALLTYPE ReleaseVarDesc (VARDESC __RPC_FAR *pVarDesc)
const nsAString & GetNameForDispID (DISPID dispID)
 Returns the name of a function given a DISPID.

Static Public Member Functions

static XPCDispTypeInfoNew (XPCCallContext &ccx, JSObject *obj)
 Creates an instance of XPCDispTypeInfo This static function is to be used to create instances of XPCDispTypeInfo.

Private Member Functions

 XPCDispTypeInfo (XPCCallContext &ccx, JSObject *obj, XPCDispIDArray *array)
 Initializes the object.

Private Attributes

JSObjectmJSObject
XPCDispIDArraymIDArray
XPCDispNameArray mNameArray
FuncDescArray mFuncDescArray

Detailed Description

Implements ITypeInfo interface for JSObjects.

Definition at line 338 of file XPCDispPrivate.h.


Constructor & Destructor Documentation

Definition at line 72 of file XPCDispTypeInfo.cpp.

{
    delete mIDArray;
}
XPCDispTypeInfo::XPCDispTypeInfo ( XPCCallContext ccx,
JSObject obj,
XPCDispIDArray array 
) [private]

Initializes the object.

Parameters:
ccxan XPConnect call context
objthe JS object being wrapped
arraythe array of JS ID's for the object

Definition at line 225 of file XPCDispTypeInfo.cpp.

                                                      :
    mRefCnt(0), mJSObject(obj), mIDArray(array), 
    mFuncDescArray(ccx, obj, *array, mNameArray)
{
}

Here is the caller graph for this function:


Member Function Documentation

STDMETHODIMP XPCDispTypeInfo::AddressOfMember ( MEMBERID  memid,
INVOKEKIND  invKind,
PVOID __RPC_FAR *  ppv 
)

Definition at line 387 of file XPCDispTypeInfo.cpp.

{
    // We are not supporting this till a need arrises
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::CreateInstance ( IUnknown __RPC_FAR *  pUnkOuter,
REFIID  riid,
PVOID __RPC_FAR *  ppvObj 
)

Definition at line 396 of file XPCDispTypeInfo.cpp.

{
    // We are not supporting this till a need arrises
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetContainingTypeLib ( ITypeLib __RPC_FAR *__RPC_FAR *  ppTLib,
UINT __RPC_FAR *  pIndex 
)

Definition at line 412 of file XPCDispTypeInfo.cpp.

{
    // We are not supporting this till a need arrises
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetDllEntry ( MEMBERID  memid,
INVOKEKIND  invKind,
BSTR __RPC_FAR *  pBstrDllName,
BSTR __RPC_FAR *  pBstrName,
WORD __RPC_FAR *  pwOrdinal 
)

Definition at line 369 of file XPCDispTypeInfo.cpp.

{
    // We are not supporting this till a need arrises
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetDocumentation ( MEMBERID  memid,
BSTR __RPC_FAR *  pBstrName,
BSTR __RPC_FAR *  pBstrDocString,
DWORD __RPC_FAR *  pdwHelpContext,
BSTR __RPC_FAR *  pBstrHelpFile 
)

Definition at line 344 of file XPCDispTypeInfo.cpp.

{
    PRUint32 index = memid;
    if(index < mIDArray->Length())
        return E_FAIL;

    XPCCallContext ccx(NATIVE_CALLER);
    PRUnichar * chars = xpc_JSString2PRUnichar(ccx, mIDArray->Item(ccx, index));
    if(!chars)
    {
        return E_FAIL;
    }
    CComBSTR name(chars);
    *pBstrName = name.Detach();
    pBstrDocString = 0;
    pdwHelpContext = 0;
    pBstrHelpFile = 0;
    return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP XPCDispTypeInfo::GetFuncDesc ( UINT  index,
FUNCDESC __RPC_FAR *__RPC_FAR *  ppFuncDesc 
)

Definition at line 272 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetIDsOfNames ( LPOLESTR __RPC_FAR *  rgszNames,
UINT  cNames,
MEMBERID __RPC_FAR *  pMemId 
)

Definition at line 309 of file XPCDispTypeInfo.cpp.

{
    // lookup each name
    for(UINT index = 0; index < cNames; ++index)
    {
        nsDependentString buffer(NS_STATIC_CAST(const PRUnichar *,
                                 rgszNames[index]),
                                 wcslen(rgszNames[index]));
        pMemId[index] = mNameArray.Find(buffer);

    }
    return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP XPCDispTypeInfo::GetImplTypeFlags ( UINT  index,
INT __RPC_FAR *  pImplTypeFlags 
)

Definition at line 302 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetMops ( MEMBERID  memid,
BSTR __RPC_FAR *  pBstrMops 
)

Definition at line 405 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
const nsAString & XPCDispTypeInfo::GetNameForDispID ( DISPID  dispID) [inline]

Returns the name of a function given a DISPID.

Parameters:
dispIDthe DISPID to look up
Returns:
the name of the function

Definition at line 491 of file XPCDispInlines.h.

{
    return mNameArray.GetName(dispID);
}

Here is the call graph for this function:

Here is the caller graph for this function:

STDMETHODIMP XPCDispTypeInfo::GetNames ( MEMBERID  memid,
BSTR __RPC_FAR *  rgBstrNames,
UINT  cMaxNames,
UINT __RPC_FAR *  pcNames 
)

Definition at line 286 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetRefTypeInfo ( HREFTYPE  hRefType,
ITypeInfo __RPC_FAR *__RPC_FAR *  ppTInfo 
)

Definition at line 380 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetRefTypeOfImplType ( UINT  index,
HREFTYPE __RPC_FAR *  pRefType 
)

Definition at line 295 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
NS_COM_MAP_END STDMETHODIMP XPCDispTypeInfo::GetTypeAttr ( TYPEATTR __RPC_FAR *__RPC_FAR *  ppTypeAttr)

Definition at line 260 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetTypeComp ( ITypeComp __RPC_FAR *__RPC_FAR *  ppTComp)

Definition at line 266 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::GetVarDesc ( UINT  index,
VARDESC __RPC_FAR *__RPC_FAR *  ppVarDesc 
)

Definition at line 279 of file XPCDispTypeInfo.cpp.

{
    return E_NOTIMPL;
}
STDMETHODIMP XPCDispTypeInfo::Invoke ( PVOID  pvInstance,
MEMBERID  memid,
WORD  wFlags,
DISPPARAMS __RPC_FAR *  pDispParams,
VARIANT __RPC_FAR *  pVarResult,
EXCEPINFO __RPC_FAR *  pExcepInfo,
UINT __RPC_FAR *  puArgErr 
)

Definition at line 326 of file XPCDispTypeInfo.cpp.

{
    CComQIPtr<IDispatch> pDisp(NS_REINTERPRET_CAST(IUnknown*,pvInstance));
    if(pDisp)
    {
        return pDisp->Invoke(memid, IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, 
                               pDispParams, pVarResult, pExcepInfo, puArgErr);
    }
    return E_NOINTERFACE;
}
XPCDispTypeInfo * XPCDispTypeInfo::New ( XPCCallContext ccx,
JSObject obj 
) [static]

Creates an instance of XPCDispTypeInfo This static function is to be used to create instances of XPCDispTypeInfo.

Definition at line 232 of file XPCDispTypeInfo.cpp.

{
    XPCDispTypeInfo * pTypeInfo = 0;
    JSIdArray * jsArray = JS_Enumerate(ccx, obj);
    if(!jsArray)
        return nsnull;
    XPCDispIDArray* array = new XPCDispIDArray(ccx, jsArray);
    if(!array)
        return nsnull;
    pTypeInfo = new XPCDispTypeInfo(ccx, obj, array);
    if(!pTypeInfo)
    {
        delete array;
        return nsnull;
    }
    NS_ADDREF(pTypeInfo);
    return pTypeInfo;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void STDMETHODCALLTYPE XPCDispTypeInfo::ReleaseFuncDesc ( FUNCDESC __RPC_FAR *  pFuncDesc) [virtual]

Definition at line 426 of file XPCDispTypeInfo.cpp.

{
    // Nothing for us to do
}
void STDMETHODCALLTYPE XPCDispTypeInfo::ReleaseTypeAttr ( TYPEATTR __RPC_FAR *  pTypeAttr) [virtual]

Definition at line 420 of file XPCDispTypeInfo.cpp.

{
    // Nothing for us to do
}
void STDMETHODCALLTYPE XPCDispTypeInfo::ReleaseVarDesc ( VARDESC __RPC_FAR *  pVarDesc) [virtual]

Definition at line 432 of file XPCDispTypeInfo.cpp.

{
    // Nothing for us to do
}

Member Data Documentation

Definition at line 499 of file XPCDispPrivate.h.

Definition at line 495 of file XPCDispPrivate.h.

Definition at line 494 of file XPCDispPrivate.h.

Definition at line 496 of file XPCDispPrivate.h.


The documentation for this class was generated from the following files: