// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file mozIOSPreferences.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    ///This Source Code Form is subject to the terms of the Mozilla Public
    /// License, v. 2.0. If a copy of the MPL was not distributed with this
    /// file, You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("65944815-e9ae-48bd-a2bf-f1108720950c")]
	public interface mozIOSPreferences
	{
		
		/// <summary>
        /// Returns a list of locales used by the host environment for UI
        /// localization.
        ///
        /// The result is a sorted list and we expect that the OS attempts to
        /// use the top locale from the list for which it has data.
        ///
        /// Each element of the list is a valid locale ID that can be passed to ICU
        /// and ECMA402 Intl APIs,
        /// At the same time each element is a valid BCP47 language tag that can be
        /// used for language negotiation.
        ///
        /// Example: ["en-US", "de", "pl", "sr-Cyrl", "zh-Hans-HK"]
        ///
        /// (See OSPreferences.h for a more C++-friendly version of this.)
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetSystemLocales(ref uint aCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref string[] aOutArray);
		
		/// <summary>
        /// Returns a list of locales used by host environment for regional
        /// preferences internationalization.
        ///
        /// The result is a sorted list and we expect that the OS attempts to
        /// use the top locale from the list for which it has data.
        ///
        /// Each element of the list is a valid locale ID that can be passed to ICU
        /// and ECMA402 Intl APIs,
        ///
        /// Example: ["en-US", "de", "pl", "sr-Cyrl", "zh-Hans-HK"]
        ///
        /// (See OSPreferences.h for a more C++-friendly version of this.)
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetRegionalPrefsLocales(ref uint aCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref string[] aOutArray);
		
		/// <summary>
        /// Returns the best locale that the host environment is localized to.
        ///
        /// The result is a valid locale ID and it should be
        /// used for all APIs that do not handle language negotiation.
        ///
        /// In any scenario involving language negotiation, GetSystemLocales should
        /// be preferred over the single value.
        ///
        /// Example: "zh-Hans-HK"
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetSystemLocaleAttribute([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aSystemLocale);
		
		/// <summary>
        /// Returns the best possible date/time pattern for the host environment
        /// taking into account date/time regional settings user defined in the OS
        /// preferences.
        ///
        /// Notice, that depending on the OS it may take into account those settings
        /// for all locales, or only if the locale matches the OS locale.
        ///
        /// It takes two integer arguments that must be valid `dateTimeFormatStyle*`
        /// values (see constants defined above), and a string representing a
        /// BCP47 locale.
        ///
        /// It returns a string with a LDML date/time pattern.
        ///
        /// If no pattern can be retrieved from the host environment, it will
        /// lookup the best available pattern from ICU.
        ///
        /// Notice, this is a pretty unique method in this API in that it does
        /// more than look up into host environment.
        /// The reason for that is that constructing the right date/time pattern
        /// requires a lot of OS-specific logic and it ends up being easier to just
        /// handle all scenarios, including with cases where we fail to retrieve
        /// anything from the OS, here.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetDateTimePattern(int timeFormatStyle, int dateFormatStyle, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase locale, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase retval);
	}
	
	/// <summary>mozIOSPreferencesConsts </summary>
	public class mozIOSPreferencesConsts
	{
		
		// <summary>
        //This Source Code Form is subject to the terms of the Mozilla Public
        // License, v. 2.0. If a copy of the MPL was not distributed with this
        // file, You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
		public const long dateTimeFormatStyleNone = 0;
		
		// 
		public const long dateTimeFormatStyleShort = 1;
		
		// 
		public const long dateTimeFormatStyleMedium = 2;
		
		// 
		public const long dateTimeFormatStyleLong = 3;
		
		// 
		public const long dateTimeFormatStyleFull = 4;
	}
}
