Line data Source code
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_LINGUISTIC_SOURCE_CONVDICLIST_HXX
21 : #define INCLUDED_LINGUISTIC_SOURCE_CONVDICLIST_HXX
22 :
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>
28 :
29 : #include "linguistic/misc.hxx"
30 : #include "lngopt.hxx"
31 :
32 :
33 : class ConvDicNameContainer;
34 :
35 :
36 : class ConvDicList :
37 : public cppu::WeakImplHelper3
38 : <
39 : ::com::sun::star::linguistic2::XConversionDictionaryList,
40 : ::com::sun::star::lang::XComponent,
41 : ::com::sun::star::lang::XServiceInfo
42 : >
43 : {
44 :
45 8 : class MyAppExitListener : public linguistic::AppExitListener
46 : {
47 : ConvDicList & rMyDicList;
48 :
49 : public:
50 4 : MyAppExitListener( ConvDicList &rDicList ) : rMyDicList( rDicList ) {}
51 : virtual void AtExit() SAL_OVERRIDE;
52 : };
53 :
54 :
55 : ::cppu::OInterfaceContainerHelper aEvtListeners;
56 :
57 : ConvDicNameContainer *pNameContainer;
58 : ::com::sun::star::uno::Reference<
59 : ::com::sun::star::container::XNameContainer > xNameContainer;
60 :
61 : MyAppExitListener *pExitListener;
62 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::
63 : XTerminateListener > xExitListener;
64 :
65 : bool bDisposing;
66 :
67 : // disallow copy-constructor and assignment-operator for now
68 : ConvDicList( const ConvDicList & );
69 : ConvDicList & operator = (const ConvDicList &);
70 :
71 : ConvDicNameContainer & GetNameContainer();
72 :
73 : public:
74 : ConvDicList();
75 : virtual ~ConvDicList();
76 :
77 : // XConversionDictionaryList
78 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getDictionaryContainer( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 : 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;
80 : 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;
81 : 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;
82 :
83 : // XComponent
84 : virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 : 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;
86 : 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;
87 :
88 : // XServiceInfo
89 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
90 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
91 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 :
93 :
94 : static inline OUString
95 : getImplementationName_Static() throw();
96 : static com::sun::star::uno::Sequence< OUString >
97 : getSupportedServiceNames_Static() throw();
98 :
99 : // non UNO-specific
100 : void FlushDics();
101 : };
102 :
103 10 : inline OUString ConvDicList::getImplementationName_Static() throw()
104 : {
105 10 : return OUString( "com.sun.star.lingu2.ConvDicList" );
106 : }
107 :
108 :
109 : #endif
110 :
111 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|