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/. */
7 #include "nsILanguageAtomService.h"
8 #include "nsIStringBundle.h"
9 #include "nsInterfaceHashtable.h"
11 #include "mozilla/Attributes.h"
13 #define NS_LANGUAGEATOMSERVICE_CID \
14 {0xB7C65853, 0x2996, 0x435E, {0x96, 0x54, 0xDC, 0xC1, 0x78, 0xAA, 0xB4, 0x8C}}
16 class nsLanguageAtomService MOZ_FINAL
: public nsILanguageAtomService
21 // nsILanguageAtomService
23 LookupLanguage(const nsACString
&aLanguage
, nsresult
*aError
);
25 virtual already_AddRefed
<nsIAtom
>
26 LookupCharSet(const nsACString
& aCharSet
);
28 virtual nsIAtom
* GetLocaleLanguage(nsresult
*aError
);
30 virtual nsIAtom
* GetLanguageGroup(nsIAtom
*aLanguage
,
33 nsLanguageAtomService();
36 ~nsLanguageAtomService() { }
39 nsresult
InitLangGroupTable();
41 nsInterfaceHashtable
<nsISupportsHashKey
, nsIAtom
> mLangToGroup
;
42 nsCOMPtr
<nsIStringBundle
> mLangGroups
;
43 nsCOMPtr
<nsIAtom
> mLocaleLanguage
;