1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_resource_XLocale_idl__
28#define __com_sun_star_resource_XLocale_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_lang_Locale_idl__
35#include <com/sun/star/lang/Locale.idl>
36#endif
37
38#ifndef __com_sun_star_resource_MissingResourceException_idl__
39#include <com/sun/star/resource/MissingResourceException.idl>
40#endif
41
42
43//=============================================================================
44
45 module com {  module sun {  module star {  module resource {
46
47//=============================================================================
48
49// DocMerge from xml: interface com::sun::star::resource::XLocale
50/** offers some operations on <type scope="com::sun::star::lang">Locale</type>
51	structures.@see         XResourceBundle
52		@see         Locale
53 */
54published interface XLocale: com::sun::star::uno::XInterface
55{
56	//-------------------------------------------------------------------------
57
58	// DocMerge from xml: method com::sun::star::resource::XLocale::create
59	/** creates a locale from language, country, and variant.
60
61		<p>NOTE: ISO 639 is not a stable standard; some of the
62		language codes it defines (specifically iw, ji, and in) have
63		changed.  This constructor accepts both the old codes (iw, ji,
64		and in) and the new codes (he, yi, and id), but all other API
65		on XLocale will return only the <b>NEW</b> codes.
66		</p>
67		<p>Note: The Java class <code>Locale</code> returns the <strong>old</strong> codes.
68
69		</p>
70	 */
71	com::sun::star::lang::Locale create( [in] string aLanguage,
72			 [in] string aCountry,
73			 [in] string aVariant );
74
75	//-------------------------------------------------------------------------
76
77	// DocMerge from xml: method com::sun::star::resource::XLocale::getDefault
78	/** the common method of getting the current default locale.
79
80		<p>It is used for the presentation (for menus, dialogs, etc.).
81		It is, generally, set once when your applet or application is
82		initialized, then never reset. (If you do reset the default
83		locale, you probably want to reload your GUI, so that the
84		change is reflected in your interface.)
85		</p>
86		<p>More advanced programs allow users to use different locales
87		for different fields, for example, in a spreadsheet.
88
89		<br>Note that the initial setting will match the host system.</p>
90	 */
91	com::sun::star::lang::Locale getDefault();
92
93	//-------------------------------------------------------------------------
94
95	// DocMerge from xml: method com::sun::star::resource::XLocale::setDefault
96	/** sets the default locale for the whole environment.
97
98		<p>It is normally set once at the beginning of an application,
99		then never reset. <code>setDefault</code> does not reset the host
100		locale.
101
102		</p>
103	 */
104	void setDefault( [in] com::sun::star::lang::Locale newLocale );
105
106	//-------------------------------------------------------------------------
107
108	// DocMerge from idl: method com::sun::star::resource::XLocale::getAvailableLocales
109	/** @returns
110					a sequence of all locales which are available in the system.
111	 */
112	sequence<com::sun::star::lang::Locale> getAvailableLocales();
113
114	//-------------------------------------------------------------------------
115
116	// DocMerge from idl: method com::sun::star::resource::XLocale::getISOCountries
117	/** @returns
118					a sequence of all ISO country codes known to the component.
119	 */
120	sequence<string> getISOCountries();
121
122	//-------------------------------------------------------------------------
123
124	// DocMerge from idl: method com::sun::star::resource::XLocale::getISOLanguages
125	/** @returns
126					a sequence of all ISO language codes known to the component.
127	 */
128	sequence<string> getISOLanguages();
129
130	//-------------------------------------------------------------------------
131
132	// DocMerge from idl: method com::sun::star::resource::XLocale::getLanguagesForCountry
133	/** @returns
134					a sequence for language codes which are valid within the
135					given country.
136	 */
137	sequence<string> getLanguagesForCountry( [in] string country );
138
139	//-------------------------------------------------------------------------
140
141	// DocMerge from idl: method com::sun::star::resource::XLocale::getISO3Language
142	/** @returns
143					the ISO language code for the specified locale.
144	 */
145	string getISO3Language( [in] com::sun::star::lang::Locale locale )
146			raises( com::sun::star::resource::MissingResourceException );
147
148	//-------------------------------------------------------------------------
149
150	// DocMerge from idl: method com::sun::star::resource::XLocale::getISO3Country
151	/** @returns
152					the ISO country code for the specified locale.
153	 */
154	string getISO3Country( [in] com::sun::star::lang::Locale locale )
155			raises( com::sun::star::resource::MissingResourceException );
156
157	//-------------------------------------------------------------------------
158
159	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayLanguage_Default
160	/** @returns
161					language code for display of field to user. If the localized
162					name is not found, returns the ISO code. The desired user language
163					is from the default locale.
164	 */
165	string getDisplayLanguage_Default( [in] com::sun::star::lang::Locale locale );
166
167	//-------------------------------------------------------------------------
168
169
170	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayLanguage
171	/** @return
172					language code for display of field to user. If the localized
173					name is not found, returns the ISO codes.
174
175				@param inLocale
176					specifies the desired user language.
177
178				@example
179					"English (UK)", "Deutch", "Germany"
180	 */
181	string getDisplayLanguage( [in] com::sun::star::lang::Locale locale,
182			 [in] com::sun::star::lang::Locale inLocale );
183
184	//-------------------------------------------------------------------------
185
186	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayCountry_Default
187	/** @returns
188					country code for display of field to user. If the localized
189					name is not found, returns the ISO code. The desired user country
190					is from the default locale.
191	 */
192	string getDisplayCountry_Default( [in] com::sun::star::lang::Locale locale );
193
194	//-------------------------------------------------------------------------
195
196	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayCountry
197	/** @returns
198					country code for display of field to user. If the localized
199					name is not found, returns the ISO codes.
200
201				@param inLocale
202					specifies the desired user country.
203	 */
204	string getDisplayCountry( [in] com::sun::star::lang::Locale locale,
205			 [in] com::sun::star::lang::Locale inLocale );
206
207	//-------------------------------------------------------------------------
208
209	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayVariant_Default
210	/** @returns
211					variant code for display of field to user. The desired user variant
212					is from the default locale.
213	 */
214	string getDisplayVariant_Default( [in] com::sun::star::lang::Locale locale );
215
216	//-------------------------------------------------------------------------
217
218	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayVariant
219	/** @returns
220					variant code for display of field to user. If the localized
221					name is not found, returns the ISO codes.
222
223				@param inLocale
224					specifies the desired user variant.
225	 */
226	string getDisplayVariant( [in] com::sun::star::lang::Locale locale,
227			 [in] com::sun::star::lang::Locale inLocale );
228
229	//-------------------------------------------------------------------------
230
231	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayName_Default
232	/** @returns
233					a string to display the entire locale to user. If the localized
234					name is not found, uses the ISO codes. The default locale is used
235					for the presentation language.
236	 */
237	string getDisplayName_Default( [in] com::sun::star::lang::Locale locale );
238
239	//-------------------------------------------------------------------------
240
241	// DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayName
242	/** @returns
243					a string to display the entire locale to user. If the localized
244					name is not found, uses the ISO codes.
245
246				@param inLocale
247					specifies the desired user locale.
248	 */
249	string getDisplayName( [in] com::sun::star::lang::Locale locale,
250			 [in] com::sun::star::lang::Locale inLocale );
251
252	//-------------------------------------------------------------------------
253
254	// DocMerge from idl: method com::sun::star::resource::XLocale::equals
255	/** @returns
256				<TRUE/> if the <type scope="com::sun::star::lang">Locale</type> <var>l1</var> is equal to the
257				other one.
258
259				<p>A locale is deemed equal to another locale with identical
260				language, country, and variant, and unequal to all other
261				objects.
262	 */
263	boolean equals( [in] com::sun::star::lang::Locale l1,
264			 [in] com::sun::star::lang::Locale l2 );
265
266};
267
268//=============================================================================
269
270}; }; }; };
271
272/*=============================================================================
273
274=============================================================================*/
275#endif
276