1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: thesdsp.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _LINGUISTIC_THESDSP_HXX_
32 #define _LINGUISTIC_THESDSP_HXX_
34 #include <com/sun/star/uno/Reference.h>
35 #include <com/sun/star/uno/Sequence.h>
36 #include <com/sun/star/beans/XPropertySet.hpp>
37 #include <com/sun/star/beans/XPropertyAccess.hpp>
38 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
39 #include <com/sun/star/lang/XComponent.hpp>
40 #include <com/sun/star/lang/XInitialization.hpp>
41 #include <com/sun/star/lang/XServiceDisplayName.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/linguistic2/XThesaurus.hpp>
46 #include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
47 #include <cppuhelper/implbase1.hxx> // helper for implementations
48 #include <cppuhelper/implbase5.hxx> // helper for implementations
49 #include <cppuhelper/interfacecontainer.h>
51 #include <vos/mutex.hxx>
53 #include <boost/shared_ptr.hpp>
59 ///////////////////////////////////////////////////////////////////////////
61 class ThesaurusDispatcher
:
62 public cppu::WeakImplHelper1
64 ::com::sun::star::linguistic2::XThesaurus
66 public LinguDispatcher
68 typedef boost::shared_ptr
< LangSvcEntries_Thes
> LangSvcEntries_Thes_Ptr_t
;
69 typedef std::map
< LanguageType
, LangSvcEntries_Thes_Ptr_t
> ThesSvcByLangMap_t
;
70 ThesSvcByLangMap_t aSvcMap
;
72 ::com::sun::star::uno::Reference
<
73 ::com::sun::star::beans::XPropertySet
> xPropSet
;
75 // disallow copy-constructor and assignment-operator for now
76 ThesaurusDispatcher(const ThesaurusDispatcher
&);
77 ThesaurusDispatcher
& operator = (const ThesaurusDispatcher
&);
79 inline ::com::sun::star::uno::Reference
<
80 ::com::sun::star::beans::XPropertySet
>
86 ThesaurusDispatcher();
87 virtual ~ThesaurusDispatcher();
90 virtual ::com::sun::star::uno::Sequence
<
91 ::com::sun::star::lang::Locale
> SAL_CALL
93 throw(::com::sun::star::uno::RuntimeException
);
94 virtual sal_Bool SAL_CALL
95 hasLocale( const ::com::sun::star::lang::Locale
& aLocale
)
96 throw(::com::sun::star::uno::RuntimeException
);
99 virtual ::com::sun::star::uno::Sequence
<
100 ::com::sun::star::uno::Reference
<
101 ::com::sun::star::linguistic2::XMeaning
> > SAL_CALL
102 queryMeanings( const ::rtl::OUString
& aTerm
,
103 const ::com::sun::star::lang::Locale
& aLocale
,
104 const ::com::sun::star::beans::PropertyValues
& aProperties
)
105 throw(::com::sun::star::lang::IllegalArgumentException
,
106 ::com::sun::star::uno::RuntimeException
);
110 SetServiceList( const ::com::sun::star::lang::Locale
&rLocale
,
111 const ::com::sun::star::uno::Sequence
<
112 rtl::OUString
> &rSvcImplNames
);
113 virtual ::com::sun::star::uno::Sequence
< rtl::OUString
>
114 GetServiceList( const ::com::sun::star::lang::Locale
&rLocale
) const;
120 inline ::com::sun::star::uno::Reference
<
121 ::com::sun::star::beans::XPropertySet
>
122 ThesaurusDispatcher::GetPropSet()
124 return xPropSet
.is() ?
125 xPropSet
: xPropSet
= linguistic::GetLinguProperties();
129 ///////////////////////////////////////////////////////////////////////////