michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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: #ifndef nsILanguageAtomService_h_ michael@0: #define nsILanguageAtomService_h_ michael@0: michael@0: /* michael@0: * The nsILanguageAtomService provides a mapping from languages or charsets michael@0: * to language groups, and access to the system locale language. michael@0: */ michael@0: michael@0: #include "nsISupports.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIAtom.h" michael@0: michael@0: #define NS_ILANGUAGEATOMSERVICE_IID \ michael@0: {0xAF4C48CF, 0x8F76, 0x4477, \ michael@0: { 0xA7, 0x0E, 0xAB, 0x09, 0x74, 0xE2, 0x41, 0xF0 }} michael@0: michael@0: #define NS_LANGUAGEATOMSERVICE_CONTRACTID \ michael@0: "@mozilla.org/intl/nslanguageatomservice;1" michael@0: michael@0: class nsILanguageAtomService : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID) michael@0: michael@0: virtual nsIAtom* LookupLanguage(const nsACString &aLanguage, michael@0: nsresult *aError = nullptr) = 0; michael@0: virtual already_AddRefed michael@0: LookupCharSet(const char *aCharSet, nsresult *aError = nullptr) = 0; michael@0: michael@0: virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nullptr) = 0; michael@0: michael@0: virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage, michael@0: nsresult *aError = nullptr) = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsILanguageAtomService, michael@0: NS_ILANGUAGEATOMSERVICE_IID) michael@0: michael@0: #endif