intl/locale/public/nsILanguageAtomService.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     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/. */
     7 #ifndef nsILanguageAtomService_h_
     8 #define nsILanguageAtomService_h_
    10 /*
    11  * The nsILanguageAtomService provides a mapping from languages or charsets
    12  * to language groups, and access to the system locale language.
    13  */
    15 #include "nsISupports.h"
    16 #include "nsCOMPtr.h"
    17 #include "nsIAtom.h"
    19 #define NS_ILANGUAGEATOMSERVICE_IID \
    20   {0xAF4C48CF, 0x8F76, 0x4477, \
    21     { 0xA7, 0x0E, 0xAB, 0x09, 0x74, 0xE2, 0x41, 0xF0 }}
    23 #define NS_LANGUAGEATOMSERVICE_CONTRACTID \
    24   "@mozilla.org/intl/nslanguageatomservice;1"
    26 class nsILanguageAtomService : public nsISupports
    27 {
    28  public: 
    29   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID)
    31   virtual nsIAtom* LookupLanguage(const nsACString &aLanguage,
    32                                   nsresult *aError = nullptr) = 0;
    33   virtual already_AddRefed<nsIAtom>
    34   LookupCharSet(const char *aCharSet, nsresult *aError = nullptr) = 0;
    36   virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nullptr) = 0;
    38   virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage,
    39                                     nsresult *aError = nullptr) = 0;
    40 };
    42 NS_DEFINE_STATIC_IID_ACCESSOR(nsILanguageAtomService,
    43                               NS_ILANGUAGEATOMSERVICE_IID)
    45 #endif

mercurial