Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / linguistic / source / convdiclist.hxx
blob5176244403cd1164b811de20829f0e3aa3232e4c
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 .
20 #pragma once
22 #include <com/sun/star/linguistic2/XConversionDictionaryList.hpp>
23 #include <com/sun/star/lang/XComponent.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <cppuhelper/implbase.hxx>
26 #include <comphelper/interfacecontainer3.hxx>
27 #include <rtl/ref.hxx>
29 #include <linguistic/misc.hxx>
32 class ConvDicNameContainer;
35 class ConvDicList :
36 public cppu::WeakImplHelper
38 css::linguistic2::XConversionDictionaryList,
39 css::lang::XComponent,
40 css::lang::XServiceInfo
44 class MyAppExitListener : public linguistic::AppExitListener
46 ConvDicList & rMyDicList;
48 public:
49 explicit MyAppExitListener( ConvDicList &rDicList ) : rMyDicList( rDicList ) {}
50 virtual void AtExit() override;
53 ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> aEvtListeners;
54 rtl::Reference<ConvDicNameContainer> mxNameContainer;
55 rtl::Reference<MyAppExitListener> mxExitListener;
56 bool bDisposing;
58 ConvDicList( const ConvDicList & ) = delete;
59 ConvDicList & operator = (const ConvDicList &) = delete;
61 ConvDicNameContainer & GetNameContainer();
63 public:
64 ConvDicList();
65 virtual ~ConvDicList() override;
67 // XConversionDictionaryList
68 virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getDictionaryContainer( ) override;
69 virtual css::uno::Reference< css::linguistic2::XConversionDictionary > SAL_CALL addNewDictionary( const OUString& aName, const css::lang::Locale& aLocale, sal_Int16 nConversionDictionaryType ) override;
70 virtual css::uno::Sequence< OUString > SAL_CALL queryConversions( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, const css::lang::Locale& aLocale, sal_Int16 nConversionDictionaryType, css::linguistic2::ConversionDirection eDirection, sal_Int32 nTextConversionOptions ) override;
71 virtual sal_Int16 SAL_CALL queryMaxCharCount( const css::lang::Locale& aLocale, sal_Int16 nConversionDictionaryType, css::linguistic2::ConversionDirection eDirection ) override;
73 // XComponent
74 virtual void SAL_CALL dispose( ) override;
75 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
76 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
78 // XServiceInfo
79 virtual OUString SAL_CALL getImplementationName( ) override;
80 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
81 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
83 // non UNO-specific
84 void FlushDics();
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */