intl/locale/src/nsLanguageAtomService.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsCOMPtr.h"
     7 #include "nsICharsetConverterManager.h"
     8 #include "nsILanguageAtomService.h"
     9 #include "nsIStringBundle.h"
    10 #include "nsInterfaceHashtable.h"
    11 #include "nsIAtom.h"
    12 #include "mozilla/Attributes.h"
    14 #define NS_LANGUAGEATOMSERVICE_CID \
    15   {0xB7C65853, 0x2996, 0x435E, {0x96, 0x54, 0xDC, 0xC1, 0x78, 0xAA, 0xB4, 0x8C}}
    17 class nsLanguageAtomService MOZ_FINAL : public nsILanguageAtomService
    18 {
    19 public:
    20   NS_DECL_ISUPPORTS
    22   // nsILanguageAtomService
    23   virtual NS_HIDDEN_(nsIAtom*)
    24     LookupLanguage(const nsACString &aLanguage, nsresult *aError);
    26   virtual NS_HIDDEN_(already_AddRefed<nsIAtom>)
    27     LookupCharSet(const char *aCharSet, nsresult *aError);
    29   virtual NS_HIDDEN_(nsIAtom*) GetLocaleLanguage(nsresult *aError);
    31   virtual NS_HIDDEN_(nsIAtom*) GetLanguageGroup(nsIAtom *aLanguage,
    32                                                 nsresult *aError);
    34   nsLanguageAtomService() NS_HIDDEN;
    36 private:
    37   NS_HIDDEN ~nsLanguageAtomService() { }
    39 protected:
    40   NS_HIDDEN_(nsresult) InitLangGroupTable();
    42   nsCOMPtr<nsICharsetConverterManager> mCharSets;
    43   nsInterfaceHashtable<nsISupportsHashKey, nsIAtom> mLangToGroup;
    44   nsCOMPtr<nsIStringBundle> mLangGroups;
    45   nsCOMPtr<nsIAtom> mLocaleLanguage;
    46 };

mercurial