1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_LINGUISTIC_SOURCE_CONVDICLIST_HXX
21 #define INCLUDED_LINGUISTIC_SOURCE_CONVDICLIST_HXX
23 #include <com/sun/star/linguistic2/XConversionDictionaryList.hpp>
24 #include <com/sun/star/lang/XComponent.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <cppuhelper/implbase3.hxx>
27 #include <cppuhelper/interfacecontainer.h>
29 #include "linguistic/misc.hxx"
33 class ConvDicNameContainer
;
37 public cppu::WeakImplHelper3
39 ::com::sun::star::linguistic2::XConversionDictionaryList
,
40 ::com::sun::star::lang::XComponent
,
41 ::com::sun::star::lang::XServiceInfo
45 class MyAppExitListener
: public linguistic::AppExitListener
47 ConvDicList
& rMyDicList
;
50 MyAppExitListener( ConvDicList
&rDicList
) : rMyDicList( rDicList
) {}
51 virtual void AtExit() SAL_OVERRIDE
;
55 ::cppu::OInterfaceContainerHelper aEvtListeners
;
57 ConvDicNameContainer
*pNameContainer
;
58 ::com::sun::star::uno::Reference
<
59 ::com::sun::star::container::XNameContainer
> xNameContainer
;
61 MyAppExitListener
*pExitListener
;
62 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::
63 XTerminateListener
> xExitListener
;
67 ConvDicList( const ConvDicList
& ) SAL_DELETED_FUNCTION
;
68 ConvDicList
& operator = (const ConvDicList
&) SAL_DELETED_FUNCTION
;
70 ConvDicNameContainer
& GetNameContainer();
74 virtual ~ConvDicList();
76 // XConversionDictionaryList
77 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> SAL_CALL
getDictionaryContainer( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::linguistic2::XConversionDictionary
> SAL_CALL
addNewDictionary( const OUString
& aName
, const ::com::sun::star::lang::Locale
& aLocale
, sal_Int16 nConversionDictionaryType
) throw (::com::sun::star::lang::NoSupportException
, ::com::sun::star::container::ElementExistException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
queryConversions( const OUString
& aText
, sal_Int32 nStartPos
, sal_Int32 nLength
, const ::com::sun::star::lang::Locale
& aLocale
, sal_Int16 nConversionDictionaryType
, ::com::sun::star::linguistic2::ConversionDirection eDirection
, sal_Int32 nTextConversionOptions
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual sal_Int16 SAL_CALL
queryMaxCharCount( const ::com::sun::star::lang::Locale
& aLocale
, sal_Int16 nConversionDictionaryType
, ::com::sun::star::linguistic2::ConversionDirection eDirection
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 virtual void SAL_CALL
dispose( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
85 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
88 virtual OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
90 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
93 static inline OUString
94 getImplementationName_Static() throw();
95 static com::sun::star::uno::Sequence
< OUString
>
96 getSupportedServiceNames_Static() throw();
102 inline OUString
ConvDicList::getImplementationName_Static() throw()
104 return OUString( "com.sun.star.lingu2.ConvDicList" );
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */