michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsICharsetConverterManager.h" michael@0: #include "nsILanguageAtomService.h" michael@0: #include "nsIStringBundle.h" michael@0: #include "nsInterfaceHashtable.h" michael@0: #include "nsIAtom.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #define NS_LANGUAGEATOMSERVICE_CID \ michael@0: {0xB7C65853, 0x2996, 0x435E, {0x96, 0x54, 0xDC, 0xC1, 0x78, 0xAA, 0xB4, 0x8C}} michael@0: michael@0: class nsLanguageAtomService MOZ_FINAL : public nsILanguageAtomService michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: // nsILanguageAtomService michael@0: virtual NS_HIDDEN_(nsIAtom*) michael@0: LookupLanguage(const nsACString &aLanguage, nsresult *aError); michael@0: michael@0: virtual NS_HIDDEN_(already_AddRefed) michael@0: LookupCharSet(const char *aCharSet, nsresult *aError); michael@0: michael@0: virtual NS_HIDDEN_(nsIAtom*) GetLocaleLanguage(nsresult *aError); michael@0: michael@0: virtual NS_HIDDEN_(nsIAtom*) GetLanguageGroup(nsIAtom *aLanguage, michael@0: nsresult *aError); michael@0: michael@0: nsLanguageAtomService() NS_HIDDEN; michael@0: michael@0: private: michael@0: NS_HIDDEN ~nsLanguageAtomService() { } michael@0: michael@0: protected: michael@0: NS_HIDDEN_(nsresult) InitLangGroupTable(); michael@0: michael@0: nsCOMPtr mCharSets; michael@0: nsInterfaceHashtable mLangToGroup; michael@0: nsCOMPtr mLangGroups; michael@0: nsCOMPtr mLocaleLanguage; michael@0: };