Chinaunix首页 | 论坛 | 博客
  • 博客访问: 667044
  • 博文数量: 137
  • 博客积分: 7000
  • 博客等级: 少将
  • 技术积分: 1335
  • 用 户 组: 普通用户
  • 注册时间: 2005-11-23 15:18
文章分类

全部博文(137)

文章存档

2010年(2)

2009年(2)

2008年(2)

2007年(30)

2006年(99)

2005年(2)

我的朋友

分类: 系统运维

2006-01-25 16:10:11


另外,有个名为nsIInterfaceInfo的接口也使获取接口信息成为可能,而且可能更方便,它的原型为:
[uuid(215DBE04-94A7-11d2-BA58-00805F8A5DD7)]
interface nsIInterfaceInfo : nsISupports
{
readonly attribute string name;
readonly attribute nsIIDPtr InterfaceIID;

PRBool isScriptable();

readonly attribute nsIInterfaceInfo parent;

/**
* These include counts for parent (and all ancestors).
*/
readonly attribute PRUint16 methodCount;
readonly attribute PRUint16 constantCount;

/**
* These include methods and constants for parent (and all ancestors).
*
* These do *not* make copies ***explicit bending of XPCOM rules***.
*/

void getMethodInfo(in PRUint16 index,
[shared, retval] out nsXPTMethodInfoPtr info);

void getMethodInfoForName(in string methodName, out PRUint16 index,
[shared, retval] out nsXPTMethodInfoPtr info);

void getConstant(in PRUint16 index,
[shared, retval] out nsXPTConstantPtr constant);


/**
* Get the interface information or iid associated with a param of some
* method in this interface.
*/

nsIInterfaceInfo getInfoForParam(in PRUint16 methodIndex,
[const] in nsXPTParamInfoPtr param);

nsIIDPtr getIIDForParam(in PRUint16 methodIndex,
[const] in nsXPTParamInfoPtr param);


/**
* These do *not* make copies ***explicit bending of XPCOM rules***.
*/

nsXPTType getTypeForParam(in PRUint16 methodIndex,
[const] in nsXPTParamInfoPtr param,
in PRUint16 dimension);

PRUint8 getSizeIsArgNumberForParam(in PRUint16 methodIndex,
[const] in nsXPTParamInfoPtr param,
in PRUint16 dimension);

PRUint8 getLengthIsArgNumberForParam(in PRUint16 methodIndex,
[const] in nsXPTParamInfoPtr param,
in PRUint16 dimension);

PRUint8 getInterfaceIsArgNumberForParam(in PRUint16 methodIndex,
[const] in nsXPTParamInfoPtr param);

PRBool isIID(in nsIIDPtr IID);

void getNameShared([shared,retval] out string name);
void getIIDShared([shared,retval] out nsIIDPtrShared iid);

PRBool isFunction();

PRBool hasAncestor(in nsIIDPtr iid);

[notxpcom] nsresult getIIDForParamNoAlloc(in PRUint16 methodIndex,
[const] in nsXPTParamInfoPtr param,
out nsIID iid);
};
其实,也就是前面一直说的那个getMethodInfoForName方法的idl接口。
readonly attribute PRUint16 methodCount;
就提供了methodCount

阅读(1312) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~