Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
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 | #include "nsCOMPtr.h" |
michael@0 | 7 | #include "nsICharsetConverterManager.h" |
michael@0 | 8 | #include "nsILanguageAtomService.h" |
michael@0 | 9 | #include "nsIStringBundle.h" |
michael@0 | 10 | #include "nsInterfaceHashtable.h" |
michael@0 | 11 | #include "nsIAtom.h" |
michael@0 | 12 | #include "mozilla/Attributes.h" |
michael@0 | 13 | |
michael@0 | 14 | #define NS_LANGUAGEATOMSERVICE_CID \ |
michael@0 | 15 | {0xB7C65853, 0x2996, 0x435E, {0x96, 0x54, 0xDC, 0xC1, 0x78, 0xAA, 0xB4, 0x8C}} |
michael@0 | 16 | |
michael@0 | 17 | class nsLanguageAtomService MOZ_FINAL : public nsILanguageAtomService |
michael@0 | 18 | { |
michael@0 | 19 | public: |
michael@0 | 20 | NS_DECL_ISUPPORTS |
michael@0 | 21 | |
michael@0 | 22 | // nsILanguageAtomService |
michael@0 | 23 | virtual NS_HIDDEN_(nsIAtom*) |
michael@0 | 24 | LookupLanguage(const nsACString &aLanguage, nsresult *aError); |
michael@0 | 25 | |
michael@0 | 26 | virtual NS_HIDDEN_(already_AddRefed<nsIAtom>) |
michael@0 | 27 | LookupCharSet(const char *aCharSet, nsresult *aError); |
michael@0 | 28 | |
michael@0 | 29 | virtual NS_HIDDEN_(nsIAtom*) GetLocaleLanguage(nsresult *aError); |
michael@0 | 30 | |
michael@0 | 31 | virtual NS_HIDDEN_(nsIAtom*) GetLanguageGroup(nsIAtom *aLanguage, |
michael@0 | 32 | nsresult *aError); |
michael@0 | 33 | |
michael@0 | 34 | nsLanguageAtomService() NS_HIDDEN; |
michael@0 | 35 | |
michael@0 | 36 | private: |
michael@0 | 37 | NS_HIDDEN ~nsLanguageAtomService() { } |
michael@0 | 38 | |
michael@0 | 39 | protected: |
michael@0 | 40 | NS_HIDDEN_(nsresult) InitLangGroupTable(); |
michael@0 | 41 | |
michael@0 | 42 | nsCOMPtr<nsICharsetConverterManager> mCharSets; |
michael@0 | 43 | nsInterfaceHashtable<nsISupportsHashKey, nsIAtom> mLangToGroup; |
michael@0 | 44 | nsCOMPtr<nsIStringBundle> mLangGroups; |
michael@0 | 45 | nsCOMPtr<nsIAtom> mLocaleLanguage; |
michael@0 | 46 | }; |