Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions
nsPluginElement Class Reference

#include <nsPluginArray.h>

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

List of all members.

Public Member Functions

 nsPluginElement (nsIDOMPlugin *plugin)
virtual ~nsPluginElement ()
NS_DECL_ISUPPORTS NS_IMETHOD GetDescription (nsAString &aDescription)
NS_IMETHOD GetFilename (nsAString &aFilename)
NS_IMETHOD GetName (nsAString &aName)
NS_IMETHOD GetLength (PRUint32 *aLength)
NS_IMETHOD Item (PRUint32 aIndex, nsIDOMMimeType **aReturn)
NS_IMETHOD NamedItem (const nsAString &aName, nsIDOMMimeType **aReturn)
nsIDOMMimeType item (in unsigned long index)
nsIDOMMimeType namedItem (in DOMString name)

Public Attributes

readonly attribute DOMString description
readonly attribute DOMString filename
readonly attribute DOMString name
readonly attribute unsigned long length

Protected Attributes

nsIDOMPluginmPlugin
PRUint32 mMimeTypeCount
nsIDOMMimeType ** mMimeTypeArray

Private Member Functions

nsresult GetMimeTypes ()

Detailed Description

Definition at line 82 of file nsPluginArray.h.


Constructor & Destructor Documentation

Definition at line 313 of file nsPluginArray.cpp.

{
  mPlugin = plugin;  // don't AddRef, see nsPluginArray::Item.
  mMimeTypeCount = 0;
  mMimeTypeArray = nsnull;
}

Definition at line 320 of file nsPluginArray.cpp.


Member Function Documentation

Definition at line 345 of file nsPluginArray.cpp.

{
  return mPlugin->GetDescription(aDescription);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsPluginElement::GetFilename ( nsAString &  aFilename)

Definition at line 351 of file nsPluginArray.cpp.

{
  return mPlugin->GetFilename(aFilename);
}

Definition at line 363 of file nsPluginArray.cpp.

{
  return mPlugin->GetLength(aLength);
}

Definition at line 411 of file nsPluginArray.cpp.

{
  nsresult rv = mPlugin->GetLength(&mMimeTypeCount);
  if (rv == NS_OK) {
    mMimeTypeArray = new nsIDOMMimeType*[mMimeTypeCount];
    if (mMimeTypeArray == nsnull)
      return NS_ERROR_OUT_OF_MEMORY;
    for (PRUint32 i = 0; i < mMimeTypeCount; i++) {
      nsCOMPtr<nsIDOMMimeType> mimeType;
      rv = mPlugin->Item(i, getter_AddRefs(mimeType));
      if (rv != NS_OK)
        break;
      mimeType = new nsMimeType(this, mimeType);
      NS_IF_ADDREF(mMimeTypeArray[i] = mimeType);
    }
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsPluginElement::GetName ( nsAString &  aName)

Definition at line 357 of file nsPluginArray.cpp.

{
  return mPlugin->GetName(aName);
}

Here is the caller graph for this function:

nsIDOMMimeType nsIDOMPlugin::item ( in unsigned long  index) [inherited]

Definition at line 369 of file nsPluginArray.cpp.

{
  if (mMimeTypeArray == nsnull) {
    nsresult rv = GetMimeTypes();
    if (rv != NS_OK)
      return rv;
  }
  if (aIndex < mMimeTypeCount) {
    nsIDOMMimeType* mimeType = mMimeTypeArray[aIndex];
    NS_IF_ADDREF(mimeType);
    *aReturn = mimeType;
    return NS_OK;
  }
  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

nsIDOMMimeType nsIDOMPlugin::namedItem ( in DOMString  name) [inherited]
NS_IMETHODIMP nsPluginElement::NamedItem ( const nsAString &  aName,
nsIDOMMimeType **  aReturn 
)

Definition at line 386 of file nsPluginArray.cpp.

{
  if (mMimeTypeArray == nsnull) {
    nsresult rv = GetMimeTypes();
    if (rv != NS_OK)
      return rv;
  }

  *aReturn = nsnull;
  for (PRUint32 i = 0; i < mMimeTypeCount; i++) {
    nsAutoString type;
    nsIDOMMimeType* mimeType = mMimeTypeArray[i];
    if (mimeType->GetType(type) == NS_OK) {
      if (type.Equals(aName)) {
        *aReturn = mimeType;
        NS_ADDREF(mimeType);
        break;
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

readonly attribute DOMString nsIDOMPlugin::description [inherited]

Definition at line 45 of file nsIDOMPlugin.idl.

readonly attribute DOMString nsIDOMPlugin::filename [inherited]

Definition at line 46 of file nsIDOMPlugin.idl.

readonly attribute unsigned long nsIDOMPlugin::length [inherited]

Definition at line 49 of file nsIDOMPlugin.idl.

Definition at line 103 of file nsPluginArray.h.

Definition at line 102 of file nsPluginArray.h.

Definition at line 101 of file nsPluginArray.h.

readonly attribute DOMString nsIDOMPlugin::name [inherited]

Definition at line 47 of file nsIDOMPlugin.idl.


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