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