Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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/. */
7 #ifndef nsILanguageAtomService_h_
8 #define nsILanguageAtomService_h_
10 /*
11 * The nsILanguageAtomService provides a mapping from languages or charsets
12 * to language groups, and access to the system locale language.
13 */
15 #include "nsISupports.h"
16 #include "nsCOMPtr.h"
17 #include "nsIAtom.h"
19 #define NS_ILANGUAGEATOMSERVICE_IID \
20 {0xAF4C48CF, 0x8F76, 0x4477, \
21 { 0xA7, 0x0E, 0xAB, 0x09, 0x74, 0xE2, 0x41, 0xF0 }}
23 #define NS_LANGUAGEATOMSERVICE_CONTRACTID \
24 "@mozilla.org/intl/nslanguageatomservice;1"
26 class nsILanguageAtomService : public nsISupports
27 {
28 public:
29 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID)
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;
36 virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nullptr) = 0;
38 virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage,
39 nsresult *aError = nullptr) = 0;
40 };
42 NS_DEFINE_STATIC_IID_ACCESSOR(nsILanguageAtomService,
43 NS_ILANGUAGEATOMSERVICE_IID)
45 #endif