|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsIClassInfoImpl.h" |
|
6 #include "nsIProgrammingLanguage.h" |
|
7 |
|
8 NS_IMETHODIMP_(MozExternalRefCountType) |
|
9 GenericClassInfo::AddRef() |
|
10 { |
|
11 return 2; |
|
12 } |
|
13 |
|
14 NS_IMETHODIMP_(MozExternalRefCountType) |
|
15 GenericClassInfo::Release() |
|
16 { |
|
17 return 1; |
|
18 } |
|
19 |
|
20 NS_IMPL_QUERY_INTERFACE(GenericClassInfo, nsIClassInfo) |
|
21 |
|
22 NS_IMETHODIMP |
|
23 GenericClassInfo::GetInterfaces(uint32_t* countp, nsIID*** array) |
|
24 { |
|
25 return mData->getinterfaces(countp, array); |
|
26 } |
|
27 |
|
28 NS_IMETHODIMP |
|
29 GenericClassInfo::GetHelperForLanguage(uint32_t language, nsISupports** helper) |
|
30 { |
|
31 if (mData->getlanguagehelper) |
|
32 return mData->getlanguagehelper(language, helper); |
|
33 return NS_ERROR_NOT_IMPLEMENTED; |
|
34 } |
|
35 |
|
36 NS_IMETHODIMP |
|
37 GenericClassInfo::GetContractID(char** contractid) |
|
38 { |
|
39 NS_ERROR("GetContractID not implemented"); |
|
40 *contractid = nullptr; |
|
41 return NS_ERROR_NOT_IMPLEMENTED; |
|
42 } |
|
43 |
|
44 NS_IMETHODIMP |
|
45 GenericClassInfo::GetClassDescription(char** description) |
|
46 { |
|
47 *description = nullptr; |
|
48 return NS_ERROR_NOT_IMPLEMENTED; |
|
49 } |
|
50 |
|
51 NS_IMETHODIMP |
|
52 GenericClassInfo::GetClassID(nsCID** classid) |
|
53 { |
|
54 NS_ERROR("GetClassID not implemented"); |
|
55 *classid = nullptr; |
|
56 return NS_ERROR_NOT_IMPLEMENTED; |
|
57 } |
|
58 |
|
59 NS_IMETHODIMP |
|
60 GenericClassInfo::GetImplementationLanguage(uint32_t* language) |
|
61 { |
|
62 *language = nsIProgrammingLanguage::CPLUSPLUS; |
|
63 return NS_OK; |
|
64 } |
|
65 |
|
66 NS_IMETHODIMP |
|
67 GenericClassInfo::GetFlags(uint32_t* flags) |
|
68 { |
|
69 *flags = mData->flags; |
|
70 return NS_OK; |
|
71 } |
|
72 |
|
73 NS_IMETHODIMP |
|
74 GenericClassInfo::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc) |
|
75 { |
|
76 *aClassIDNoAlloc = mData->cid; |
|
77 return NS_OK; |
|
78 } |