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