Confirmed users, Bureaucrats and Sysops emeriti
419
edits
| Line 34: | Line 34: | ||
typedef PRUint32 nsDISPID; | typedef PRUint32 nsDISPID; | ||
[scriptable, uuid(...)] | [scriptable, uuid(...)] | ||
interface nsIScriptable : nsISupports | interface nsIScriptable : nsISupports | ||
| Line 41: | Line 41: | ||
// be used on subsequent calls to invoke() | // be used on subsequent calls to invoke() | ||
nsDISPID getDispID(in AString aName); | nsDISPID getDispID(in AString aName); | ||
// Deletes a member by DISPID. | // Deletes a member by DISPID. | ||
deleteMemberByDispID(in nsDISPID aDispID); | deleteMemberByDispID(in nsDISPID aDispID); | ||
// Deletes a member by name. | // Deletes a member by name. | ||
deleteMemberByName(in AString aName); | deleteMemberByName(in AString aName); | ||
// Retrieves the name of a member. | // Retrieves the name of a member. | ||
AString getMemberName(in nsDISPID aDispID); | AString getMemberName(in nsDISPID aDispID); | ||
// Retrieves a member's properties. | // Retrieves a member's properties. | ||
PRUint32 getMemberFlags(in nsDISPID aDispID); | PRUint32 getMemberFlags(in nsDISPID aDispID); | ||
// Flags describing members. | // Flags describing members. | ||
const PRUint32 MEMBER_METHOD = 1; // member is a method | const PRUint32 MEMBER_METHOD = 1; // member is a method | ||
| Line 59: | Line 59: | ||
const PRUint32 MEMBER_ATTRIBUTE = 4; // member is an attribute | const PRUint32 MEMBER_ATTRIBUTE = 4; // member is an attribute | ||
const PRUint32 MEMBER_READONLY = 8; // member is readonly | const PRUint32 MEMBER_READONLY = 8; // member is readonly | ||
// Retrieves the interface for the scope parent of an object. | // Retrieves the interface for the scope parent of an object. | ||
nsIScriptable getParentObject(); | nsIScriptable getParentObject(); | ||
// Enumerates the members of the object. | // Enumerates the members of the object. | ||
nsDISPID getNextDispID(in PRUint32 aFlags, in nsDISPID aDispID); | nsDISPID getNextDispID(in PRUint32 aFlags, in nsDISPID aDispID); | ||
// Invoke a method or access an attribute exposed by an IScriptable. | // Invoke a method or access an attribute exposed by an IScriptable. | ||
// XXX - semantics of DISPID and params is not clear. | // XXX - semantics of DISPID and params is not clear. | ||
// presumably all possible param names must also provide | // presumably all possible param names must also provide | ||
// a dispid when asked. | // a dispid when asked. | ||
// MSCOM EXCEPTINFO param not used - existing | // MSCOM EXCEPTINFO param not used - existing | ||
// nsIExceptionService semantics should be used instead. | // nsIExceptionService semantics should be used instead. | ||
nsIVariant invoke(in nsDISPID aDispID, | nsIVariant invoke(in nsDISPID aDispID, | ||
in PRUint32 aInvokeHow, | in PRUint32 aInvokeHow, | ||
| Line 82: | Line 82: | ||
in PRUint32 aNumNamedArgs, | in PRUint32 aNumNamedArgs, | ||
out nsIVariant aResult); | out nsIVariant aResult); | ||
// Values for the aInvokeHow argument to invoke. | // Values for the aInvokeHow argument to invoke. | ||
const PRUint32 INVOKE_CALL = 0; // invoke as a method | const PRUint32 INVOKE_CALL = 0; // invoke as a method | ||
| Line 88: | Line 88: | ||
const PRUint32 INVOKE_GETATTR = 2; // get an attribute value | const PRUint32 INVOKE_GETATTR = 2; // get an attribute value | ||
const PRUint32 INVOKE_SETATTR = 3; // set an attribute value | const PRUint32 INVOKE_SETATTR = 3; // set an attribute value | ||
// Predefined nsDISPID values | // Predefined nsDISPID values | ||
... | ... | ||