Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes
WSPPropertyBagWrapper Class Reference

#include <wspprivate.h>

Inheritance diagram for WSPPropertyBagWrapper:
Inheritance graph
[legend]
Collaboration diagram for WSPPropertyBagWrapper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 WSPPropertyBagWrapper ()
virtual ~WSPPropertyBagWrapper ()
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBSERVICEPROPERTYBAGWRAPPER
NS_DECL_NSICLASSINFO
NS_IMETHOD 
CallMethod (PRUint16 methodIndex, const nsXPTMethodInfo *info, nsXPTCMiniVariant *params)
NS_IMETHOD GetInterfaceInfo (nsIInterfaceInfo **info)
void Init (in nsIPropertyBag aPropertyBag, in nsIInterfaceInfo aInterfaceInfo)
void getInterfaces (out PRUint32 count,[array, size_is(count), retval] out nsIIDPtr array)
 Get an ordered list of the interface ids that instances of the class promise to implement.
nsISupports getHelperForLanguage (in PRUint32 language)
 Get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage.

Static Public Member Functions

static NS_METHOD Create (nsISupports *outer, const nsIID &aIID, void **aInstancePtr)

Public Attributes

readonly attribute string contractID
 A contract ID through which an instance of this class can be created (or accessed as a service, if |flags & SINGLETON|), or null.
readonly attribute string classDescription
 A human readable string naming the class, or null.
readonly attribute nsCIDPtr classID
 A class ID through which an instance of this class can be created (or accessed as a service, if |flags & SINGLETON|), or null.
readonly attribute PRUint32 implementationLanguage
 Return language type from list in nsIProgrammingLanguage.
const PRUint32 SINGLETON = 1 << 0
 Bitflags for 'flags' attribute.
const PRUint32 THREADSAFE = 1 << 1
const PRUint32 MAIN_THREAD_ONLY = 1 << 2
const PRUint32 DOM_OBJECT = 1 << 3
const PRUint32 PLUGIN_OBJECT = 1 << 4
const PRUint32 EAGER_CLASSINFO = 1 << 5
const PRUint32 CONTENT_NODE = 1 << 6
 'flags' attribute bitflag: whether objects of this type implement nsIContent.
const PRUint32 RESERVED = 1 << 31
readonly attribute PRUint32 flags
readonly attribute nsCID classIDNoAlloc
 Also a class ID through which an instance of this class can be created (or accessed as a service, if |flags & SINGLETON|).

Protected Attributes

nsCOMPtr< nsIPropertyBagmPropertyBag
nsCOMPtr< nsIInterfaceInfomInterfaceInfo
const nsIIDmIID

Detailed Description

Definition at line 254 of file wspprivate.h.


Constructor & Destructor Documentation

Definition at line 45 of file wsppropertybagwrapper.cpp.

  : mIID(nsnull)
{
}

Here is the caller graph for this function:

Definition at line 50 of file wsppropertybagwrapper.cpp.

{
}

Member Function Documentation

Definition at line 105 of file wsppropertybagwrapper.cpp.

{
  if (methodIndex < 3) {
    NS_ERROR("WSPPropertyBagWrapper: bad method index");
    return NS_ERROR_FAILURE;
  }

  nsresult rv = NS_OK;
  nsAutoString propName;

  rv = WSPFactory::C2XML(nsDependentCString(info->GetName()), propName);
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr<nsIVariant> val;
  rv = mPropertyBag->GetProperty(propName, getter_AddRefs(val));
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr<nsIInterfaceInfo> iinfo;
  if (info->IsGetter()) {
    const nsXPTParamInfo& paramInfo = info->GetParam(0);
    const nsXPTType& type = paramInfo.GetType();
    uint8 type_tag = type.TagPart();

    if (type_tag == nsXPTType::T_INTERFACE) {
      rv = mInterfaceInfo->GetInfoForParam(methodIndex, &paramInfo,
                                           getter_AddRefs(iinfo));
      if (NS_FAILED(rv)) {
        return rv;
      }
    }

    rv = WSPProxy::VariantToValue(type_tag, params[0].val.p, iinfo, val);
  }
  else if (info->GetParamCount() == 2) {
    // If it's not an explicit getter, it has to be an array getter
    // method.

    // The first parameter should be the array length out param
    const nsXPTParamInfo& paramInfo1 = info->GetParam(0);
    const nsXPTType& type1 = paramInfo1.GetType();
    if (!paramInfo1.IsOut() || (type1.TagPart() != nsXPTType::T_U32)) {
      NS_ERROR("Unexpected parameter type for getter");
      return NS_ERROR_FAILURE;
    }

    // The second parameter should be the array out pointer itself.
    const nsXPTParamInfo& paramInfo2 = info->GetParam(1);
    const nsXPTType& type2 = paramInfo2.GetType();
    if (!paramInfo2.IsOut() || !type2.IsArray()) {
      NS_ERROR("Unexpected parameter type for getter");
      return NS_ERROR_FAILURE;
    }

    nsXPTType arrayType;
    rv = mInterfaceInfo->GetTypeForParam(methodIndex, &paramInfo2,
                                         1, &arrayType);
    if (NS_FAILED(rv)) {
      return rv;
    }

    if (arrayType.IsInterfacePointer()) {
      rv = mInterfaceInfo->GetInfoForParam(methodIndex, &paramInfo2,
                                           getter_AddRefs(iinfo));
      if (NS_FAILED(rv)) {
        return rv;
      }
    }

    rv = WSPProxy::VariantToArrayValue(arrayType.TagPart(), params, params + 1,
                                       iinfo, val);
  }
  else {
    NS_ERROR("Unexpected method signature for property bag wrapper");
    return NS_ERROR_FAILURE;
  }

  return rv;
}

Here is the call graph for this function:

NS_METHOD WSPPropertyBagWrapper::Create ( nsISupports *  outer,
const nsIID aIID,
void **  aInstancePtr 
) [static]

Definition at line 65 of file wsppropertybagwrapper.cpp.

{
  NS_ENSURE_ARG_POINTER(aInstancePtr);
  NS_ENSURE_NO_AGGREGATION(outer);

  WSPPropertyBagWrapper* wrapper = new WSPPropertyBagWrapper();
  if (!wrapper) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(wrapper);
  nsresult rv = wrapper->QueryInterface(aIID, aInstancePtr);
  NS_RELEASE(wrapper);
  return rv;
}

Here is the call graph for this function:

nsISupports nsIClassInfo::getHelperForLanguage ( in PRUint32  language) [inherited]

Get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage.

For instance, if asked for the helper for nsIProgrammingLanguage::JAVASCRIPT this might return an object that can be QI'd into the nsIXPCScriptable interface to assist XPConnect in supplying JavaScript specific behavior to callers of the instance object.

see: nsIProgrammingLanguage.idl

Should return null if no helper available for given language.

Definition at line 191 of file wsppropertybagwrapper.cpp.

{
  NS_ENSURE_ARG_POINTER(info);

  *info = mInterfaceInfo;
  NS_ADDREF(*info);

  return NS_OK;
}

Here is the call graph for this function:

void nsIClassInfo::getInterfaces ( out PRUint32  count,
[array, size_is(count), retval] out nsIIDPtr  array 
) [inherited]

Get an ordered list of the interface ids that instances of the class promise to implement.

Note that nsISupports is an implicit member of any such list and need not be included.

Should set *count = 0 and *array = null and return NS_OK if getting the list is not supported.

void nsIWebServicePropertyBagWrapper::Init ( in nsIPropertyBag  aPropertyBag,
in nsIInterfaceInfo  aInterfaceInfo 
) [inherited]

Member Data Documentation

A human readable string naming the class, or null.

Definition at line 86 of file nsIClassInfo.idl.

readonly attribute nsCIDPtr nsIClassInfo::classID [inherited]

A class ID through which an instance of this class can be created (or accessed as a service, if |flags & SINGLETON|), or null.

Definition at line 92 of file nsIClassInfo.idl.

Also a class ID through which an instance of this class can be created (or accessed as a service, if |flags & SINGLETON|).

If the class does not have a CID, it should return NS_ERROR_NOT_AVAILABLE. This attribute exists so C++ callers can avoid allocating and freeing a CID, as would happen if they used classID.

Definition at line 130 of file nsIClassInfo.idl.

'flags' attribute bitflag: whether objects of this type implement nsIContent.

Definition at line 113 of file nsIClassInfo.idl.

A contract ID through which an instance of this class can be created (or accessed as a service, if |flags & SINGLETON|), or null.

Definition at line 81 of file nsIClassInfo.idl.

const PRUint32 nsIClassInfo::DOM_OBJECT = 1 << 3 [inherited]

Definition at line 106 of file nsIClassInfo.idl.

Definition at line 108 of file nsIClassInfo.idl.

readonly attribute PRUint32 nsIClassInfo::flags [inherited]

Definition at line 121 of file nsIClassInfo.idl.

Return language type from list in nsIProgrammingLanguage.

Definition at line 98 of file nsIClassInfo.idl.

Definition at line 105 of file nsIClassInfo.idl.

Definition at line 278 of file wspprivate.h.

Definition at line 277 of file wspprivate.h.

Definition at line 276 of file wspprivate.h.

Definition at line 107 of file nsIClassInfo.idl.

const PRUint32 nsIClassInfo::RESERVED = 1 << 31 [inherited]

Definition at line 118 of file nsIClassInfo.idl.

const PRUint32 nsIClassInfo::SINGLETON = 1 << 0 [inherited]

Bitflags for 'flags' attribute.

Definition at line 103 of file nsIClassInfo.idl.

const PRUint32 nsIClassInfo::THREADSAFE = 1 << 1 [inherited]

Definition at line 104 of file nsIClassInfo.idl.


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