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 <sal/types.h>
23 #include <com/sun/star/i18n/TransliterationModules.hpp>
24 #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
25 #include <o3tl/typed_flags_set.hxx>
28 * This is a superset type of the com::sun::star::i18n::TransliterationModules and TransliterationModulesExtra,
29 * with some extra type checking
31 enum class TransliterationFlags
{
33 /// Transliterate a string from upper case to lower case
34 UPPERCASE_LOWERCASE
= (int)css::i18n::TransliterationModules_UPPERCASE_LOWERCASE
,
35 /// Transliterate a string from lower case to upper case
36 LOWERCASE_UPPERCASE
= (int)css::i18n::TransliterationModules_LOWERCASE_UPPERCASE
,
37 /// Transliterate a string from half width character to full width character
38 HALFWIDTH_FULLWIDTH
= (int)css::i18n::TransliterationModules_HALFWIDTH_FULLWIDTH
,
39 /// Transliterate a string from full width character to half width character
40 FULLWIDTH_HALFWIDTH
= (int)css::i18n::TransliterationModules_FULLWIDTH_HALFWIDTH
,
41 /// Transliterate a Japanese string from Katakana to Hiragana
42 KATAKANA_HIRAGANA
= (int)css::i18n::TransliterationModules_KATAKANA_HIRAGANA
,
43 /// Transliterate a Japanese string from Hiragana to Katakana
44 HIRAGANA_KATAKANA
= (int)css::i18n::TransliterationModules_HIRAGANA_KATAKANA
,
45 /// Transliterate an ASCII number string to Simplified Chinese lower case number string in spellout format
46 NumToTextLower_zh_CN
= (int)css::i18n::TransliterationModules_NumToTextLower_zh_CN
,
47 /// Transliterate an ASCII number string to Simplified Chinese upper case number string in spellout format
48 NumToTextUpper_zh_CN
= (int)css::i18n::TransliterationModules_NumToTextUpper_zh_CN
,
49 /// Transliterate an ASCII number string to Traditional Chinese lower case number string in spellout format
50 NumToTextLower_zh_TW
= (int)css::i18n::TransliterationModules_NumToTextLower_zh_TW
,
51 /// Transliterate an ASCII number string to Traditional Chinese upper case number string in spellout format
52 NumToTextUpper_zh_TW
= (int)css::i18n::TransliterationModules_NumToTextUpper_zh_TW
,
53 /// Transliterate an ASCII number string to formal Korean Hangul number string in spellout format
54 NumToTextFormalHangul_ko
= (int)css::i18n::TransliterationModules_NumToTextFormalHangul_ko
,
55 /// Transliterate an ASCII number string to formal Korean Hanja lower case number string in spellout format
56 NumToTextFormalLower_ko
= (int)css::i18n::TransliterationModules_NumToTextFormalLower_ko
,
57 /// Transliterate an ASCII number string to formal Korean Hanja upper case number string in spellout format
58 NumToTextFormalUpper_ko
= (int)css::i18n::TransliterationModules_NumToTextFormalUpper_ko
,
60 /** The first character of the sentence is put in upper case
62 SENTENCE_CASE
= (int)css::i18n::TransliterationModulesExtra::SENTENCE_CASE
,
65 /** The first character of the word is put in upper case.
68 TITLE_CASE
= (int)css::i18n::TransliterationModulesExtra::TITLE_CASE
,
71 /** All characters of the word are to change their case from small letters
72 * to capital letters and vice versa.
74 TOGGLE_CASE
= (int)css::i18n::TransliterationModulesExtra::TOGGLE_CASE
,
76 NON_IGNORE_MASK
= (int)css::i18n::TransliterationModules_NON_IGNORE_MASK
,
77 IGNORE_MASK
= 0x7fffff00,
79 /// Ignore case when comparing strings by transliteration service
80 IGNORE_CASE
= (int)css::i18n::TransliterationModules_IGNORE_CASE
,
81 /// Ignore Hiragana and Katakana when comparing strings by transliteration service
82 IGNORE_KANA
= (int)css::i18n::TransliterationModules_IGNORE_KANA
, // ja_JP
83 /// Ignore full width and half width character when comparing strings by transliteration service
84 IGNORE_WIDTH
= (int)css::i18n::TransliterationModules_IGNORE_WIDTH
, // ja_JP
85 /// Ignore Japanese traditional Kanji character in Japanese fuzzy search
86 ignoreTraditionalKanji_ja_JP
= (int)css::i18n::TransliterationModules_ignoreTraditionalKanji_ja_JP
,
87 /// Ignore Japanese traditional Katakana and Hiragana character in Japanese fuzzy search
88 ignoreTraditionalKana_ja_JP
= (int)css::i18n::TransliterationModules_ignoreTraditionalKana_ja_JP
,
89 /// Ignore dash or minus sign in Japanese fuzzy search
90 ignoreMinusSign_ja_JP
= (int)css::i18n::TransliterationModules_ignoreMinusSign_ja_JP
,
91 /// Ignore Hiragana and Katakana iteration mark in Japanese fuzzy search
92 ignoreIterationMark_ja_JP
= (int)css::i18n::TransliterationModules_ignoreIterationMark_ja_JP
,
93 /// Ignore separator punctuations in Japanese fuzzy search
94 ignoreSeparator_ja_JP
= (int)css::i18n::TransliterationModules_ignoreSeparator_ja_JP
,
95 /// Ignore Katakana and Hiragana Zi/Zi and Zu/Zu in Japanese fuzzy search
96 ignoreZiZu_ja_JP
= (int)css::i18n::TransliterationModules_ignoreZiZu_ja_JP
,
97 /// Ignore Katakana and Hiragana Ba/Gua and Ha/Fa in Japanese fuzzy search
98 ignoreBaFa_ja_JP
= (int)css::i18n::TransliterationModules_ignoreBaFa_ja_JP
,
99 /// Ignore Katakana and Hiragana Tsui/Tea/Ti and Dyi/Ji in Japanese fuzzy search
100 ignoreTiJi_ja_JP
= (int)css::i18n::TransliterationModules_ignoreTiJi_ja_JP
,
101 /// Ignore Katakana and Hiragana Hyu/Fyu and Byu/Gyu in Japanese fuzzy search
102 ignoreHyuByu_ja_JP
= (int)css::i18n::TransliterationModules_ignoreHyuByu_ja_JP
,
103 /// Ignore Katakana and Hiragana Se/Sye and Ze/Je in Japanese fuzzy search
104 ignoreSeZe_ja_JP
= (int)css::i18n::TransliterationModules_ignoreSeZe_ja_JP
,
105 /// Ignore Katakana YA/A which follows the character in either I or E row in Japanese fuzzy search
106 ignoreIandEfollowedByYa_ja_JP
= (int)css::i18n::TransliterationModules_ignoreIandEfollowedByYa_ja_JP
,
107 /// Ignore Katakana KI/KU which follows the character in SA column in Japanese fuzzy search
108 ignoreKiKuFollowedBySa_ja_JP
= (int)css::i18n::TransliterationModules_ignoreKiKuFollowedBySa_ja_JP
,
109 /// Ignore Japanese normal and small sized character in Japanese fuzzy search
110 ignoreSize_ja_JP
= (int)css::i18n::TransliterationModules_ignoreSize_ja_JP
,
111 /// Ignore Japanese prolonged sound mark in Japanese fuzzy search
112 ignoreProlongedSoundMark_ja_JP
= (int)css::i18n::TransliterationModules_ignoreProlongedSoundMark_ja_JP
,
113 /// Ignore middle dot in Japanese fuzzy search
114 ignoreMiddleDot_ja_JP
= (int)css::i18n::TransliterationModules_ignoreMiddleDot_ja_JP
,
115 /// Ignore white space characters, include space, TAB, return, etc. in Japanese fuzzy search
116 ignoreSpace_ja_JP
= (int)css::i18n::TransliterationModules_ignoreSpace_ja_JP
,
117 /// transliterate Japanese small sized character to normal sized character
118 smallToLarge_ja_JP
= (int)css::i18n::TransliterationModules_smallToLarge_ja_JP
,
119 /// transliterate Japanese normal sized character to small sized character
120 largeToSmall_ja_JP
= (int)css::i18n::TransliterationModules_largeToSmall_ja_JP
,
122 IGNORE_DIACRITICS_CTL
= (int)css::i18n::TransliterationModulesExtra::IGNORE_DIACRITICS_CTL
,
123 IGNORE_KASHIDA_CTL
= (int)css::i18n::TransliterationModulesExtra::IGNORE_KASHIDA_CTL
126 template<> struct typed_flags
<TransliterationFlags
> : is_typed_flags
<TransliterationFlags
, 0x7fffffff> {};
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */