|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef nsILanguageAtomService_h_ |
|
8 #define nsILanguageAtomService_h_ |
|
9 |
|
10 /* |
|
11 * The nsILanguageAtomService provides a mapping from languages or charsets |
|
12 * to language groups, and access to the system locale language. |
|
13 */ |
|
14 |
|
15 #include "nsISupports.h" |
|
16 #include "nsCOMPtr.h" |
|
17 #include "nsIAtom.h" |
|
18 |
|
19 #define NS_ILANGUAGEATOMSERVICE_IID \ |
|
20 {0xAF4C48CF, 0x8F76, 0x4477, \ |
|
21 { 0xA7, 0x0E, 0xAB, 0x09, 0x74, 0xE2, 0x41, 0xF0 }} |
|
22 |
|
23 #define NS_LANGUAGEATOMSERVICE_CONTRACTID \ |
|
24 "@mozilla.org/intl/nslanguageatomservice;1" |
|
25 |
|
26 class nsILanguageAtomService : public nsISupports |
|
27 { |
|
28 public: |
|
29 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID) |
|
30 |
|
31 virtual nsIAtom* LookupLanguage(const nsACString &aLanguage, |
|
32 nsresult *aError = nullptr) = 0; |
|
33 virtual already_AddRefed<nsIAtom> |
|
34 LookupCharSet(const char *aCharSet, nsresult *aError = nullptr) = 0; |
|
35 |
|
36 virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nullptr) = 0; |
|
37 |
|
38 virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage, |
|
39 nsresult *aError = nullptr) = 0; |
|
40 }; |
|
41 |
|
42 NS_DEFINE_STATIC_IID_ACCESSOR(nsILanguageAtomService, |
|
43 NS_ILANGUAGEATOMSERVICE_IID) |
|
44 |
|
45 #endif |