Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / i18npool / inc / inputsequencechecker.hxx
blobc738d78d34119094f65e47d4eeb294db2d27349d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _I18N_INPUTCHECKER_HXX_
29 #define _I18N_INPUTCHECKER_HXX_
31 #include <comphelper/processfactory.hxx>
32 #include <cppuhelper/implbase2.hxx> // helper for implementations
33 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
37 #include <vector>
39 namespace com { namespace sun { namespace star { namespace i18n {
41 // ----------------------------------------------------
42 // class InputSequenceCheckerImpl
43 // ----------------------------------------------------
44 class InputSequenceCheckerImpl : public cppu::WeakImplHelper2
46 com::sun::star::i18n::XExtendedInputSequenceChecker,
47 com::sun::star::lang::XServiceInfo
50 public:
51 InputSequenceCheckerImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF );
52 InputSequenceCheckerImpl();
53 ~InputSequenceCheckerImpl();
55 virtual sal_Bool SAL_CALL checkInputSequence(const rtl::OUString& Text, sal_Int32 nStartPos,
56 sal_Unicode inputChar, sal_Int16 inputCheckMode) throw(com::sun::star::uno::RuntimeException);
58 virtual sal_Int32 SAL_CALL correctInputSequence(rtl::OUString& Text, sal_Int32 nStartPos,
59 sal_Unicode inputChar, sal_Int16 inputCheckMode) throw(com::sun::star::uno::RuntimeException);
61 //XServiceInfo
62 virtual rtl::OUString SAL_CALL getImplementationName() throw( com::sun::star::uno::RuntimeException );
63 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
64 throw( com::sun::star::uno::RuntimeException );
65 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames()
66 throw( com::sun::star::uno::RuntimeException );
68 protected:
69 sal_Int16 checkMode;
70 const sal_Char *serviceName;
72 private :
73 struct lookupTableItem {
74 lookupTableItem(const sal_Char* rLanguage, const com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedInputSequenceChecker >& rxISC) :
75 aLanguage(rLanguage), xISC(rxISC) {}
76 const sal_Char* aLanguage;
77 com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedInputSequenceChecker > xISC;
79 std::vector<lookupTableItem*> lookupTable;
80 lookupTableItem *cachedItem;
82 com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
84 com::sun::star::uno::Reference< com::sun::star::i18n::XExtendedInputSequenceChecker >& SAL_CALL getInputSequenceChecker(sal_Char* rLanguage)
85 throw (com::sun::star::uno::RuntimeException);
86 sal_Char* SAL_CALL getLanguageByScripType(sal_Unicode cChar, sal_Unicode nChar);
89 } } } }
91 #endif // _I18N_BREAKITERATOR_HXX_
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */