Back to index

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

#include <nsSanePluginFactory.h>

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

List of all members.

Public Member Functions

 nsSanePluginFactoryImpl (const nsCID &aClass, const char *className, const char *contractID)
NS_IMETHOD CreateInstance (nsISupports *aOuter, const nsIID &aIID, void **aResult)
NS_IMETHOD LockFactory (PRBool aLock)
NS_IMETHOD Initialize (void)
NS_IMETHOD Shutdown (void)
NS_IMETHOD GetMIMEDescription (const char **result)
NS_IMETHOD GetValue (nsPluginVariable variable, void *value)
NS_IMETHOD CreatePluginInstance (nsISupports *aOuter, REFNSIID aIID, const char *aPluginMIMEType, void **aResult)
void createPluginInstance (in nsISupports aOuter, in nsIIDRef aIID, in string aPluginMIMEType,[retval, iid_is(aIID)] out nsQIResult aResult)
 Creates a new plugin instance, based on a MIME type.
void initialize ()
 Initializes the plugin and will be called before any new instances are created.
void shutdown ()
 Called when the browser is done with the plugin factory, or when the plugin is disabled by the user.
void getMIMEDescription (out constCharPtr aMIMEDescription)
 Returns the MIME description for the plugin.
void getValue (in nsPluginVariable aVariable, in voidPtr aValue)
 Returns the value of a variable associated with the plugin.
void createInstance (in nsISupports aOuter, in nsIIDRef iid,[retval, iid_is(iid)] out nsQIResult result)
 Creates an instance of a component.
void lockFactory (in PRBool lock)
 LockFactory provides the client a way to keep the component in memory until it is finished with it.

Public Attributes

 NS_DECL_ISUPPORTS

Protected Member Functions

virtual ~nsSanePluginFactoryImpl ()

Protected Attributes

nsCID mClassID
const char * mClassName
const char * mContractID

Detailed Description

Definition at line 46 of file nsSanePluginFactory.h.


Constructor & Destructor Documentation

nsSanePluginFactoryImpl::nsSanePluginFactoryImpl ( const nsCID aClass,
const char *  className,
const char *  contractID 
)

Definition at line 65 of file nsSanePluginFactory.cpp.

    : mClassID(aClass), mClassName(className), mContractID(contractID)
{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::nsSanePluginFactoryImpl()\n");
#endif
}

Definition at line 75 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::~nsSanePluginFactoryImpl()\n");
#endif

    printf("mRefCnt = %i\n", mRefCnt);
    NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction");
}

Member Function Documentation

NS_IMETHODIMP nsSanePluginFactoryImpl::CreateInstance ( nsISupports *  aOuter,
const nsIID aIID,
void **  aResult 
)

Definition at line 119 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::CreateInstance()\n");
#endif

    if ( !aResult )
        return NS_ERROR_NULL_POINTER;
  
    if ( aOuter )
        return NS_ERROR_NO_AGGREGATION;

    nsSanePluginInstance * inst = new nsSanePluginInstance();
    if (!inst)
        return NS_ERROR_OUT_OF_MEMORY;
           
    inst->AddRef();
    *aResult = inst;
    return NS_OK;
}
void nsIFactory::createInstance ( in nsISupports  aOuter,
in nsIIDRef  iid,
[retval, iid_is(iid)] out nsQIResult  result 
) [inherited]

Creates an instance of a component.

Parameters:
aOuterPointer to a component that wishes to be aggregated in the resulting instance. This will be nsnull if no aggregation is requested.
iidThe IID of the interface being requested in the component which is being currently created.
result[out] Pointer to the newly created instance, if successful.
Returns:
NS_OK - Component successfully created and the interface being requested was successfully returned in result. NS_NOINTERFACE - Interface not accessible. NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the component is not aggregatable. NS_ERROR* - Method failure.
NS_IMETHODIMP nsSanePluginFactoryImpl::CreatePluginInstance ( nsISupports *  aOuter,
REFNSIID  aIID,
const char *  aPluginMIMEType,
void **  aResult 
)

Definition at line 218 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::CreatePluginInstance()\n");
#endif

    // Need to find out what this is used for.  The npsimple
    // plugin looks like it just does a CreateInstance and 
    // ignores the mime type.
    return NS_ERROR_NOT_IMPLEMENTED;
}
void nsIPlugin::createPluginInstance ( in nsISupports  aOuter,
in nsIIDRef  aIID,
in string  aPluginMIMEType,
[retval, iid_is(aIID)] out nsQIResult  aResult 
) [inherited]

Creates a new plugin instance, based on a MIME type.

This allows different impelementations to be created depending on the specified MIME type.

Definition at line 178 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::GetMIMEDescription()\n");
#endif

    // caller is responsible for releasing
    *result = PL_strdup( PLUGIN_MIME_DESCRIPTION );

    return NS_OK;
}
void nsIPlugin::getMIMEDescription ( out constCharPtr  aMIMEDescription) [inherited]

Returns the MIME description for the plugin.

The MIME description is a colon-separated string containg the plugin MIME type, plugin data file extension, and plugin name, e.g.:

"application/x-simple-plugin:smp:Simple LiveConnect Sample Plug-in"

(Corresponds to NPP_GetMIMEDescription.)

Parameters:
aMIMEDescription- the resulting MIME description
Returns:
- NS_OK if this operation was successful

Definition at line 191 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::GetValue()\n");
#endif

    nsresult err = NS_OK;

    if ( variable == nsPluginVariable_NameString ) {
    
        *( ( char ** )value ) = strdup( PLUGIN_NAME );

    } else if ( variable == nsPluginVariable_DescriptionString ) {

        *( ( char ** )value ) = strdup( PLUGIN_DESCRIPTION );

    } else {
    
        err = NS_ERROR_FAILURE;

    }
  
    return err;
}
void nsIPlugin::getValue ( in nsPluginVariable  aVariable,
in voidPtr  aValue 
) [inherited]

Returns the value of a variable associated with the plugin.

(Corresponds to NPP_GetValue.)

Parameters:
aVariable- the plugin variable to get
aValue- the address of where to store the resulting value
Returns:
- NS_OK if this operation was successful

Definition at line 156 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::Initialize()\n");
#endif

    return NS_OK;
}
void nsIPlugin::initialize ( ) [inherited]

Initializes the plugin and will be called before any new instances are created.

It is passed browserInterfaces on which QueryInterface may be used to obtain an nsIPluginManager, and other interfaces.

Parameters:
browserInterfaces- an object that allows access to other browser interfaces via QueryInterface
Returns:
- NS_OK if this operation was successful

Definition at line 143 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::LockFactory()\n");
#endif

    // Needs to be implemented

    return NS_OK;
}
void nsIFactory::lockFactory ( in PRBool  lock) [inherited]

LockFactory provides the client a way to keep the component in memory until it is finished with it.

The client can call LockFactory(PR_TRUE) to lock the factory and LockFactory(PR_FALSE) to release the factory.

Parameters:
lock- Must be PR_TRUE or PR_FALSE
Returns:
NS_OK - If the lock operation was successful. NS_ERROR* - Method failure.

Definition at line 167 of file nsSanePluginFactory.cpp.

{
#ifdef DEBUG
    printf("nsSanePluginFactoryImpl::Shutdown()\n");
#endif

    return NS_OK;
}
void nsIPlugin::shutdown ( ) [inherited]

Called when the browser is done with the plugin factory, or when the plugin is disabled by the user.

(Corresponds to NPP_Shutdown.)

Returns:
- NS_OK if this operation was successful

Member Data Documentation

Definition at line 72 of file nsSanePluginFactory.h.

Definition at line 73 of file nsSanePluginFactory.h.

Definition at line 74 of file nsSanePluginFactory.h.

Definition at line 53 of file nsSanePluginFactory.h.


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