1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/locale/public/nsILanguageAtomService.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef nsILanguageAtomService_h_ 1.11 +#define nsILanguageAtomService_h_ 1.12 + 1.13 +/* 1.14 + * The nsILanguageAtomService provides a mapping from languages or charsets 1.15 + * to language groups, and access to the system locale language. 1.16 + */ 1.17 + 1.18 +#include "nsISupports.h" 1.19 +#include "nsCOMPtr.h" 1.20 +#include "nsIAtom.h" 1.21 + 1.22 +#define NS_ILANGUAGEATOMSERVICE_IID \ 1.23 + {0xAF4C48CF, 0x8F76, 0x4477, \ 1.24 + { 0xA7, 0x0E, 0xAB, 0x09, 0x74, 0xE2, 0x41, 0xF0 }} 1.25 + 1.26 +#define NS_LANGUAGEATOMSERVICE_CONTRACTID \ 1.27 + "@mozilla.org/intl/nslanguageatomservice;1" 1.28 + 1.29 +class nsILanguageAtomService : public nsISupports 1.30 +{ 1.31 + public: 1.32 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID) 1.33 + 1.34 + virtual nsIAtom* LookupLanguage(const nsACString &aLanguage, 1.35 + nsresult *aError = nullptr) = 0; 1.36 + virtual already_AddRefed<nsIAtom> 1.37 + LookupCharSet(const char *aCharSet, nsresult *aError = nullptr) = 0; 1.38 + 1.39 + virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nullptr) = 0; 1.40 + 1.41 + virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage, 1.42 + nsresult *aError = nullptr) = 0; 1.43 +}; 1.44 + 1.45 +NS_DEFINE_STATIC_IID_ACCESSOR(nsILanguageAtomService, 1.46 + NS_ILANGUAGEATOMSERVICE_IID) 1.47 + 1.48 +#endif