summaryrefslogtreecommitdiffstats
path: root/xpcom/reflect/xptinfo/nsIInterfaceInfo.idl
blob: 8b902d5ee3fefa68e50255020c91223864f2a965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* The nsIInterfaceInfo public declaration. */


#include "nsISupports.idl"

// forward declaration of non-XPCOM types

[ptr] native nsXPTMethodInfoPtr(nsXPTMethodInfo);
[ptr] native nsXPTParamInfoPtr(nsXPTParamInfo);
      native nsXPTType(nsXPTType);

// We bend the rules to do a [shared] nsIID (but this is never scriptable)
[ptr] native nsIIDPtrShared(nsIID);

%{C++
class nsXPTMethodInfo;
class nsXPTParamInfo;
class nsXPTType;
%}

[builtinclass, uuid(3820e663-8e22-4789-b470-56bcf7083f2b)]
interface nsIInterfaceInfo : nsISupports
{
    readonly attribute string   name;
    readonly attribute nsIIDPtr InterfaceIID;

    boolean isScriptable();
    boolean isBuiltinClass();

    readonly attribute nsIInterfaceInfo parent;

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

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

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

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

    void getConstant(in uint16_t index,
                     out jsval constant,
                     out string name);


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

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

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


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

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

    uint8_t getSizeIsArgNumberForParam(in uint16_t methodIndex,
                                       [const] in nsXPTParamInfoPtr param,
                                       in uint16_t dimension);

    uint8_t getInterfaceIsArgNumberForParam(in uint16_t methodIndex,
                                            [const] in nsXPTParamInfoPtr param);

    boolean isIID(in nsIIDPtr IID);

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

    boolean isFunction();

    boolean hasAncestor(in nsIIDPtr iid);

    [notxpcom] nsresult getIIDForParamNoAlloc(in uint16_t methodIndex,
                                              [const] in nsXPTParamInfoPtr param,
                                              out nsIID iid);

    boolean isMainProcessScriptableOnly();
};