merge the formfield patch from ooo-build
[ooovba.git] / linguistic / source / grammarchecker.hxx
blobb812c62177314f8b45f37cc6ea95415fd42e0aa1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: grammarchecker.hxx,v $
10 * $Revision: 1.4 $
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_GRAMMARCHECKER_HXX_
32 #define _LINGUISTIC_GRAMMARCHECKER_HXX_
35 #include <com/sun/star/lang/XComponent.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/linguistic2/XGrammarChecker.hpp>
38 #include <com/sun/star/linguistic2/SingleGrammarError.hpp>
39 #include <com/sun/star/linguistic2/XSupportedLocales.hpp>
41 #include <cppuhelper/implbase3.hxx>
42 #include <cppuhelper/interfacecontainer.h>
44 #include <map>
47 class GrammarChecker:
48 public cppu::WeakImplHelper3
50 ::com::sun::star::linguistic2::XGrammarChecker,
51 ::com::sun::star::lang::XComponent,
52 ::com::sun::star::lang::XServiceInfo
55 // com::sun::star::uno::Reference< uno::XComponentContext > m_xContext;
57 // disallow use of copy c-tor and assignment operator
58 GrammarChecker( const GrammarChecker & );
59 GrammarChecker & operator = ( const GrammarChecker & );
61 public:
62 explicit GrammarChecker( /* uno::Reference< uno::XComponentContext > const & rXContext */ );
63 virtual ~GrammarChecker();
65 // XSupportedLocales
66 virtual ::sal_Bool SAL_CALL hasLocale( const ::com::sun::star::lang::Locale & aLocale) throw (::com::sun::star::uno::RuntimeException);
67 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales( ) throw ( ::com::sun::star::uno::RuntimeException );
69 // XGrammarChecker
70 virtual ::sal_Bool SAL_CALL isSpellChecker( ) throw (::com::sun::star::uno::RuntimeException);
71 virtual void SAL_CALL startDocument( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
72 virtual void SAL_CALL startParagraph( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
73 virtual void SAL_CALL endParagraph( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
74 virtual void SAL_CALL endDocument( ::sal_Int32 nDocId ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
75 virtual ::com::sun::star::linguistic2::GrammarCheckingResult SAL_CALL doGrammarChecking( ::sal_Int32 nDocId, const ::rtl::OUString& aText, const ::com::sun::star::lang::Locale& aLocale, ::sal_Int32 nStartOfSentencePos, ::sal_Int32 nSuggestedEndOfSentencePos, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& aLanguagePortions, const ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale >& aLanguagePortionsLocales ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
76 virtual ::sal_Bool SAL_CALL hasOptionsDialog( ) throw (::com::sun::star::uno::RuntimeException);
77 virtual void SAL_CALL runOptionsDialog( ) throw (::com::sun::star::uno::RuntimeException);
79 // XComponent
80 virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException);
81 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw ( ::com::sun::star::uno::RuntimeException );
82 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
84 // XServiceInfo
85 virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
86 virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
87 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
89 static inline ::rtl::OUString getImplementationName_Static();
90 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
92 ::com::sun::star::uno::Sequence< ::com::sun::star::linguistic2::SingleGrammarError > GrammarCheckingInDummy(
93 ::sal_Int32 nDocId, const ::rtl::OUString &rFlatParaText, const ::com::sun::star::lang::Locale & rLocale,
94 ::sal_Int32 nStartOfSentencePos, ::sal_Int32 nSuggestedSentenceEndPos );
97 inline ::osl::Mutex & GetMutex()
99 static osl::Mutex aMutex;
100 return aMutex;
104 inline ::rtl::OUString GrammarChecker::getImplementationName_Static()
106 return A2OU( "com.sun.star.lingu2.GrammarChecker" );
110 #endif