1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _LINGU2_THESIMP_HXX_
29 #define _LINGU2_THESIMP_HXX_
31 #include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
32 #include <cppuhelper/implbase1.hxx> // helper for implementations
33 #include <cppuhelper/implbase5.hxx> // helper for implementations
34 #include <com/sun/star/uno/Reference.h>
35 #include <com/sun/star/uno/Sequence.h>
36 #include <com/sun/star/lang/XComponent.hpp>
37 #include <com/sun/star/lang/XInitialization.hpp>
38 #include <com/sun/star/lang/XServiceDisplayName.hpp>
39 #include <com/sun/star/beans/XPropertySet.hpp>
40 #include <com/sun/star/beans/PropertyValues.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/linguistic2/XMeaning.hpp>
44 #include <com/sun/star/linguistic2/XThesaurus.hpp>
46 #include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
47 #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
49 #include <tools/table.hxx>
51 #include <unotools/charclass.hxx>
53 #include <lingutil.hxx>
54 #include <linguistic/misc.hxx>
55 #include <linguistic/lngprophelp.hxx>
57 #include <osl/file.hxx>
60 using namespace ::rtl
;
61 using namespace ::com::sun::star::uno
;
62 using namespace ::com::sun::star::beans
;
63 using namespace ::com::sun::star::lang
;
64 using namespace ::com::sun::star::linguistic2
;
66 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{
72 ///////////////////////////////////////////////////////////////////////////
76 public cppu::WeakImplHelper5
85 Sequence
< Locale
> aSuppLocales
;
87 ::cppu::OInterfaceContainerHelper aEvtListeners
;
88 Reference
< XPropertyChangeListener
> xPropHelper
;
89 linguistic::PropertyHelper_Thes
* pPropHelper
;
91 CharClass
** aCharSetInfo
;
93 rtl_TextEncoding
* aTEncs
;
98 // cache for the Thesaurus dialog
99 Sequence
< Reference
< ::com::sun::star::linguistic2::XMeaning
> > prevMeanings
;
103 // disallow copy-constructor and assignment-operator for now
104 Thesaurus(const Thesaurus
&);
105 Thesaurus
& operator = (const Thesaurus
&);
107 linguistic::PropertyHelper_Thes
& GetPropHelper_Impl();
108 linguistic::PropertyHelper_Thes
& GetPropHelper()
110 return pPropHelper
? *pPropHelper
: GetPropHelper_Impl();
116 virtual ~Thesaurus();
118 // XSupportedLocales (for XThesaurus)
119 virtual Sequence
< Locale
> SAL_CALL
121 throw(RuntimeException
);
122 virtual sal_Bool SAL_CALL
123 hasLocale( const Locale
& rLocale
)
124 throw(RuntimeException
);
127 virtual Sequence
< Reference
< ::com::sun::star::linguistic2::XMeaning
> > SAL_CALL
128 queryMeanings( const OUString
& rTerm
, const Locale
& rLocale
,
129 const PropertyValues
& rProperties
)
130 throw(IllegalArgumentException
,
133 // XServiceDisplayName
134 virtual OUString SAL_CALL
135 getServiceDisplayName( const Locale
& rLocale
)
136 throw(RuntimeException
);
139 virtual void SAL_CALL
140 initialize( const Sequence
< Any
>& rArguments
)
141 throw(Exception
, RuntimeException
);
144 virtual void SAL_CALL
146 throw(RuntimeException
);
147 virtual void SAL_CALL
148 addEventListener( const Reference
< XEventListener
>& rxListener
)
149 throw(RuntimeException
);
150 virtual void SAL_CALL
151 removeEventListener( const Reference
< XEventListener
>& rxListener
)
152 throw(RuntimeException
);
154 ////////////////////////////////////////////////////////////
155 // Service specific part
159 virtual OUString SAL_CALL
160 getImplementationName()
161 throw(RuntimeException
);
162 virtual sal_Bool SAL_CALL
163 supportsService( const OUString
& rServiceName
)
164 throw(RuntimeException
);
165 virtual Sequence
< OUString
> SAL_CALL
166 getSupportedServiceNames()
167 throw(RuntimeException
);
170 static inline OUString
171 getImplementationName_Static() throw();
172 static Sequence
< OUString
>
173 getSupportedServiceNames_Static() throw();
176 sal_uInt16 SAL_CALL
capitalType(const OUString
&, CharClass
*);
177 OUString SAL_CALL
makeLowerCase(const OUString
&, CharClass
*);
178 OUString SAL_CALL
makeUpperCase(const OUString
&, CharClass
*);
179 OUString SAL_CALL
makeInitCap(const OUString
&, CharClass
*);
181 /* static ::com::sun::star::uno::Reference<
182 ::com::sun::star::linguistic2::XLinguServiceManager > xLngSvcMgr;
183 static ::com::sun::star::uno::Reference<
184 ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
186 static ::com::sun::star::uno::Reference
<
187 ::com::sun::star::linguistic2::XLinguServiceManager
> GetLngSvcMgr();
191 inline OUString
Thesaurus::getImplementationName_Static() throw()
193 return A2OU( "org.openoffice.lingu.new.Thesaurus" );
197 ///////////////////////////////////////////////////////////////////////////