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 .
19 #ifndef INCLUDED_I18NUTIL_TRANSLITERATION_HXX
20 #define INCLUDED_I18NUTIL_TRANSLITERATION_HXX
22 #include <com/sun/star/i18n/TransliterationModules.hpp>
23 #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
24 #include <o3tl/typed_flags_set.hxx>
27 * This is a superset type of the com::sun::star::i18n::TransliterationModules and TransliterationModulesExtra,
28 * with some extra type checking
30 enum class TransliterationFlags
{
32 /// Transliterate a string from upper case to lower case
33 UPPERCASE_LOWERCASE
= int(css::i18n::TransliterationModules_UPPERCASE_LOWERCASE
),
34 /// Transliterate a string from lower case to upper case
35 LOWERCASE_UPPERCASE
= int(css::i18n::TransliterationModules_LOWERCASE_UPPERCASE
),
36 /// Transliterate a string from half width character to full width character
37 HALFWIDTH_FULLWIDTH
= int(css::i18n::TransliterationModules_HALFWIDTH_FULLWIDTH
),
38 /// Transliterate a string from full width character to half width character
39 FULLWIDTH_HALFWIDTH
= int(css::i18n::TransliterationModules_FULLWIDTH_HALFWIDTH
),
40 /// Transliterate a Japanese string from Katakana to Hiragana
41 KATAKANA_HIRAGANA
= int(css::i18n::TransliterationModules_KATAKANA_HIRAGANA
),
42 /// Transliterate a Japanese string from Hiragana to Katakana
43 HIRAGANA_KATAKANA
= int(css::i18n::TransliterationModules_HIRAGANA_KATAKANA
),
44 /// Transliterate an ASCII number string to Simplified Chinese lower case number string in spellout format
45 NumToTextLower_zh_CN
= int(css::i18n::TransliterationModules_NumToTextLower_zh_CN
),
46 /// Transliterate an ASCII number string to Simplified Chinese upper case number string in spellout format
47 NumToTextUpper_zh_CN
= int(css::i18n::TransliterationModules_NumToTextUpper_zh_CN
),
48 /// Transliterate an ASCII number string to Traditional Chinese lower case number string in spellout format
49 NumToTextLower_zh_TW
= int(css::i18n::TransliterationModules_NumToTextLower_zh_TW
),
50 /// Transliterate an ASCII number string to Traditional Chinese upper case number string in spellout format
51 NumToTextUpper_zh_TW
= int(css::i18n::TransliterationModules_NumToTextUpper_zh_TW
),
52 /// Transliterate an ASCII number string to formal Korean Hangul number string in spellout format
53 NumToTextFormalHangul_ko
= int(css::i18n::TransliterationModules_NumToTextFormalHangul_ko
),
54 /// Transliterate an ASCII number string to formal Korean Hanja lower case number string in spellout format
55 NumToTextFormalLower_ko
= int(css::i18n::TransliterationModules_NumToTextFormalLower_ko
),
56 /// Transliterate an ASCII number string to formal Korean Hanja upper case number string in spellout format
57 NumToTextFormalUpper_ko
= int(css::i18n::TransliterationModules_NumToTextFormalUpper_ko
),
59 /** The first character of the sentence is put in upper case
61 SENTENCE_CASE
= int(css::i18n::TransliterationModulesExtra::SENTENCE_CASE
),
64 /** The first character of the word is put in upper case.
67 TITLE_CASE
= int(css::i18n::TransliterationModulesExtra::TITLE_CASE
),
70 /** All characters of the word are to change their case from small letters
71 * to capital letters and vice versa.
73 TOGGLE_CASE
= int(css::i18n::TransliterationModulesExtra::TOGGLE_CASE
),
75 NON_IGNORE_MASK
= int(css::i18n::TransliterationModules_NON_IGNORE_MASK
),
76 IGNORE_MASK
= 0x7fffff00,
78 /// Ignore case when comparing strings by transliteration service
79 IGNORE_CASE
= int(css::i18n::TransliterationModules_IGNORE_CASE
),
80 /// Ignore Hiragana and Katakana when comparing strings by transliteration service
81 IGNORE_KANA
= int(css::i18n::TransliterationModules_IGNORE_KANA
), // ja_JP
82 /// Ignore full width and half width character when comparing strings by transliteration service
83 IGNORE_WIDTH
= int(css::i18n::TransliterationModules_IGNORE_WIDTH
), // ja_JP
84 /// Ignore Japanese traditional Kanji character in Japanese fuzzy search
85 ignoreTraditionalKanji_ja_JP
= int(css::i18n::TransliterationModules_IgnoreTraditionalKanji_ja_JP
),
86 /// Ignore Japanese traditional Katakana and Hiragana character in Japanese fuzzy search
87 ignoreTraditionalKana_ja_JP
= int(css::i18n::TransliterationModules_IgnoreTraditionalKana_ja_JP
),
88 /// Ignore dash or minus sign in Japanese fuzzy search
89 ignoreMinusSign_ja_JP
= int(css::i18n::TransliterationModules_IgnoreMinusSign_ja_JP
),
90 /// Ignore Hiragana and Katakana iteration mark in Japanese fuzzy search
91 ignoreIterationMark_ja_JP
= int(css::i18n::TransliterationModules_IgnoreIterationMark_ja_JP
),
92 /// Ignore separator punctuations in Japanese fuzzy search
93 ignoreSeparator_ja_JP
= int(css::i18n::TransliterationModules_IgnoreSeparator_ja_JP
),
94 /// Ignore Katakana and Hiragana Zi/Zi and Zu/Zu in Japanese fuzzy search
95 ignoreZiZu_ja_JP
= int(css::i18n::TransliterationModules_IgnoreZiZu_ja_JP
),
96 /// Ignore Katakana and Hiragana Ba/Gua and Ha/Fa in Japanese fuzzy search
97 ignoreBaFa_ja_JP
= int(css::i18n::TransliterationModules_IgnoreBaFa_ja_JP
),
98 /// Ignore Katakana and Hiragana Tsui/Tea/Ti and Dyi/Ji in Japanese fuzzy search
99 ignoreTiJi_ja_JP
= int(css::i18n::TransliterationModules_IgnoreTiJi_ja_JP
),
100 /// Ignore Katakana and Hiragana Hyu/Fyu and Byu/Gyu in Japanese fuzzy search
101 ignoreHyuByu_ja_JP
= int(css::i18n::TransliterationModules_IgnoreHyuByu_ja_JP
),
102 /// Ignore Katakana and Hiragana Se/Sye and Ze/Je in Japanese fuzzy search
103 ignoreSeZe_ja_JP
= int(css::i18n::TransliterationModules_IgnoreSeZe_ja_JP
),
104 /// Ignore Katakana YA/A which follows the character in either I or E row in Japanese fuzzy search
105 ignoreIandEfollowedByYa_ja_JP
= int(css::i18n::TransliterationModules_IgnoreIandEfollowedByYa_ja_JP
),
106 /// Ignore Katakana KI/KU which follows the character in SA column in Japanese fuzzy search
107 ignoreKiKuFollowedBySa_ja_JP
= int(css::i18n::TransliterationModules_IgnoreKiKuFollowedBySa_ja_JP
),
108 /// Ignore Japanese normal and small sized character in Japanese fuzzy search
109 ignoreSize_ja_JP
= int(css::i18n::TransliterationModules_IgnoreSize_ja_JP
),
110 /// Ignore Japanese prolonged sound mark in Japanese fuzzy search
111 ignoreProlongedSoundMark_ja_JP
= int(css::i18n::TransliterationModules_IgnoreProlongedSoundMark_ja_JP
),
112 /// Ignore middle dot in Japanese fuzzy search
113 ignoreMiddleDot_ja_JP
= int(css::i18n::TransliterationModules_IgnoreMiddleDot_ja_JP
),
114 /// Ignore white space characters, include space, TAB, return, etc. in Japanese fuzzy search
115 ignoreSpace_ja_JP
= int(css::i18n::TransliterationModules_IgnoreSpace_ja_JP
),
116 /// transliterate Japanese small sized character to normal sized character
117 smallToLarge_ja_JP
= int(css::i18n::TransliterationModules_SmallToLarge_ja_JP
),
118 /// transliterate Japanese normal sized character to small sized character
119 largeToSmall_ja_JP
= int(css::i18n::TransliterationModules_LargeToSmall_ja_JP
),
121 /// Transliterate decomposing and removing diacritics, not only CTL, despite its name.
122 IGNORE_DIACRITICS_CTL
= int(css::i18n::TransliterationModulesExtra::IGNORE_DIACRITICS_CTL
),
123 /// Ignore Kashida mark.
124 IGNORE_KASHIDA_CTL
= int(css::i18n::TransliterationModulesExtra::IGNORE_KASHIDA_CTL
)
127 template<> struct typed_flags
<TransliterationFlags
> : is_typed_flags
<TransliterationFlags
, 0x7fffffff> {};
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */