2001-09-26 04:40:45 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-05-03 03:04:35 +04:00
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsILanguageAtomService.h"
|
2002-06-23 20:05:35 +04:00
|
|
|
#include "nsIStringBundle.h"
|
2004-06-09 03:53:59 +04:00
|
|
|
#include "nsInterfaceHashtable.h"
|
|
|
|
#include "nsIAtom.h"
|
2016-04-06 06:31:38 +03:00
|
|
|
#include "nsUConvPropertySearch.h"
|
2012-06-06 06:14:46 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2004-06-09 03:53:59 +04:00
|
|
|
|
|
|
|
#define NS_LANGUAGEATOMSERVICE_CID \
|
2010-02-24 20:57:44 +03:00
|
|
|
{0xB7C65853, 0x2996, 0x435E, {0x96, 0x54, 0xDC, 0xC1, 0x78, 0xAA, 0xB4, 0x8C}}
|
2000-05-03 03:04:35 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsLanguageAtomService final : public nsILanguageAtomService
|
2000-05-03 03:04:35 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2004-06-09 03:53:59 +04:00
|
|
|
// nsILanguageAtomService
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsIAtom*
|
2015-03-21 19:28:04 +03:00
|
|
|
LookupLanguage(const nsACString &aLanguage, nsresult *aError) override;
|
2004-06-09 03:53:59 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual already_AddRefed<nsIAtom>
|
2015-03-21 19:28:04 +03:00
|
|
|
LookupCharSet(const nsACString& aCharSet) override;
|
2000-05-03 03:04:35 +04:00
|
|
|
|
2017-03-13 06:39:22 +03:00
|
|
|
virtual nsIAtom* GetLocaleLanguage() override;
|
2010-02-24 20:57:44 +03:00
|
|
|
|
2017-04-04 21:11:27 +03:00
|
|
|
virtual nsIAtom* GetLanguageGroup(nsIAtom* aLanguage,
|
|
|
|
nsresult* aError) override;
|
|
|
|
virtual already_AddRefed<nsIAtom> GetUncachedLanguageGroup(nsIAtom* aLanguage,
|
|
|
|
nsresult* aError) const final;
|
2000-05-03 03:04:35 +04:00
|
|
|
|
2014-06-02 16:08:24 +04:00
|
|
|
nsLanguageAtomService();
|
2004-06-09 03:53:59 +04:00
|
|
|
|
|
|
|
private:
|
2014-06-02 16:08:29 +04:00
|
|
|
~nsLanguageAtomService() { }
|
2000-05-03 03:04:35 +04:00
|
|
|
|
|
|
|
protected:
|
2010-02-24 20:57:44 +03:00
|
|
|
nsInterfaceHashtable<nsISupportsHashKey, nsIAtom> mLangToGroup;
|
|
|
|
nsCOMPtr<nsIAtom> mLocaleLanguage;
|
2000-05-03 03:04:35 +04:00
|
|
|
};
|