bump product version to 4.2.0.1
[LibreOffice.git] / lingucomponent / source / spellcheck / spell / sspellimp.hxx
blob89ac20e8936dd139ccc044158ed05e0654367536
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 INCLUDED_LINGUCOMPONENT_SOURCE_SPELLCHECK_SPELL_SSPELLIMP_HXX
21 #define INCLUDED_LINGUCOMPONENT_SOURCE_SPELLCHECK_SPELL_SSPELLIMP_HXX
23 #include <uno/lbnames.h>
24 #include <cppuhelper/implbase1.hxx>
25 #include <cppuhelper/implbase6.hxx>
26 #include <com/sun/star/lang/XComponent.hpp>
27 #include <com/sun/star/lang/XInitialization.hpp>
28 #include <com/sun/star/lang/XServiceDisplayName.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/beans/PropertyValues.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/linguistic2/XSpellChecker.hpp>
33 #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
34 #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
36 #include <linguistic/misc.hxx>
37 #include <linguistic/lngprophelp.hxx>
39 #include <lingutil.hxx>
41 using namespace ::rtl;
42 using namespace ::com::sun::star::uno;
43 using namespace ::com::sun::star::beans;
44 using namespace ::com::sun::star::lang;
45 using namespace ::com::sun::star::linguistic2;
48 ///////////////////////////////////////////////////////////////////////////
51 class SpellChecker :
52 public cppu::WeakImplHelper6
54 XSpellChecker,
55 XLinguServiceEventBroadcaster,
56 XInitialization,
57 XComponent,
58 XServiceInfo,
59 XServiceDisplayName
62 Sequence< Locale > aSuppLocales;
63 Hunspell ** aDicts;
64 rtl_TextEncoding * aDEncs;
65 Locale * aDLocs;
66 OUString * aDNames;
67 sal_Int32 numdict;
69 ::cppu::OInterfaceContainerHelper aEvtListeners;
70 linguistic::PropertyHelper_Spelling* pPropHelper;
71 bool bDisposing;
73 // disallow copy-constructor and assignment-operator for now
74 SpellChecker(const SpellChecker &);
75 SpellChecker & operator = (const SpellChecker &);
77 linguistic::PropertyHelper_Spelling& GetPropHelper_Impl();
78 linguistic::PropertyHelper_Spelling& GetPropHelper()
80 return pPropHelper ? *pPropHelper : GetPropHelper_Impl();
83 sal_Int16 GetSpellFailure( const OUString &rWord, const Locale &rLocale );
84 Reference< XSpellAlternatives > GetProposals( const OUString &rWord, const Locale &rLocale );
86 public:
87 SpellChecker();
88 virtual ~SpellChecker();
90 // XSupportedLocales (for XSpellChecker)
91 virtual Sequence< Locale > SAL_CALL getLocales() throw(RuntimeException);
92 virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale ) throw(RuntimeException);
94 // XSpellChecker
95 virtual sal_Bool SAL_CALL isValid( const OUString& rWord, const Locale& rLocale, const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException);
96 virtual Reference< XSpellAlternatives > SAL_CALL spell( const OUString& rWord, const Locale& rLocale, const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException);
98 // XLinguServiceEventBroadcaster
99 virtual sal_Bool SAL_CALL addLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
100 virtual sal_Bool SAL_CALL removeLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
102 // XServiceDisplayName
103 virtual OUString SAL_CALL getServiceDisplayName( const Locale& rLocale ) throw(RuntimeException);
105 // XInitialization
106 virtual void SAL_CALL initialize( const Sequence< Any >& rArguments ) throw(Exception, RuntimeException);
108 // XComponent
109 virtual void SAL_CALL dispose() throw(RuntimeException);
110 virtual void SAL_CALL addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
111 virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
113 // XServiceInfo
114 virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
115 virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw(RuntimeException);
116 virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
119 static inline OUString getImplementationName_Static() throw();
120 static Sequence< OUString > getSupportedServiceNames_Static() throw();
123 inline OUString SpellChecker::getImplementationName_Static() throw()
125 return OUString( "org.openoffice.lingu.MySpellSpellChecker" );
129 ///////////////////////////////////////////////////////////////////////////
131 #endif
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */