summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/resource/XLocale.idl
blob: 836c5d99fe4e84d2b0cfb81d0c1c57c73191d3de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: XLocale.idl,v $
 * $Revision: 1.9 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef __com_sun_star_resource_XLocale_idl__
#define __com_sun_star_resource_XLocale_idl__

#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif

#ifndef __com_sun_star_lang_Locale_idl__
#include <com/sun/star/lang/Locale.idl>
#endif

#ifndef __com_sun_star_resource_MissingResourceException_idl__
#include <com/sun/star/resource/MissingResourceException.idl>
#endif


//=============================================================================

 module com {  module sun {  module star {  module resource {

//=============================================================================

// DocMerge from xml: interface com::sun::star::resource::XLocale
/** offers some operations on <type scope="com::sun::star::lang">Locale</type>
    structures.@see         XResourceBundle
        @see         Locale
 */
published interface XLocale: com::sun::star::uno::XInterface
{
    //-------------------------------------------------------------------------

    // DocMerge from xml: method com::sun::star::resource::XLocale::create
    /** creates a locale from language, country, and variant.

        <p>NOTE: ISO 639 is not a stable standard; some of the
        language codes it defines (specifically iw, ji, and in) have
        changed.  This constructor accepts both the old codes (iw, ji,
        and in) and the new codes (he, yi, and id), but all other API
        on XLocale will return only the <b>NEW</b> codes.
        </p>
        <p>Note: The Java class <code>Locale</code> returns the <strong>old</strong> codes.

        </p>
     */
    com::sun::star::lang::Locale create( [in] string aLanguage,
             [in] string aCountry,
             [in] string aVariant );

    //-------------------------------------------------------------------------

    // DocMerge from xml: method com::sun::star::resource::XLocale::getDefault
    /** the common method of getting the current default locale.

        <p>It is used for the presentation (for menus, dialogs, etc.).
        It is, generally, set once when your applet or application is
        initialized, then never reset. (If you do reset the default
        locale, you probably want to reload your GUI, so that the
        change is reflected in your interface.)
        </p>
        <p>More advanced programs allow users to use different locales
        for different fields, for example, in a spreadsheet.

        <br>Note that the initial setting will match the host system.</p>
     */
    com::sun::star::lang::Locale getDefault();

    //-------------------------------------------------------------------------

    // DocMerge from xml: method com::sun::star::resource::XLocale::setDefault
    /** sets the default locale for the whole environment.

        <p>It is normally set once at the beginning of an application,
        then never reset. <code>setDefault</code> does not reset the host
        locale.

        </p>
     */
    void setDefault( [in] com::sun::star::lang::Locale newLocale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getAvailableLocales
    /** @returns
                    a sequence of all locales which are available in the system.
     */
    sequence<com::sun::star::lang::Locale> getAvailableLocales();

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getISOCountries
    /** @returns
                    a sequence of all ISO country codes known to the component.
     */
    sequence<string> getISOCountries();

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getISOLanguages
    /** @returns
                    a sequence of all ISO language codes known to the component.
     */
    sequence<string> getISOLanguages();

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getLanguagesForCountry
    /** @returns
                    a sequence for language codes which are valid within the
                    given country.
     */
    sequence<string> getLanguagesForCountry( [in] string country );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getISO3Language
    /** @returns
                    the ISO language code for the specified locale.
     */
    string getISO3Language( [in] com::sun::star::lang::Locale locale )
            raises( com::sun::star::resource::MissingResourceException );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getISO3Country
    /** @returns
                    the ISO country code for the specified locale.
     */
    string getISO3Country( [in] com::sun::star::lang::Locale locale )
            raises( com::sun::star::resource::MissingResourceException );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayLanguage_Default
    /** @returns
                    language code for display of field to user. If the localized
                    name is not found, returns the ISO code. The desired user language
                    is from the default locale.
     */
    string getDisplayLanguage_Default( [in] com::sun::star::lang::Locale locale );

    //-------------------------------------------------------------------------


    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayLanguage
    /** @return
                    language code for display of field to user. If the localized
                    name is not found, returns the ISO codes.

                @param inLocale
                    specifies the desired user language.

                @example
                    "English (UK)", "Deutch", "Germany"
     */
    string getDisplayLanguage( [in] com::sun::star::lang::Locale locale,
             [in] com::sun::star::lang::Locale inLocale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayCountry_Default
    /** @returns
                    country code for display of field to user. If the localized
                    name is not found, returns the ISO code. The desired user country
                    is from the default locale.
     */
    string getDisplayCountry_Default( [in] com::sun::star::lang::Locale locale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayCountry
    /** @returns
                    country code for display of field to user. If the localized
                    name is not found, returns the ISO codes.

                @param inLocale
                    specifies the desired user country.
     */
    string getDisplayCountry( [in] com::sun::star::lang::Locale locale,
             [in] com::sun::star::lang::Locale inLocale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayVariant_Default
    /** @returns
                    variant code for display of field to user. The desired user variant
                    is from the default locale.
     */
    string getDisplayVariant_Default( [in] com::sun::star::lang::Locale locale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayVariant
    /** @returns
                    variant code for display of field to user. If the localized
                    name is not found, returns the ISO codes.

                @param inLocale
                    specifies the desired user variant.
     */
    string getDisplayVariant( [in] com::sun::star::lang::Locale locale,
             [in] com::sun::star::lang::Locale inLocale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayName_Default
    /** @returns
                    a string to display the entire locale to user. If the localized
                    name is not found, uses the ISO codes. The default locale is used
                    for the presentation language.
     */
    string getDisplayName_Default( [in] com::sun::star::lang::Locale locale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::getDisplayName
    /** @returns
                    a string to display the entire locale to user. If the localized
                    name is not found, uses the ISO codes.

                @param inLocale
                    specifies the desired user locale.
     */
    string getDisplayName( [in] com::sun::star::lang::Locale locale,
             [in] com::sun::star::lang::Locale inLocale );

    //-------------------------------------------------------------------------

    // DocMerge from idl: method com::sun::star::resource::XLocale::equals
    /** @returns
                <TRUE/> if the <type scope="com::sun::star::lang">Locale</type> <var>l1</var> is equal to the
                other one.

                <p>A locale is deemed equal to another locale with identical
                language, country, and variant, and unequal to all other
                objects.
     */
    boolean equals( [in] com::sun::star::lang::Locale l1,
             [in] com::sun::star::lang::Locale l2 );

};

//=============================================================================

}; }; }; };

/*=============================================================================

=============================================================================*/
#endif