1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: countryid.hxx,v $
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 ************************************************************************/
31 // ============================================================================
33 #ifndef INCLUDED_SVX_COUNTRYID_HXX
34 #define INCLUDED_SVX_COUNTRYID_HXX
36 #include <sal/types.h>
37 #include <i18npool/lang.h>
38 #include "svx/svxdllapi.h"
40 // ----------------------------------------------------------------------------
44 // Windows Country IDs ========================================================
46 /** Represents a Windows country ID.
48 The country IDs used in Windows are equal to the international calling
49 code of each country, i.e. the code 353 represents Ireland (+353).
51 ATTENTION: These country codes are not supposed to be used anywhere in core
52 structures! They shall ONLY be used in the import/export filters for
53 Microsoft Office documents!
55 typedef sal_uInt16 CountryId
;
57 const CountryId COUNTRY_DONTKNOW
= 0;
58 const CountryId COUNTRY_USA
= 1;
59 const CountryId COUNTRY_DOMINICAN_REPUBLIC
= 1; // NANP
60 const CountryId COUNTRY_GUAM
= 1; // NANP
61 const CountryId COUNTRY_JAMAICA
= 1; // NANP
62 const CountryId COUNTRY_PUERTO_RICO
= 1; // NANP
63 const CountryId COUNTRY_TRINIDAD_Y_TOBAGO
= 1; // NANP
64 const CountryId COUNTRY_CANADA
= 2;
65 const CountryId COUNTRY_RUSSIA
= 7;
66 const CountryId COUNTRY_KAZAKHSTAN
= 7; // no own ID
67 const CountryId COUNTRY_TATARSTAN
= 7; // no own ID
68 const CountryId COUNTRY_EGYPT
= 20;
69 const CountryId COUNTRY_SOUTH_AFRICA
= 27;
70 const CountryId COUNTRY_GREECE
= 30;
71 const CountryId COUNTRY_NETHERLANDS
= 31;
72 const CountryId COUNTRY_BELGIUM
= 32;
73 const CountryId COUNTRY_FRANCE
= 33;
74 const CountryId COUNTRY_SPAIN
= 34;
75 const CountryId COUNTRY_HUNGARY
= 36;
76 const CountryId COUNTRY_ITALY
= 39;
77 const CountryId COUNTRY_ROMANIA
= 40;
78 const CountryId COUNTRY_SWITZERLAND
= 41;
79 const CountryId COUNTRY_AUSTRIA
= 43;
80 const CountryId COUNTRY_UNITED_KINGDOM
= 44;
81 const CountryId COUNTRY_DENMARK
= 45;
82 const CountryId COUNTRY_SWEDEN
= 46;
83 const CountryId COUNTRY_NORWAY
= 47;
84 const CountryId COUNTRY_POLAND
= 48;
85 const CountryId COUNTRY_GERMANY
= 49;
86 const CountryId COUNTRY_PERU
= 51;
87 const CountryId COUNTRY_MEXICO
= 52;
88 const CountryId COUNTRY_CUBA
= 53;
89 const CountryId COUNTRY_ARGENTINIA
= 54;
90 const CountryId COUNTRY_BRAZIL
= 55;
91 const CountryId COUNTRY_CHILE
= 56;
92 const CountryId COUNTRY_COLOMBIA
= 57;
93 const CountryId COUNTRY_VENEZUELA
= 58;
94 const CountryId COUNTRY_MALAYSIA
= 60;
95 const CountryId COUNTRY_AUSTRALIA
= 61;
96 const CountryId COUNTRY_INDONESIA
= 62;
97 const CountryId COUNTRY_PHILIPPINES
= 63;
98 const CountryId COUNTRY_NEW_ZEALAND
= 64;
99 const CountryId COUNTRY_SINGAPORE
= 65;
100 const CountryId COUNTRY_THAILAND
= 66;
101 const CountryId COUNTRY_JAPAN
= 81;
102 const CountryId COUNTRY_SOUTH_KOREA
= 82;
103 const CountryId COUNTRY_VIET_NAM
= 84;
104 const CountryId COUNTRY_PR_CHINA
= 86;
105 const CountryId COUNTRY_TIBET
= 86; // no own ID
106 const CountryId COUNTRY_TURKEY
= 90;
107 const CountryId COUNTRY_INDIA
= 91;
108 const CountryId COUNTRY_PAKISTAN
= 92;
109 const CountryId COUNTRY_AFGHANISTAN
= 93;
110 const CountryId COUNTRY_SRI_LANKA
= 94;
111 const CountryId COUNTRY_MYANMAR
= 95;
112 const CountryId COUNTRY_MOROCCO
= 212;
113 const CountryId COUNTRY_ALGERIA
= 213;
114 const CountryId COUNTRY_TUNISIA
= 216;
115 const CountryId COUNTRY_LIBYA
= 218;
116 const CountryId COUNTRY_GAMBIA
= 220;
117 const CountryId COUNTRY_SENEGAL
= 221;
118 const CountryId COUNTRY_MAURITANIA
= 222;
119 const CountryId COUNTRY_MALI
= 223;
120 const CountryId COUNTRY_GUINEA
= 224;
121 const CountryId COUNTRY_COTE_D_IVOIRE
= 225;
122 const CountryId COUNTRY_BURKINA_FARSO
= 226;
123 const CountryId COUNTRY_NIGER
= 227;
124 const CountryId COUNTRY_TOGO
= 228;
125 const CountryId COUNTRY_BENIN
= 229;
126 const CountryId COUNTRY_MAURITIUS
= 230;
127 const CountryId COUNTRY_LIBERIA
= 231;
128 const CountryId COUNTRY_SIERRA_LEONE
= 232;
129 const CountryId COUNTRY_GHANA
= 233;
130 const CountryId COUNTRY_NIGERIA
= 234;
131 const CountryId COUNTRY_CHAD
= 235;
132 const CountryId COUNTRY_CENTRAL_AFR_REP
= 236;
133 const CountryId COUNTRY_CAMEROON
= 237;
134 const CountryId COUNTRY_CAPE_VERDE
= 238;
135 const CountryId COUNTRY_SAO_TOME
= 239;
136 const CountryId COUNTRY_EQUATORIAL_GUINEA
= 240;
137 const CountryId COUNTRY_GABON
= 241;
138 const CountryId COUNTRY_CONGO
= 242;
139 const CountryId COUNTRY_ZAIRE
= 243;
140 const CountryId COUNTRY_ANGOLA
= 244;
141 const CountryId COUNTRY_GUINEA_BISSAU
= 245;
142 const CountryId COUNTRY_DIEGO_GARCIA
= 246;
143 const CountryId COUNTRY_ASCENSION_ISLAND
= 247;
144 const CountryId COUNTRY_SEYCHELLES
= 248;
145 const CountryId COUNTRY_SUDAN
= 249;
146 const CountryId COUNTRY_RWANDA
= 250;
147 const CountryId COUNTRY_ETHIOPIA
= 251;
148 const CountryId COUNTRY_SOMALIA
= 252;
149 const CountryId COUNTRY_DJIBOUTI
= 253;
150 const CountryId COUNTRY_KENYA
= 254;
151 const CountryId COUNTRY_TANZANIA
= 255;
152 const CountryId COUNTRY_UGANDA
= 256;
153 const CountryId COUNTRY_BURUNDI
= 257;
154 const CountryId COUNTRY_MOZAMBIQUE
= 258;
155 const CountryId COUNTRY_ZANZIBAR
= 259;
156 const CountryId COUNTRY_ZAMBIA
= 260;
157 const CountryId COUNTRY_MADAGASKAR
= 261;
158 const CountryId COUNTRY_REUNION
= 262;
159 const CountryId COUNTRY_ZIMBABWE
= 263;
160 const CountryId COUNTRY_NAMIBIA
= 264;
161 const CountryId COUNTRY_MALAWI
= 265;
162 const CountryId COUNTRY_LESOTHO
= 266;
163 const CountryId COUNTRY_BOTSWANA
= 267;
164 const CountryId COUNTRY_SWAZILAND
= 268;
165 const CountryId COUNTRY_COMOROS_MAYOTTE
= 269;
166 const CountryId COUNTRY_ST_HELENA
= 290;
167 const CountryId COUNTRY_ERITREA
= 291;
168 const CountryId COUNTRY_ARUBA
= 297;
169 const CountryId COUNTRY_FAEROE_ISLANDS
= 298;
170 const CountryId COUNTRY_GREEN_ISLAND
= 299;
171 const CountryId COUNTRY_GIBRALTAR
= 350;
172 const CountryId COUNTRY_PORTUGAL
= 351;
173 const CountryId COUNTRY_LUXEMBOURG
= 352;
174 const CountryId COUNTRY_IRELAND
= 353;
175 const CountryId COUNTRY_ICELAND
= 354;
176 const CountryId COUNTRY_ALBANIA
= 355;
177 const CountryId COUNTRY_MALTA
= 356;
178 const CountryId COUNTRY_CYPRUS
= 357;
179 const CountryId COUNTRY_FINLAND
= 358;
180 const CountryId COUNTRY_BULGARIA
= 359;
181 const CountryId COUNTRY_LITHUANIA
= 370;
182 const CountryId COUNTRY_LATVIA
= 371;
183 const CountryId COUNTRY_ESTONIA
= 372;
184 const CountryId COUNTRY_MOLDOVA
= 373;
185 const CountryId COUNTRY_ARMENIA
= 374;
186 const CountryId COUNTRY_BELARUS
= 375;
187 const CountryId COUNTRY_ANDORRA
= 376;
188 const CountryId COUNTRY_MONACO
= 377;
189 const CountryId COUNTRY_SAN_MARINO
= 378;
190 const CountryId COUNTRY_VATICAN_CITY
= 379;
191 const CountryId COUNTRY_UKRAINE
= 380;
192 const CountryId COUNTRY_SERBIA
= 381;
193 const CountryId COUNTRY_CROATIA
= 385;
194 const CountryId COUNTRY_SLOVENIA
= 386;
195 const CountryId COUNTRY_BOSNIA
= 387;
196 const CountryId COUNTRY_MACEDONIA
= 389;
197 const CountryId COUNTRY_CZECH
= 420;
198 const CountryId COUNTRY_SLOVAK
= 421;
199 const CountryId COUNTRY_LIECHTENSTEIN
= 423;
200 const CountryId COUNTRY_FALKLAND_ISLANDS
= 500;
201 const CountryId COUNTRY_BELIZE
= 501;
202 const CountryId COUNTRY_GUATEMALA
= 502;
203 const CountryId COUNTRY_EL_SALVADOR
= 503;
204 const CountryId COUNTRY_HONDURAS
= 504;
205 const CountryId COUNTRY_NICARAGUA
= 505;
206 const CountryId COUNTRY_COSTA_RICA
= 506;
207 const CountryId COUNTRY_PANAMA
= 507;
208 const CountryId COUNTRY_ST_PIERRE
= 508;
209 const CountryId COUNTRY_HAITI
= 509;
210 const CountryId COUNTRY_GUADELOUPE
= 590;
211 const CountryId COUNTRY_BOLIVIA
= 591;
212 const CountryId COUNTRY_GUYANA
= 592;
213 const CountryId COUNTRY_ECUADOR
= 593;
214 const CountryId COUNTRY_FRENCH_GUIANA
= 594;
215 const CountryId COUNTRY_PARAGUAY
= 595;
216 const CountryId COUNTRY_MARTINIQUE
= 596;
217 const CountryId COUNTRY_SURINAME
= 597;
218 const CountryId COUNTRY_URUGUAY
= 598;
219 const CountryId COUNTRY_NETHERL_ANTILLES
= 599;
220 const CountryId COUNTRY_EAST_TIMOR
= 670;
221 const CountryId COUNTRY_ANTARCTICA
= 672;
222 const CountryId COUNTRY_BRUNEI_DARUSSALAM
= 673;
223 const CountryId COUNTRY_NARUPU
= 674;
224 const CountryId COUNTRY_PAPUA_NEW_GUINEA
= 675;
225 const CountryId COUNTRY_TONGA
= 676;
226 const CountryId COUNTRY_SOLOMON_ISLANDS
= 677;
227 const CountryId COUNTRY_VANUATU
= 678;
228 const CountryId COUNTRY_FIJI
= 679;
229 const CountryId COUNTRY_PALAU
= 680;
230 const CountryId COUNTRY_WALLIS_AND_FUTUNA
= 681;
231 const CountryId COUNTRY_COOK_ISLANDS
= 682;
232 const CountryId COUNTRY_NIUE_ISLAND
= 683;
233 const CountryId COUNTRY_AMERICAN_SAMOA
= 684;
234 const CountryId COUNTRY_WESTERN_SAMOA
= 685;
235 const CountryId COUNTRY_KIRIBATI
= 686;
236 const CountryId COUNTRY_NEW_CALEDONIA
= 687;
237 const CountryId COUNTRY_TUVALU
= 688;
238 const CountryId COUNTRY_FRENCH_POLYNESIA
= 689;
239 const CountryId COUNTRY_TOKELAU
= 690;
240 const CountryId COUNTRY_MICRONESIA
= 691;
241 const CountryId COUNTRY_MARSHALL_ISLANDS
= 692;
242 const CountryId COUNTRY_NORTH_KOREA
= 850;
243 const CountryId COUNTRY_HONG_KONG
= 852;
244 const CountryId COUNTRY_MACAU
= 853;
245 const CountryId COUNTRY_CAMBODIA
= 855;
246 const CountryId COUNTRY_LAOS
= 856;
247 const CountryId COUNTRY_BANGLADESH
= 880;
248 const CountryId COUNTRY_TAIWAN
= 886;
249 const CountryId COUNTRY_MALDIVES
= 960;
250 const CountryId COUNTRY_LEBANON
= 961;
251 const CountryId COUNTRY_JORDAN
= 962;
252 const CountryId COUNTRY_SYRIA
= 963;
253 const CountryId COUNTRY_IRAQ
= 964;
254 const CountryId COUNTRY_KUWAIT
= 965;
255 const CountryId COUNTRY_SAUDI_ARABIA
= 966;
256 const CountryId COUNTRY_YEMEN
= 967;
257 const CountryId COUNTRY_OMAN
= 968;
258 const CountryId COUNTRY_PALESTINE
= 970;
259 const CountryId COUNTRY_UAE
= 971;
260 const CountryId COUNTRY_ISRAEL
= 972;
261 const CountryId COUNTRY_BAHRAIN
= 973;
262 const CountryId COUNTRY_QATAR
= 974;
263 const CountryId COUNTRY_BHUTAN
= 975;
264 const CountryId COUNTRY_MONGOLIA
= 976;
265 const CountryId COUNTRY_NEPAL
= 977;
266 const CountryId COUNTRY_IRAN
= 981;
267 const CountryId COUNTRY_TAJIKISTAN
= 992;
268 const CountryId COUNTRY_TURKMENISTAN
= 993;
269 const CountryId COUNTRY_AZERBAIJAN
= 994;
270 const CountryId COUNTRY_GEORGIA
= 995;
271 const CountryId COUNTRY_KYRGYZSTAN
= 996;
272 const CountryId COUNTRY_UZBEKISTAN
= 998;
274 // Country ID <-> Language type conversion ====================================
276 /** Converts a language type to a Windows country ID.
278 The function regards the sub type of the passed language, and tries to
279 return the appropriate country, i.e. COUNTRY_IRELAND for
280 LANGUAGE_ENGLISH_EIRE.
282 A few countries do not have an own associated country ID. Most of these
283 countries are mapped to another related country, i.e. Kazakhstan is
286 If no country can be found, the value COUNTRY_DONTKNOW will be returned.
289 A language type, defined in tools/lang.hxx.
292 The best Windows country ID for the passed language type, or
293 COUNTRY_DONTKNOW on error.
295 SVX_DLLPUBLIC CountryId
ConvertLanguageToCountry( LanguageType eLanguage
);
297 /** Converts a Windows country ID to a language type.
299 The function returns the most used language for the passed country
300 (hopefully), i.e. LANGUAGE_ENGLISH_EIRE for COUNTRY_IRELAND.
302 If the passed country ID is not valid, the value LANGUAGE_DONTKNOW will be
306 A Windows country ID, defined above.
309 The most used language type in the passed country, or LANGUAGE_DONTKNOW
312 SVX_DLLPUBLIC LanguageType
ConvertCountryToLanguage( CountryId eCountry
);
314 // ============================================================================
318 // ============================================================================