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