tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / i18npool / inc / transliteration_OneToOne.hxx
blobc8e885f024339fbbb7fe9dd92115e5e9c417482a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include "transliteration_commonclass.hxx"
23 namespace i18nutil { class oneToOneMapping; }
25 namespace i18npool {
27 typedef sal_Unicode (*TransFunc)(const sal_Unicode);
29 class transliteration_OneToOne : public transliteration_commonclass
31 public:
32 OUString
33 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
35 sal_Unicode SAL_CALL
36 transliterateChar2Char( sal_Unicode inChar) override;
38 // Methods which are shared.
39 sal_Int16 SAL_CALL getType() override;
41 OUString
42 foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
44 sal_Bool SAL_CALL
45 equals( const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
46 const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) override;
48 css::uno::Sequence< OUString > SAL_CALL
49 transliterateRange( const OUString& str1, const OUString& str2 ) override;
51 protected:
52 TransFunc func;
53 i18nutil::oneToOneMapping *table;
56 #define TRANSLITERATION_ONETOONE( name ) \
57 class name final : public transliteration_OneToOne \
58 { \
59 public: \
60 name (); \
61 OUString \
62 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) \
63 override; \
64 sal_Unicode SAL_CALL \
65 transliterateChar2Char( sal_Unicode inChar) \
66 override; \
69 TRANSLITERATION_ONETOONE( fullwidthToHalfwidth )
70 TRANSLITERATION_ONETOONE( FULLWIDTHKATAKANA_HALFWIDTHKATAKANA )
71 TRANSLITERATION_ONETOONE( FULLWIDTH_HALFWIDTH_LIKE_ASC )
73 class halfwidthToFullwidth final : public transliteration_OneToOne
75 public:
76 halfwidthToFullwidth();
77 OUString
78 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
80 class HALFWIDTHKATAKANA_FULLWIDTHKATAKANA final : public transliteration_OneToOne
82 public:
83 HALFWIDTHKATAKANA_FULLWIDTHKATAKANA();
84 OUString
85 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
87 class HALFWIDTH_FULLWIDTH_LIKE_JIS final : public transliteration_OneToOne
89 public:
90 HALFWIDTH_FULLWIDTH_LIKE_JIS();
91 OUString
92 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
95 #undef TRANSLITERATION_ONETOONE
97 #define TRANSLITERATION_ONETOONE( name ) \
98 class name final : public transliteration_OneToOne \
99 { \
100 public: \
101 name (); \
104 TRANSLITERATION_ONETOONE(hiraganaToKatakana)
105 TRANSLITERATION_ONETOONE(katakanaToHiragana)
106 TRANSLITERATION_ONETOONE(largeToSmall_ja_JP)
107 TRANSLITERATION_ONETOONE(smallToLarge_ja_JP)
109 #undef TRANSLITERATION_ONETOONE
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */