nsIClassInfo 编辑

xpcom/components/nsIClassInfo.idlScriptable Provides information about a specific implementation class. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Method overview

nsISupports getHelperForLanguage(in PRUint32 language);
void getInterfaces(out PRUint32 count, [array, size_is(count), retval] out nsIIDPtr array);

Attributes

AttributeTypeDescription
classDescriptionstringA human readable string naming the class, or null. Read only.
classIDnsCIDPtrA classID through which an instance of this class can be created, or null. If the flags attribute has the SINGLETON bit set, then the value of this attribute specifies a ClassID through which this class can be accessed as a service using nsIServiceManager.getService(). Read only.
classIDNoAllocnsCID

A classID through which an instance of this class can be created, or null. If the flags attribute has the SINGLETON bit set, then the value of this attribute specifies a ClassID through which this class can be accessed as a service using nsIServiceManager.getService().

This attribute is similar to the classID attribute; however, this attribute exists so that C++ callers can avoid allocating and freeing a nsCID object, as would happen if they used classID. Read only. Violates the XPCOM interface guidelines

Exceptions thrown
NS_ERROR_NOT_AVAILABLE
If the class does not have a ClassID
contractIDstringA contractID through which an instance of this class can be created, or null. If the flags attribute has the SINGLETON bit set, then the value of this attribute specifies a ContractID through which this class may be accessed as a service using nsIServiceManager.getServiceByContractID(). Read only.
flagsPRUint32Specifies various binary properties of this class. Possible values for this attribute include a bit-wise combination of the constants Read only.
implementationLanguage Obsolete since Gecko 40PRUint32The language type in which this class is implemented. See nsIProgrammingLanguage.Constants for a list of possible values. Read only.

Constants

Bitflags for 'flags' attribute.

ConstantValueDescription
SINGLETON1 << 0The class is a singleton that must be accessed via nsIServiceManager.
THREADSAFE1 << 1The class may be accessed by any thread.
MAIN_THREAD_ONLY1 << 2The class may only be accessed by the main application thread.
DOM_OBJECT1 << 3The class is a DOM object.
PLUGIN_OBJECT1 << 4The class is a plugin object.
CONTENT_NODE1 << 6

Specifies that this class implements nsIContent.

Note: This flag is private and is for use by the Mozilla codebase only.
RESERVED1 << 31The high order bit is RESERVED for consumers of these flags. No implementor of this interface should ever return flags with this bit set.
EAGER_CLASSINFO1 << 5This flag is designed for use with nsGenericFactory and can be set in nsModuleComponentInfo::mFlags. It has no meaning when returned from the flags attribute of a nsIClassInfo implementation. Obsolete since Gecko 2.0

Methods

getHelperForLanguage()

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

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

nsISupports getHelperForLanguage(
  in PRUint32 language
);
Parameters
language
This parameter selects the language mapping specific helper object to be returned. nsIProgrammingLanguage defines language identifiers that may be passed for this parameter.
Return value

Should return null if no helper available for given language.

getInterfaces()

This method returns an ordered list of interfaces IIDs that instances of the class promise to implement.

Note that nsISupports is an implicit member of the implemented set of interfaces and need not be included.

If this method is not supported by an implementation, then it should return 0 for count and null for array.

void getInterfaces(
  out PRUint32 count,
  [array, size_is(count), retval] out nsIIDPtr array
);
Parameters
count
The length of the resulting array.
array
The resulting array of nsIIDPtr values.

Remarks

This interface was finalized (frozen) for Gecko 0.9.6. See bug 99158 for details. From Gecko 2.0 interfaces are no longer frozen.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:70 次

字数:9756

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文