Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | |
michael@0 | 7 | #include "mozilla/ModuleUtils.h" |
michael@0 | 8 | #include "mozHunspell.h" |
michael@0 | 9 | #include "mozHunspellDirProvider.h" |
michael@0 | 10 | #include "mozSpellChecker.h" |
michael@0 | 11 | #include "mozInlineSpellChecker.h" |
michael@0 | 12 | #include "nsTextServicesCID.h" |
michael@0 | 13 | #include "mozPersonalDictionary.h" |
michael@0 | 14 | #include "mozSpellI18NManager.h" |
michael@0 | 15 | #include "nsIFile.h" |
michael@0 | 16 | |
michael@0 | 17 | #define NS_SPELLCHECKER_CID \ |
michael@0 | 18 | { /* 8227f019-afc7-461e-b030-9f185d7a0e29 */ \ |
michael@0 | 19 | 0x8227F019, 0xAFC7, 0x461e, \ |
michael@0 | 20 | { 0xB0, 0x30, 0x9F, 0x18, 0x5D, 0x7A, 0x0E, 0x29} } |
michael@0 | 21 | |
michael@0 | 22 | #define MOZ_INLINESPELLCHECKER_CID \ |
michael@0 | 23 | { /* 9FE5D975-09BD-44aa-A01A-66402EA28657 */ \ |
michael@0 | 24 | 0x9fe5d975, 0x9bd, 0x44aa, \ |
michael@0 | 25 | { 0xa0, 0x1a, 0x66, 0x40, 0x2e, 0xa2, 0x86, 0x57} } |
michael@0 | 26 | |
michael@0 | 27 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozHunspell, Init) |
michael@0 | 28 | NS_GENERIC_FACTORY_CONSTRUCTOR(mozHunspellDirProvider) |
michael@0 | 29 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozSpellChecker, Init) |
michael@0 | 30 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozPersonalDictionary, Init) |
michael@0 | 31 | NS_GENERIC_FACTORY_CONSTRUCTOR(mozSpellI18NManager) |
michael@0 | 32 | NS_GENERIC_FACTORY_CONSTRUCTOR(mozInlineSpellChecker) |
michael@0 | 33 | |
michael@0 | 34 | NS_DEFINE_NAMED_CID(MOZ_HUNSPELL_CID); |
michael@0 | 35 | NS_DEFINE_NAMED_CID(HUNSPELLDIRPROVIDER_CID); |
michael@0 | 36 | NS_DEFINE_NAMED_CID(NS_SPELLCHECKER_CID); |
michael@0 | 37 | NS_DEFINE_NAMED_CID(MOZ_PERSONALDICTIONARY_CID); |
michael@0 | 38 | NS_DEFINE_NAMED_CID(MOZ_SPELLI18NMANAGER_CID); |
michael@0 | 39 | NS_DEFINE_NAMED_CID(MOZ_INLINESPELLCHECKER_CID); |
michael@0 | 40 | |
michael@0 | 41 | static const mozilla::Module::CIDEntry kSpellcheckCIDs[] = { |
michael@0 | 42 | { &kMOZ_HUNSPELL_CID, false, nullptr, mozHunspellConstructor }, |
michael@0 | 43 | { &kHUNSPELLDIRPROVIDER_CID, false, nullptr, mozHunspellDirProviderConstructor }, |
michael@0 | 44 | { &kNS_SPELLCHECKER_CID, false, nullptr, mozSpellCheckerConstructor }, |
michael@0 | 45 | { &kMOZ_PERSONALDICTIONARY_CID, false, nullptr, mozPersonalDictionaryConstructor }, |
michael@0 | 46 | { &kMOZ_SPELLI18NMANAGER_CID, false, nullptr, mozSpellI18NManagerConstructor }, |
michael@0 | 47 | { &kMOZ_INLINESPELLCHECKER_CID, false, nullptr, mozInlineSpellCheckerConstructor }, |
michael@0 | 48 | { nullptr } |
michael@0 | 49 | }; |
michael@0 | 50 | |
michael@0 | 51 | static const mozilla::Module::ContractIDEntry kSpellcheckContracts[] = { |
michael@0 | 52 | { MOZ_HUNSPELL_CONTRACTID, &kMOZ_HUNSPELL_CID }, |
michael@0 | 53 | { mozHunspellDirProvider::kContractID, &kHUNSPELLDIRPROVIDER_CID }, |
michael@0 | 54 | { NS_SPELLCHECKER_CONTRACTID, &kNS_SPELLCHECKER_CID }, |
michael@0 | 55 | { MOZ_PERSONALDICTIONARY_CONTRACTID, &kMOZ_PERSONALDICTIONARY_CID }, |
michael@0 | 56 | { MOZ_SPELLI18NMANAGER_CONTRACTID, &kMOZ_SPELLI18NMANAGER_CID }, |
michael@0 | 57 | { MOZ_INLINESPELLCHECKER_CONTRACTID, &kMOZ_INLINESPELLCHECKER_CID }, |
michael@0 | 58 | { nullptr } |
michael@0 | 59 | }; |
michael@0 | 60 | |
michael@0 | 61 | static const mozilla::Module::CategoryEntry kSpellcheckCategories[] = { |
michael@0 | 62 | { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "spellcheck-directory-provider", mozHunspellDirProvider::kContractID }, |
michael@0 | 63 | { nullptr } |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | const mozilla::Module kSpellcheckModule = { |
michael@0 | 67 | mozilla::Module::kVersion, |
michael@0 | 68 | kSpellcheckCIDs, |
michael@0 | 69 | kSpellcheckContracts, |
michael@0 | 70 | kSpellcheckCategories |
michael@0 | 71 | }; |
michael@0 | 72 | |
michael@0 | 73 | NSMODULE_DEFN(mozSpellCheckerModule) = &kSpellcheckModule; |