Bumping gaia.json for 4 gaia revision(s) a=gaia-bump
[gecko.git] / intl / locale / nsILocaleService.idl
blob477470a865657c8d247b8760a36741880a4be52d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "nsISupports.idl"
7 #include "nsILocale.idl"
9 /**
10 * The Locale service interface. This is a singleton object, and should be
11 * obtained from the <tt>nsServiceManager</tt>.
13 [scriptable, uuid(c2edc848-4219-4440-abbf-98119882c83f)]
14 interface nsILocaleService : nsISupports
16 /**
17 * Create a new nsILocale from a locale string.
19 * @param aLocale
20 * A locale code as described in nsILocale.
21 * @return A nsILocale representing the given locale.
23 nsILocale newLocale(in AString aLocale);
25 /**
26 * Get the user preference for locale from the operating system.
28 * @return User's OS setting for preferred locale.
30 nsILocale getSystemLocale();
32 /**
33 * Get the user preference for locale from the operating system.
35 * NOTE: This has nothing to do with the locale used for localization of
36 * the application (UI text strings etc.). This method returns something
37 * similar to getSystemLocale.
39 * @return User's OS setting for preferred locale.
41 nsILocale getApplicationLocale();
43 /**
44 * Get the most preferred locale from a list of locale preferences.
46 * @param acceptLanguage
47 * Locale preference in the same format as the Accept-Language HTTP
48 * header.
49 * @return The most preferred locale according to the acceptLanguage
50 * parameter.
52 nsILocale getLocaleFromAcceptLanguage(in string acceptLanguage);
54 /**
55 * Get the user preference for locale from the operating system.
57 * NOTE: This has nothing to do with any HTTP User-Agent. This method
58 * returns the same as getSystemLocale, but as a string.
60 * @return User's OS setting for preferred locale in the format described
61 * in nsILocale.
63 AString getLocaleComponentForUserAgent();
66 %{C++
68 // {C8E518C1-47AE-11d3-91CD-00105AA3F7DC}
69 #define NS_LOCALESERVICE_CID {0xc8e518c1,0x47ae,0x11d3,{0x91,0xcd,0x0,0x10,0x5a,0xa3,0xf7,0xdc}}
70 #define NS_LOCALESERVICE_CONTRACTID "@mozilla.org/intl/nslocaleservice;1"
72 extern nsresult
73 NS_NewLocaleService(nsILocaleService** result);