Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsNativeDetectorFactory Class Reference
Inheritance diagram for nsNativeDetectorFactory:
Inheritance graph
Collaboration diagram for nsNativeDetectorFactory:
Collaboration graph

List of all members.

Public Member Functions

 nsNativeDetectorFactory (PRUint32 aCodePage, PRBool stringBase)
virtual ~nsNativeDetectorFactory ()
NS_IMETHOD CreateInstance (nsISupports *aDelegate, const nsIID &aIID, void **aResult)
NS_IMETHOD LockFactory (PRBool aLock)
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.

Private Attributes

PRUint32 mCodePage
PRBool mStringBase

Detailed Description

Definition at line 270 of file nsNativeDetectors.cpp.

Constructor & Destructor Documentation

nsNativeDetectorFactory::nsNativeDetectorFactory ( PRUint32  aCodePage,
PRBool  stringBase 
) [inline]

Definition at line 274 of file nsNativeDetectors.cpp.

     mCodePage = aCodePage;
     mStringBase = stringBase;

Definition at line 278 of file nsNativeDetectors.cpp.


Member Function Documentation

void nsIFactory::createInstance ( in nsISupports  aOuter,
in nsIIDRef  iid,
[retval, iid_is(iid)] out nsQIResult  result 
) [inherited]

Creates an instance of a component.

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.
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 nsNativeDetectorFactory::CreateInstance ( nsISupports *  aDelegate,
const nsIID aIID,
void **  aResult 

Definition at line 291 of file nsNativeDetectors.cpp.

  if(NULL == aResult)
        return NS_ERROR_NULL_POINTER;
  if(NULL != aDelegate)

  *aResult = NULL;

  nsISupports *inst = nsnull;
  if (mStringBase)
    inst = (nsISupports *) new nsNativeStringDetector(mCodePage);
    inst = (nsISupports *) new nsNativeDetector(mCodePage);
  if(NULL == inst) {
  NS_ADDREF(inst);  // Stabilize
  nsresult res =inst->QueryInterface(aIID, aResult);
  NS_RELEASE(inst); // Destabilize and avoid leaks. Avoid calling delete <interface pointer>

  return res;

Here is the call graph for this function:

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.

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

Definition at line 316 of file nsNativeDetectors.cpp.

  return NS_OK;

Member Data Documentation

Definition at line 284 of file nsNativeDetectors.cpp.

Definition at line 285 of file nsNativeDetectors.cpp.

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