|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 |
|
9 /** |
|
10 * Provides information about a specific implementation class. If you want |
|
11 * your class to implement nsIClassInfo, see nsIClassInfoImpl.h for |
|
12 * instructions--you most likely do not want to inherit from nsIClassInfo. |
|
13 */ |
|
14 |
|
15 [scriptable, uuid(986c11d0-f340-11d4-9075-0010a4e73d9a)] |
|
16 interface nsIClassInfo : nsISupports |
|
17 { |
|
18 /** |
|
19 * Get an ordered list of the interface ids that instances of the class |
|
20 * promise to implement. Note that nsISupports is an implicit member |
|
21 * of any such list and need not be included. |
|
22 * |
|
23 * Should set *count = 0 and *array = null and return NS_OK if getting the |
|
24 * list is not supported. |
|
25 */ |
|
26 void getInterfaces(out uint32_t count, |
|
27 [array, size_is(count), retval] out nsIIDPtr array); |
|
28 |
|
29 /** |
|
30 * Get a language mapping specific helper object that may assist in using |
|
31 * objects of this class in a specific lanaguage. For instance, if asked |
|
32 * for the helper for nsIProgrammingLanguage::JAVASCRIPT this might return |
|
33 * an object that can be QI'd into the nsIXPCScriptable interface to assist |
|
34 * XPConnect in supplying JavaScript specific behavior to callers of the |
|
35 * instance object. |
|
36 * |
|
37 * see: nsIProgrammingLanguage.idl |
|
38 * |
|
39 * Should return null if no helper available for given language. |
|
40 */ |
|
41 nsISupports getHelperForLanguage(in uint32_t language); |
|
42 |
|
43 /** |
|
44 * A contract ID through which an instance of this class can be created |
|
45 * (or accessed as a service, if |flags & SINGLETON|), or null. |
|
46 */ |
|
47 readonly attribute string contractID; |
|
48 |
|
49 /** |
|
50 * A human readable string naming the class, or null. |
|
51 */ |
|
52 readonly attribute string classDescription; |
|
53 |
|
54 /** |
|
55 * A class ID through which an instance of this class can be created |
|
56 * (or accessed as a service, if |flags & SINGLETON|), or null. |
|
57 */ |
|
58 readonly attribute nsCIDPtr classID; |
|
59 |
|
60 /** |
|
61 * Return language type from list in nsIProgrammingLanguage |
|
62 */ |
|
63 |
|
64 readonly attribute uint32_t implementationLanguage; |
|
65 |
|
66 /** |
|
67 * Bitflags for 'flags' attribute. |
|
68 */ |
|
69 const uint32_t SINGLETON = 1 << 0; |
|
70 const uint32_t THREADSAFE = 1 << 1; |
|
71 const uint32_t MAIN_THREAD_ONLY = 1 << 2; |
|
72 const uint32_t DOM_OBJECT = 1 << 3; |
|
73 const uint32_t PLUGIN_OBJECT = 1 << 4; |
|
74 const uint32_t SINGLETON_CLASSINFO = 1 << 5; |
|
75 |
|
76 /** |
|
77 * 'flags' attribute bitflag: whether objects of this type implement |
|
78 * nsIContent. |
|
79 */ |
|
80 const uint32_t CONTENT_NODE = 1 << 6; |
|
81 |
|
82 // The high order bit is RESERVED for consumers of these flags. |
|
83 // No implementor of this interface should ever return flags |
|
84 // with this bit set. |
|
85 const uint32_t RESERVED = 1 << 31; |
|
86 |
|
87 |
|
88 readonly attribute uint32_t flags; |
|
89 |
|
90 /** |
|
91 * Also a class ID through which an instance of this class can be created |
|
92 * (or accessed as a service, if |flags & SINGLETON|). If the class does |
|
93 * not have a CID, it should return NS_ERROR_NOT_AVAILABLE. This attribute |
|
94 * exists so C++ callers can avoid allocating and freeing a CID, as would |
|
95 * happen if they used classID. |
|
96 */ |
|
97 [noscript] readonly attribute nsCID classIDNoAlloc; |
|
98 |
|
99 }; |