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