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