nsILanguageAtomService.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef nsILanguageAtomService_h_
  7. #define nsILanguageAtomService_h_
  8. /*
  9. * The nsILanguageAtomService provides a mapping from languages or charsets
  10. * to language groups, and access to the system locale language.
  11. */
  12. #include "nsISupports.h"
  13. #include "nsCOMPtr.h"
  14. #include "nsIAtom.h"
  15. #define NS_ILANGUAGEATOMSERVICE_IID \
  16. {0xcb3892a0, 0x6a76, 0x461c, \
  17. { 0xb0, 0x24, 0x23, 0x0e, 0xe3, 0xe0, 0x81, 0x1a }}
  18. #define NS_LANGUAGEATOMSERVICE_CONTRACTID \
  19. "@mozilla.org/intl/nslanguageatomservice;1"
  20. class nsILanguageAtomService : public nsISupports
  21. {
  22. public:
  23. NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID)
  24. virtual nsIAtom* LookupLanguage(const nsACString &aLanguage,
  25. nsresult *aError = nullptr) = 0;
  26. virtual already_AddRefed<nsIAtom>
  27. LookupCharSet(const nsACString& aCharSet) = 0;
  28. virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nullptr) = 0;
  29. virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage,
  30. nsresult *aError = nullptr) = 0;
  31. };
  32. NS_DEFINE_STATIC_IID_ACCESSOR(nsILanguageAtomService,
  33. NS_ILANGUAGEATOMSERVICE_IID)
  34. #endif