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