intl/locale/idl/nsILocaleService.idl

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.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7 #include "nsILocale.idl"
michael@0 8
michael@0 9 /**
michael@0 10 * The Locale service interface. This is a singleton object, and should be
michael@0 11 * obtained from the <tt>nsServiceManager</tt>.
michael@0 12 */
michael@0 13 [scriptable, uuid(c2edc848-4219-4440-abbf-98119882c83f)]
michael@0 14 interface nsILocaleService : nsISupports
michael@0 15 {
michael@0 16 /**
michael@0 17 * Create a new nsILocale from a locale string.
michael@0 18 *
michael@0 19 * @param aLocale
michael@0 20 * A locale code as described in nsILocale.
michael@0 21 * @return A nsILocale representing the given locale.
michael@0 22 */
michael@0 23 nsILocale newLocale(in AString aLocale);
michael@0 24
michael@0 25 /**
michael@0 26 * Get the user preference for locale from the operating system.
michael@0 27 *
michael@0 28 * @return User's OS setting for preferred locale.
michael@0 29 */
michael@0 30 nsILocale getSystemLocale();
michael@0 31
michael@0 32 /**
michael@0 33 * Get the user preference for locale from the operating system.
michael@0 34 *
michael@0 35 * NOTE: This has nothing to do with the locale used for localization of
michael@0 36 * the application (UI text strings etc.). This method returns something
michael@0 37 * similar to getSystemLocale.
michael@0 38 *
michael@0 39 * @return User's OS setting for preferred locale.
michael@0 40 */
michael@0 41 nsILocale getApplicationLocale();
michael@0 42
michael@0 43 /**
michael@0 44 * Get the most preferred locale from a list of locale preferences.
michael@0 45 *
michael@0 46 * @param acceptLanguage
michael@0 47 * Locale preference in the same format as the Accept-Language HTTP
michael@0 48 * header.
michael@0 49 * @return The most preferred locale according to the acceptLanguage
michael@0 50 * parameter.
michael@0 51 */
michael@0 52 nsILocale getLocaleFromAcceptLanguage(in string acceptLanguage);
michael@0 53
michael@0 54 /**
michael@0 55 * Get the user preference for locale from the operating system.
michael@0 56 *
michael@0 57 * NOTE: This has nothing to do with any HTTP User-Agent. This method
michael@0 58 * returns the same as getSystemLocale, but as a string.
michael@0 59 *
michael@0 60 * @return User's OS setting for preferred locale in the format described
michael@0 61 * in nsILocale.
michael@0 62 */
michael@0 63 AString getLocaleComponentForUserAgent();
michael@0 64 };
michael@0 65
michael@0 66 %{C++
michael@0 67
michael@0 68 // {C8E518C1-47AE-11d3-91CD-00105AA3F7DC}
michael@0 69 #define NS_LOCALESERVICE_CID {0xc8e518c1,0x47ae,0x11d3,{0x91,0xcd,0x0,0x10,0x5a,0xa3,0xf7,0xdc}}
michael@0 70 #define NS_LOCALESERVICE_CONTRACTID "@mozilla.org/intl/nslocaleservice;1"
michael@0 71
michael@0 72 extern nsresult
michael@0 73 NS_NewLocaleService(nsILocaleService** result);
michael@0 74
michael@0 75 %}
michael@0 76
michael@0 77

mercurial