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