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_THESDSP_HXX
21 #define INCLUDED_LINGUISTIC_SOURCE_THESDSP_HXX
23 #include <com/sun/star/uno/Reference.h>
24 #include <com/sun/star/uno/Sequence.h>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/beans/XPropertyAccess.hpp>
27 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
28 #include <com/sun/star/lang/XComponent.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/lang/XServiceDisplayName.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/linguistic2/XThesaurus.hpp>
35 #include <cppuhelper/implbase1.hxx>
36 #include <cppuhelper/implbase5.hxx>
37 #include <cppuhelper/interfacecontainer.h>
39 #include <osl/mutex.hxx>
41 #include <boost/shared_ptr.hpp>
48 class ThesaurusDispatcher
:
49 public cppu::WeakImplHelper1
51 ::com::sun::star::linguistic2::XThesaurus
53 public LinguDispatcher
55 typedef boost::shared_ptr
< LangSvcEntries_Thes
> LangSvcEntries_Thes_Ptr_t
;
56 typedef std::map
< LanguageType
, LangSvcEntries_Thes_Ptr_t
> ThesSvcByLangMap_t
;
57 ThesSvcByLangMap_t aSvcMap
;
59 ::com::sun::star::uno::Reference
<
60 ::com::sun::star::linguistic2::XLinguProperties
> xPropSet
;
62 ThesaurusDispatcher(const ThesaurusDispatcher
&) SAL_DELETED_FUNCTION
;
63 ThesaurusDispatcher
& operator = (const ThesaurusDispatcher
&) SAL_DELETED_FUNCTION
;
65 inline ::com::sun::star::uno::Reference
<
66 ::com::sun::star::linguistic2::XLinguProperties
>
72 ThesaurusDispatcher();
73 virtual ~ThesaurusDispatcher();
76 virtual ::com::sun::star::uno::Sequence
<
77 ::com::sun::star::lang::Locale
> SAL_CALL
79 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual sal_Bool SAL_CALL
81 hasLocale( const ::com::sun::star::lang::Locale
& aLocale
)
82 throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
85 virtual ::com::sun::star::uno::Sequence
<
86 ::com::sun::star::uno::Reference
<
87 ::com::sun::star::linguistic2::XMeaning
> > SAL_CALL
88 queryMeanings( const OUString
& aTerm
,
89 const ::com::sun::star::lang::Locale
& aLocale
,
90 const ::com::sun::star::beans::PropertyValues
& aProperties
)
91 throw(::com::sun::star::lang::IllegalArgumentException
,
92 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 SetServiceList( const ::com::sun::star::lang::Locale
&rLocale
,
97 const ::com::sun::star::uno::Sequence
<
98 OUString
> &rSvcImplNames
) SAL_OVERRIDE
;
99 virtual ::com::sun::star::uno::Sequence
< OUString
>
100 GetServiceList( const ::com::sun::star::lang::Locale
&rLocale
) const SAL_OVERRIDE
;
102 GetDspType() const SAL_OVERRIDE
;
106 inline ::com::sun::star::uno::Reference
<
107 ::com::sun::star::linguistic2::XLinguProperties
>
108 ThesaurusDispatcher::GetPropSet()
110 return xPropSet
.is() ?
111 xPropSet
: xPropSet
= linguistic::GetLinguProperties();
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */