michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: %{C++ michael@0: #define NSILOCALE_COLLATE "NSILOCALE_COLLATE" michael@0: #define NSILOCALE_CTYPE "NSILOCALE_CTYPE" michael@0: #define NSILOCALE_MONETARY "NSILOCALE_MONETARY" michael@0: #define NSILOCALE_NUMERIC "NSILOCALE_NUMERIC" michael@0: #define NSILOCALE_TIME "NSILOCALE_TIME" michael@0: #define NSILOCALE_MESSAGE "NSILOCALE_MESSAGES" michael@0: michael@0: #define NS_LOCALE_CONTRACTID "@mozilla.org/intl/nslocale;1" michael@0: %} michael@0: michael@0: /** michael@0: * Represents one locale, which can be used for things like sorting text strings michael@0: * and formatting numbers, dates and times. michael@0: */ michael@0: [scriptable, uuid(21035ee0-4556-11d3-91cd-00105aa3f7dc)] michael@0: interface nsILocale : nsISupports michael@0: { michael@0: /** michael@0: * Get the locale code for a given category. michael@0: * michael@0: * A locale code is of the form language[-COUNTRY[-region]], where michael@0: * "language" is an ISO 639 language code (two letter codes preferred over michael@0: * three letter codes when available), "COUNTRY" is an ISO 3166 two letter michael@0: * country code, and "region" is a string of up to 5 letters. michael@0: * michael@0: * A category is one of the following: michael@0: * NSILOCALE_CTYPE: Character classification and case conversion. michael@0: * NSILOCALE_COLLATE: Collation order. How strings are sorted. michael@0: * NSILOCALE_MONETARY: Monetary formatting. michael@0: * NSILOCALE_NUMERIC: Numeric, non-monetary formatting. michael@0: * NSILOCALE_TIME: Date and time formats. michael@0: * NSILOCALE_MESSAGES: Related to fonts, character encodings etc. michael@0: * michael@0: * @param category michael@0: * The category of interest. michael@0: * @return The locale code to be used for the given category. michael@0: */ michael@0: AString getCategory(in AString category); michael@0: };