LibreOffice Module unotools (master) 1
transliterationwrapper.hxx
Go to the documentation of this file.
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
20#ifndef INCLUDED_UNOTOOLS_TRANSLITERATIONWRAPPER_HXX
21#define INCLUDED_UNOTOOLS_TRANSLITERATIONWRAPPER_HXX
22
24#include <rtl/ustring.hxx>
26#include <i18nlangtag/lang.h>
27#include <com/sun/star/uno/Reference.hxx>
28
29namespace com::sun::star::uno { template <typename > class Sequence; }
30namespace com::sun::star::i18n { class XExtendedTransliteration; }
31namespace com::sun::star::uno { class XComponentContext; }
32enum class TransliterationFlags;
33
34namespace utl
35{
36
38{
39 css::uno::Reference< css::i18n::XExtendedTransliteration > xTrans;
42 mutable bool bFirstCall;
43
46
47 void loadModuleImpl() const;
48 void setLanguageLocaleImpl( LanguageType nLang );
49
50public:
51 TransliterationWrapper( const css::uno::Reference< css::uno::XComponentContext > & rxContext,
53
55
57
58 bool needLanguageForTheMode() const;
59
62 void loadModuleIfNeeded( LanguageType nLang );
63
76 void loadModuleByImplName( const OUString& rModuleName, LanguageType nLang );
77
82 OUString transliterate( const OUString& rStr,
83 sal_Int32 nStart, sal_Int32 nLen ) const;
84
85 // Wrapper implementations of class Transliteration
86 OUString transliterate( const OUString& rStr, LanguageType nLanguage,
87 sal_Int32 nStart, sal_Int32 nLen,
88 css::uno::Sequence <sal_Int32>* pOffset );
89
98 bool equals(
99 const OUString& rStr1, sal_Int32 nPos1, sal_Int32 nCount1, sal_Int32& nMatch1,
100 const OUString& rStr2, sal_Int32 nPos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) const;
101
102 sal_Int32 compareString( const OUString& rStr1, const OUString& rStr2 ) const;
103
104 // helpers
105
110 bool isEqual( const OUString& rStr1, const OUString& rStr2 ) const;
111
114 bool isMatch( const OUString& rStr1, const OUString& rStr2 ) const;
115
116};
117
118} // namespace utl
119
120#endif
121
122/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::i18n::XExtendedTransliteration > xTrans
OUString transliterate(const OUString &rStr, LanguageType nLanguage, sal_Int32 nStart, sal_Int32 nLen, css::uno::Sequence< sal_Int32 > *pOffset)
TransliterationWrapper(const TransliterationWrapper &)=delete
TransliterationWrapper & operator=(const TransliterationWrapper &)=delete
TransliterationWrapper(const css::uno::Reference< css::uno::XComponentContext > &rxContext, TransliterationFlags nType)
TransliterationFlags getType() const
QPRO_FUNC_TYPE nType
TransliterationFlags
#define UNOTOOLS_DLLPUBLIC