Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/i18npool/inc/transliteration_body.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
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/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
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 .
18
 */
19
#pragma once
20
21
#include "transliteration_commonclass.hxx"
22
#include <i18nutil/casefolding.hxx>
23
24
namespace i18npool {
25
26
class Transliteration_body : public transliteration_commonclass
27
{
28
public:
29
    Transliteration_body();
30
31
    // Methods which are shared.
32
    sal_Int16 SAL_CALL getType() override;
33
34
    OUString transliterateImpl(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
35
        css::uno::Sequence< sal_Int32 >* pOffset) override;
36
37
        OUString SAL_CALL
38
        transliterateChar2String( sal_Unicode inChar) override;
39
40
        virtual sal_Unicode SAL_CALL
41
        transliterateChar2Char( sal_Unicode inChar) override;
42
43
    OUString foldingImpl(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
44
        css::uno::Sequence< sal_Int32 >* pOffset) override;
45
46
    sal_Bool SAL_CALL equals(
47
        const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
48
        const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) override;
49
50
    css::uno::Sequence< OUString > SAL_CALL transliterateRange( const OUString& str1,
51
        const OUString& str2 ) override;
52
53
protected:
54
    MappingType nMappingType;
55
};
56
57
class Transliteration_u2l final : public Transliteration_body
58
{
59
public:
60
    Transliteration_u2l();
61
};
62
63
class Transliteration_l2u final : public Transliteration_body
64
{
65
public:
66
    Transliteration_l2u();
67
};
68
69
class Transliteration_casemapping final : public Transliteration_body
70
{
71
public:
72
    Transliteration_casemapping();
73
    void setMappingType( const MappingType rMappingType )
74
2.09M
    {
75
2.09M
        if (nMappingType != rMappingType)
76
2.09M
            nMappingType = rMappingType;
77
2.09M
    }
78
    void setLocale( const css::lang::Locale& rLocale )
79
134M
    {
80
134M
        if (aLocale != rLocale)
81
511k
            aLocale = rLocale;
82
134M
    }
83
};
84
85
class Transliteration_togglecase final : public Transliteration_body
86
{
87
public:
88
    Transliteration_togglecase();
89
};
90
91
class Transliteration_titlecase final : public Transliteration_body
92
{
93
public:
94
    Transliteration_titlecase();
95
96
    virtual OUString transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
97
                                        css::uno::Sequence< sal_Int32 >* pOffset ) override;
98
};
99
100
class Transliteration_sentencecase final : public Transliteration_body
101
{
102
public:
103
    Transliteration_sentencecase();
104
105
    virtual OUString transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
106
                                        css::uno::Sequence< sal_Int32 >* pOffset ) override;
107
};
108
109
}
110
111
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */