Back to index

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

Parameterized property object JSClass This class is used to support parameterized properties for IDispatch. More...

#include <XPCDispPrivate.h>

Collaboration diagram for XPCDispParamPropJSClass:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~XPCDispParamPropJSClass ()
 Cleans up the member, derefs the mDispObj, mWrapper and such.
XPCWrappedNativeGetWrapper () const
 Returns the wrapper.
JSBool Invoke (XPCCallContext &ccx, XPCDispObject::CallMode mode, jsval *retval)
 Invokes the parameterized getter/setter.
XPCDispParamsGetParams () const
 Returns the parameters for the parameterized property.

Static Public Member Functions

static JSBool NewInstance (XPCCallContext &ccx, XPCWrappedNative *wrapper, PRUint32 dispID, XPCDispParams *dispParams, jsval *paramPropObj)
 returns a new or existing JS object as a jsval.

Private Member Functions

 XPCDispParamPropJSClass (XPCWrappedNative *wrapper, nsISupports *dispObj, PRUint32 dispID, XPCDispParams *dispParams)
 Private constructor to initialize data members.

Private Attributes

XPCWrappedNativemWrapper
PRUint32 mDispID
XPCDispParamsmDispParams
IDispatchmDispObj

Detailed Description

Parameterized property object JSClass This class is used to support parameterized properties for IDispatch.

Definition at line 1288 of file XPCDispPrivate.h.


Constructor & Destructor Documentation

Cleans up the member, derefs the mDispObj, mWrapper and such.

Definition at line 221 of file XPCDispParamPropJSClass.cpp.

{
    delete mDispParams;
    // release our members
    NS_IF_RELEASE(mWrapper);
    NS_IF_RELEASE(mDispObj);
}
XPCDispParamPropJSClass::XPCDispParamPropJSClass ( XPCWrappedNative wrapper,
nsISupports *  dispObj,
PRUint32  dispID,
XPCDispParams dispParams 
) [private]

Private constructor to initialize data members.

Parameters:
wrapperThe wrapper this parameterized object belongs to
dispObjpointer to the IDispatch object
dispIDthe DISPID of the parametersized property
dispParamsthe parameters for the parameterized property

Definition at line 206 of file XPCDispParamPropJSClass.cpp.

                                                                            :
    mWrapper(wrapper),
    mDispID(dispID),
    mDispParams(dispParams),
    mDispObj(nsnull)
{
    NS_ADDREF(mWrapper);
    dispObj->QueryInterface(NSID_IDISPATCH, 
                                              NS_REINTERPRET_CAST(void**,
                                              &mDispObj));
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Returns the parameters for the parameterized property.

Returns:
a reference to the parameters for the parameterized property

Definition at line 1329 of file XPCDispPrivate.h.

{ return mDispParams; }

Here is the caller graph for this function:

Returns the wrapper.

Returns:
pointer to the wrapper (on loan)

Definition at line 1315 of file XPCDispPrivate.h.

{ return mWrapper; }

Here is the caller graph for this function:

Invokes the parameterized getter/setter.

Parameters:
ccxXPConnect call context
modecall mode
retvalpointer to a jsval to receive the result

Definition at line 623 of file XPCDispInlines.h.

Here is the call graph for this function:

Here is the caller graph for this function:

JSBool XPCDispParamPropJSClass::NewInstance ( XPCCallContext ccx,
XPCWrappedNative wrapper,
PRUint32  dispID,
XPCDispParams dispParams,
jsval paramPropObj 
) [static]

returns a new or existing JS object as a jsval.

This currently always returns a new instance. But it may be worth looking into reusing objects

Parameters:
ccxan XPConnect call context
wrapperthe wrapper this parameterized property belongs to
dispIDDISPID of the parameterized property
dispParamsthe parameters for the parameterized properties
paramPropObjpointer to the jsval that will receive the JS function object
Returns:
true if the JS function object was created

Definition at line 186 of file XPCDispParamPropJSClass.cpp.

{
    XPCDispParamPropJSClass* pDispParam =
        new XPCDispParamPropJSClass(wrapper, ccx.GetTearOff()->GetNative(), 
                                    dispID, dispParams);
    if(!pDispParam)
        return JS_FALSE;
    JSObject * obj = JS_NewObject(ccx, &ParamPropClass, nsnull, nsnull);
    if(!obj)
        return JS_FALSE;
    if(!JS_SetPrivate(ccx, obj, pDispParam))
        return JS_FALSE;
    *paramPropObj = OBJECT_TO_JSVAL(obj);
    return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1342 of file XPCDispPrivate.h.

Definition at line 1344 of file XPCDispPrivate.h.

Definition at line 1343 of file XPCDispPrivate.h.

Definition at line 1341 of file XPCDispPrivate.h.


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