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: inputsequencechecker.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 ************************************************************************/
30 #ifndef _I18N_INPUTCHECKER_HXX_
31 #define _I18N_INPUTCHECKER_HXX_
33 #include <comphelper/processfactory.hxx>
34 #include <cppuhelper/implbase2.hxx> // helper for implementations
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
41 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
43 // ----------------------------------------------------
44 // class InputSequenceCheckerImpl
45 // ----------------------------------------------------
46 class InputSequenceCheckerImpl
: public cppu::WeakImplHelper2
48 com::sun::star::i18n::XExtendedInputSequenceChecker
,
49 com::sun::star::lang::XServiceInfo
53 InputSequenceCheckerImpl( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
54 InputSequenceCheckerImpl();
55 ~InputSequenceCheckerImpl();
57 virtual sal_Bool SAL_CALL
checkInputSequence(const rtl::OUString
& Text
, sal_Int32 nStartPos
,
58 sal_Unicode inputChar
, sal_Int16 inputCheckMode
) throw(com::sun::star::uno::RuntimeException
);
60 virtual sal_Int32 SAL_CALL
correctInputSequence(rtl::OUString
& Text
, sal_Int32 nStartPos
,
61 sal_Unicode inputChar
, sal_Int16 inputCheckMode
) throw(com::sun::star::uno::RuntimeException
);
64 virtual rtl::OUString SAL_CALL
getImplementationName() throw( com::sun::star::uno::RuntimeException
);
65 virtual sal_Bool SAL_CALL
supportsService(const rtl::OUString
& ServiceName
)
66 throw( com::sun::star::uno::RuntimeException
);
67 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getSupportedServiceNames()
68 throw( com::sun::star::uno::RuntimeException
);
72 const sal_Char
*serviceName
;
75 struct lookupTableItem
{
76 lookupTableItem(const sal_Char
* rLanguage
, const com::sun::star::uno::Reference
< com::sun::star::i18n::XExtendedInputSequenceChecker
>& rxISC
) :
77 aLanguage(rLanguage
), xISC(rxISC
) {}
78 const sal_Char
* aLanguage
;
79 com::sun::star::uno::Reference
< com::sun::star::i18n::XExtendedInputSequenceChecker
> xISC
;
81 std::vector
<lookupTableItem
*> lookupTable
;
82 lookupTableItem
*cachedItem
;
84 com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> xMSF
;
86 com::sun::star::uno::Reference
< com::sun::star::i18n::XExtendedInputSequenceChecker
>& SAL_CALL
getInputSequenceChecker(sal_Char
* rLanguage
)
87 throw (com::sun::star::uno::RuntimeException
);
88 sal_Char
* SAL_CALL
getLanguageByScripType(sal_Unicode cChar
, sal_Unicode nChar
);
93 #endif // _I18N_BREAKITERATOR_HXX_