|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /* The nsIInterfaceInfo public declaration. */ |
|
7 |
|
8 |
|
9 #include "nsISupports.idl" |
|
10 |
|
11 // forward declaration of non-XPCOM types |
|
12 |
|
13 [ptr] native nsXPTMethodInfoPtr(nsXPTMethodInfo); |
|
14 [ptr] native nsXPTConstantPtr(nsXPTConstant); |
|
15 [ptr] native nsXPTParamInfoPtr(nsXPTParamInfo); |
|
16 native nsXPTType(nsXPTType); |
|
17 |
|
18 // We bend the rules to do a [shared] nsIID (but this is never scriptable) |
|
19 [ptr] native nsIIDPtrShared(nsIID); |
|
20 |
|
21 %{C++ |
|
22 class nsXPTMethodInfo; |
|
23 class nsXPTConstant; |
|
24 class nsXPTParamInfo; |
|
25 class nsXPTType; |
|
26 %} |
|
27 |
|
28 /* this is NOT intended to be scriptable */ |
|
29 [uuid(1affa260-8965-4612-869a-78af4ccfb287)] |
|
30 interface nsIInterfaceInfo : nsISupports |
|
31 { |
|
32 readonly attribute string name; |
|
33 readonly attribute nsIIDPtr InterfaceIID; |
|
34 |
|
35 boolean isScriptable(); |
|
36 boolean isBuiltinClass(); |
|
37 |
|
38 readonly attribute nsIInterfaceInfo parent; |
|
39 |
|
40 /** |
|
41 * These include counts for parent (and all ancestors). |
|
42 */ |
|
43 readonly attribute uint16_t methodCount; |
|
44 readonly attribute uint16_t constantCount; |
|
45 |
|
46 /** |
|
47 * These include methods and constants for parent (and all ancestors). |
|
48 * |
|
49 * These do *not* make copies ***explicit bending of XPCOM rules***. |
|
50 */ |
|
51 |
|
52 void getMethodInfo(in uint16_t index, |
|
53 [shared, retval] out nsXPTMethodInfoPtr info); |
|
54 |
|
55 void getMethodInfoForName(in string methodName, out uint16_t index, |
|
56 [shared, retval] out nsXPTMethodInfoPtr info); |
|
57 |
|
58 void getConstant(in uint16_t index, |
|
59 [shared, retval] out nsXPTConstantPtr constant); |
|
60 |
|
61 |
|
62 /** |
|
63 * Get the interface information or iid associated with a param of some |
|
64 * method in this interface. |
|
65 */ |
|
66 |
|
67 nsIInterfaceInfo getInfoForParam(in uint16_t methodIndex, |
|
68 [const] in nsXPTParamInfoPtr param); |
|
69 |
|
70 nsIIDPtr getIIDForParam(in uint16_t methodIndex, |
|
71 [const] in nsXPTParamInfoPtr param); |
|
72 |
|
73 |
|
74 /** |
|
75 * These do *not* make copies ***explicit bending of XPCOM rules***. |
|
76 */ |
|
77 |
|
78 nsXPTType getTypeForParam(in uint16_t methodIndex, |
|
79 [const] in nsXPTParamInfoPtr param, |
|
80 in uint16_t dimension); |
|
81 |
|
82 uint8_t getSizeIsArgNumberForParam(in uint16_t methodIndex, |
|
83 [const] in nsXPTParamInfoPtr param, |
|
84 in uint16_t dimension); |
|
85 |
|
86 uint8_t getInterfaceIsArgNumberForParam(in uint16_t methodIndex, |
|
87 [const] in nsXPTParamInfoPtr param); |
|
88 |
|
89 boolean isIID(in nsIIDPtr IID); |
|
90 |
|
91 void getNameShared([shared,retval] out string name); |
|
92 void getIIDShared([shared,retval] out nsIIDPtrShared iid); |
|
93 |
|
94 boolean isFunction(); |
|
95 |
|
96 boolean hasAncestor(in nsIIDPtr iid); |
|
97 |
|
98 [notxpcom] nsresult getIIDForParamNoAlloc(in uint16_t methodIndex, |
|
99 [const] in nsXPTParamInfoPtr param, |
|
100 out nsIID iid); |
|
101 }; |
|
102 |