You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.


TOC PREV NEXT INDEX

Embedding Gecko API


nsIClassInfo


This interface provides information about a specific implementation class. It is scriptable.

Methods
getInterfaces

Returns 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. The method should set *count = 0 and *array = null and return NS_OK if getting the list is not supported.

Syntax:

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

Parameters:

count: [out]The number of implemented interfaces.
array: [out] The list of implemented interfaces.

nsresult:

NS_OK if successful, or if getting list is not supported. See above.
getHelperForLanguage

Gets a language mapping specific helper object that may assist in using objects of this class in a specific language. 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. This method should return null if no helper available for given language.

Syntax:

nsISupports nsIClassInfo::getHelperForLanguage(
	in PRUint32 language)  

Parameters:

language: An integer representing the requested language.

Returns:

The helper object.

See also: nsIProgrammingLanguage for language constants.

Attributes
readonly attribute string nsIClassInfo::contractID

Gets the 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 nsIClassInfo::classDescription

Gets a human readable string naming the class, or null.

readonly attribute nsCIDPtr nsIClassInfo::classID

Gets the 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 nsIClassInfo::implementationLanguage

Gets the language type from list in nsIProgrammingLanguage.

readonly attribute nsCID nsIClassInfo::classIDNoAlloc

Gets 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 class ID.

readonly attribute PRUint32 nsIClassInfo::flags

See constant values below.

Constants
const PRUint32 nsIClassInfo::SINGLETON = 1 << 0
const PRUint32 nsIClassInfo::THREADSAFE = 1 << 1
const PRUint32 nsIClassInfo::MAIN_THREAD_ONLY = 1 << 2
const PRUint32 nsIClassInfo::DOM_OBJECT = 1 << 3
const PRUint32 nsIClassInfo::PLUGIN_OBJECT = 1 << 4
const PRUint32 nsIClassInfo::EAGER_CLASSINFO = 1 << 5
const PRUint32 nsIClassInfo::RESERVED = 1 << 31

Bitflags for flags attribute.

Note: The high order bit is RESERVED for consumers of these flags. No implementor of this interface should ever return flags with this bit set.


Written by:Ellen Evans | Comments, questions, complaints? Bug 143387
TOC PREV NEXT INDEX