bump product version to 4.1.6.2
[LibreOffice.git] / linguistic / source / thesdsp.hxx
blob83832b40111eb6e36deddf942f52224fd221c705
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 #ifndef _LINGUISTIC_THESDSP_HXX_
21 #define _LINGUISTIC_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 <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
36 #include <cppuhelper/implbase1.hxx> // helper for implementations
37 #include <cppuhelper/implbase5.hxx> // helper for implementations
38 #include <cppuhelper/interfacecontainer.h>
40 #include <osl/mutex.hxx>
42 #include <boost/shared_ptr.hpp>
43 #include <map>
45 #include "lngopt.hxx"
49 class ThesaurusDispatcher :
50 public cppu::WeakImplHelper1
52 ::com::sun::star::linguistic2::XThesaurus
54 public LinguDispatcher
56 typedef boost::shared_ptr< LangSvcEntries_Thes > LangSvcEntries_Thes_Ptr_t;
57 typedef std::map< LanguageType, LangSvcEntries_Thes_Ptr_t > ThesSvcByLangMap_t;
58 ThesSvcByLangMap_t aSvcMap;
60 ::com::sun::star::uno::Reference<
61 ::com::sun::star::linguistic2::XLinguProperties > xPropSet;
63 // disallow copy-constructor and assignment-operator for now
64 ThesaurusDispatcher(const ThesaurusDispatcher &);
65 ThesaurusDispatcher & operator = (const ThesaurusDispatcher &);
67 inline ::com::sun::star::uno::Reference<
68 ::com::sun::star::linguistic2::XLinguProperties >
69 GetPropSet();
71 void ClearSvcList();
73 public:
74 ThesaurusDispatcher();
75 virtual ~ThesaurusDispatcher();
77 // XSupportedLocales
78 virtual ::com::sun::star::uno::Sequence<
79 ::com::sun::star::lang::Locale > SAL_CALL
80 getLocales()
81 throw(::com::sun::star::uno::RuntimeException);
82 virtual sal_Bool SAL_CALL
83 hasLocale( const ::com::sun::star::lang::Locale& aLocale )
84 throw(::com::sun::star::uno::RuntimeException);
86 // XThesaurus
87 virtual ::com::sun::star::uno::Sequence<
88 ::com::sun::star::uno::Reference<
89 ::com::sun::star::linguistic2::XMeaning > > SAL_CALL
90 queryMeanings( const OUString& aTerm,
91 const ::com::sun::star::lang::Locale& aLocale,
92 const ::com::sun::star::beans::PropertyValues& aProperties )
93 throw(::com::sun::star::lang::IllegalArgumentException,
94 ::com::sun::star::uno::RuntimeException);
96 // LinguDispatcher
97 virtual void
98 SetServiceList( const ::com::sun::star::lang::Locale &rLocale,
99 const ::com::sun::star::uno::Sequence<
100 OUString > &rSvcImplNames );
101 virtual ::com::sun::star::uno::Sequence< OUString >
102 GetServiceList( const ::com::sun::star::lang::Locale &rLocale ) const;
103 virtual DspType
104 GetDspType() const;
108 inline ::com::sun::star::uno::Reference<
109 ::com::sun::star::linguistic2::XLinguProperties >
110 ThesaurusDispatcher::GetPropSet()
112 return xPropSet.is() ?
113 xPropSet : xPropSet = linguistic::GetLinguProperties();
118 #endif
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */