Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 : #include "mozilla/ModuleUtils.h"
7 :
8 : #include "nsCOMPtr.h"
9 :
10 : #include "nspr.h"
11 : #include "nsString.h"
12 : #include "nsUniversalCharDetDll.h"
13 : #include "nsISupports.h"
14 : #include "nsICategoryManager.h"
15 : #include "nsIComponentManager.h"
16 : #include "nsIServiceManager.h"
17 : #include "nsICharsetDetector.h"
18 : #include "nsIStringCharsetDetector.h"
19 :
20 : #include "nsUniversalDetector.h"
21 : #include "nsUdetXPCOMWrapper.h"
22 :
23 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAPSMDetector)
24 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAStringPSMDetector)
25 : NS_DEFINE_NAMED_CID(NS_JA_PSMDETECTOR_CID);
26 : NS_DEFINE_NAMED_CID(NS_JA_STRING_PSMDETECTOR_CID);
27 :
28 : static const mozilla::Module::CIDEntry kChardetCIDs[] = {
29 : { &kNS_JA_PSMDETECTOR_CID, false, nullptr, nsJAPSMDetectorConstructor },
30 : { &kNS_JA_STRING_PSMDETECTOR_CID, false, nullptr, nsJAStringPSMDetectorConstructor },
31 : { nullptr }
32 : };
33 :
34 : static const mozilla::Module::ContractIDEntry kChardetContracts[] = {
35 : { NS_CHARSET_DETECTOR_CONTRACTID_BASE "ja_parallel_state_machine", &kNS_JA_PSMDETECTOR_CID },
36 : { NS_STRCDETECTOR_CONTRACTID_BASE "ja_parallel_state_machine", &kNS_JA_STRING_PSMDETECTOR_CID },
37 : { nullptr }
38 : };
39 :
40 : static const mozilla::Module::CategoryEntry kChardetCategories[] = {
41 : { NS_CHARSET_DETECTOR_CATEGORY, "ja_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "ja_parallel_state_machine" },
42 : { nullptr }
43 : };
44 :
45 : static const mozilla::Module kChardetModule = {
46 : mozilla::Module::kVersion,
47 : kChardetCIDs,
48 : kChardetContracts,
49 : kChardetCategories
50 : };
51 :
52 : NSMODULE_DEFN(nsUniversalCharDetModule) = &kChardetModule;
|