LibreOffice Module i18npool (master)  1
textconversionImpl.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 #pragma once
20 
21 #include <com/sun/star/lang/XServiceInfo.hpp>
22 #include <com/sun/star/i18n/XExtendedTextConversion.hpp>
23 #include <cppuhelper/implbase.hxx>
24 
25 namespace com::sun::star::uno { class XComponentContext; }
26 
27 namespace i18npool {
28 
29 
30 
31 class TextConversionImpl final : public cppu::WeakImplHelper
32 <
33  css::i18n::XExtendedTextConversion,
34  css::lang::XServiceInfo
35 >
36 {
37 public:
38  TextConversionImpl( const css::uno::Reference < css::uno::XComponentContext >& rxContext ) : m_xContext(rxContext) {};
39 
40  // Methods
41  css::i18n::TextConversionResult SAL_CALL
42  getConversions( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength,
43  const css::lang::Locale& aLocale, sal_Int16 nTextConversionType,
44  sal_Int32 nTextConversionOptions ) override;
45  OUString SAL_CALL
46  getConversion( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength,
47  const css::lang::Locale& aLocale, sal_Int16 nTextConversionType,
48  sal_Int32 nTextConversionOptions ) override;
49  OUString SAL_CALL
50  getConversionWithOffset( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength,
51  const css::lang::Locale& aLocale, sal_Int16 nTextConversionType,
52  sal_Int32 nTextConversionOptions, css::uno::Sequence< sal_Int32 >& offset ) override;
53  sal_Bool SAL_CALL
54  interactiveConversion( const css::lang::Locale& aLocale,
55  sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions ) override;
56 
57  //XServiceInfo
58  OUString SAL_CALL
59  getImplementationName() override;
60  sal_Bool SAL_CALL
61  supportsService(const OUString& ServiceName) override;
62  css::uno::Sequence< OUString > SAL_CALL
63  getSupportedServiceNames() override;
64 private:
65  css::lang::Locale aLocale;
66  css::uno::Reference < css::i18n::XExtendedTextConversion > xTC;
67  css::uno::Reference < css::uno::XComponentContext > m_xContext;
68 
70  void getLocaleSpecificTextConversion( const css::lang::Locale& rLocale );
71 };
72 
73 } // i18npool
74 
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TextConversionImpl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
sal_Bool SAL_CALL interactiveConversion(const css::lang::Locale &aLocale, sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions) override
sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString SAL_CALL getConversionWithOffset(const OUString &aText, sal_Int32 nStartPos, sal_Int32 nLength, const css::lang::Locale &aLocale, sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions, css::uno::Sequence< sal_Int32 > &offset) override
OUString SAL_CALL getConversion(const OUString &aText, sal_Int32 nStartPos, sal_Int32 nLength, const css::lang::Locale &aLocale, sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions) override
css::uno::Reference< css::i18n::XExtendedTextConversion > xTC
void getLocaleSpecificTextConversion(const css::lang::Locale &rLocale)
unsigned char sal_Bool
Constant values shared between i18npool and, for example, the number formatter.
css::i18n::TextConversionResult SAL_CALL getConversions(const OUString &aText, sal_Int32 nStartPos, sal_Int32 nLength, const css::lang::Locale &aLocale, sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions) override
OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::uno::XComponentContext > m_xContext