merge the formfield patch from ooo-build
[ooovba.git] / i18npool / inc / nativenumbersupplier.hxx
blob96a09b6acd509173ef3d5902a65a9b4256a15f36
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: nativenumbersupplier.hxx,v $
10 * $Revision: 1.7 $
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_NATIVENUMBERSUPPLIER_HXX_
31 #define _I18N_NATIVENUMBERSUPPLIER_HXX_
33 #include <com/sun/star/i18n/XNativeNumberSupplier.hpp>
34 #include <com/sun/star/i18n/NativeNumberMode.hpp>
35 #include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp>
36 #include <cppuhelper/implbase2.hxx> // helper for implementations
37 #include <com/sun/star/lang/XServiceInfo.hpp>
39 namespace com { namespace sun { namespace star { namespace i18n {
41 // ----------------------------------------------------
42 // class NativeNumberSupplier
43 // ----------------------------------------------------
44 class NativeNumberSupplier : public cppu::WeakImplHelper2
46 com::sun::star::i18n::XNativeNumberSupplier,
47 com::sun::star::lang::XServiceInfo
50 public:
51 NativeNumberSupplier(sal_Bool _useOffset = sal_False) : useOffset(_useOffset) {}
53 // Methods
54 virtual ::rtl::OUString SAL_CALL getNativeNumberString( const ::rtl::OUString& aNumberString,
55 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nNativeNumberMode )
56 throw (::com::sun::star::uno::RuntimeException);
58 virtual sal_Bool SAL_CALL isValidNatNum( const ::com::sun::star::lang::Locale& aLocale,
59 sal_Int16 nNativeNumberMode )
60 throw (::com::sun::star::uno::RuntimeException);
62 virtual ::com::sun::star::i18n::NativeNumberXmlAttributes SAL_CALL convertToXmlAttributes(
63 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nNativeNumberMode )
64 throw (::com::sun::star::uno::RuntimeException);
66 virtual sal_Int16 SAL_CALL convertFromXmlAttributes(
67 const ::com::sun::star::i18n::NativeNumberXmlAttributes& aAttr )
68 throw (::com::sun::star::uno::RuntimeException);
70 //XServiceInfo
71 virtual rtl::OUString SAL_CALL getImplementationName()
72 throw( com::sun::star::uno::RuntimeException );
73 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
74 throw( com::sun::star::uno::RuntimeException );
75 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames()
76 throw( com::sun::star::uno::RuntimeException );
78 // following methods are not for XNativeNumberSupplier, they are for calling from transliterations
79 ::rtl::OUString SAL_CALL getNativeNumberString( const ::rtl::OUString& aNumberString,
80 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nNativeNumberMode,
81 com::sun::star::uno::Sequence< sal_Int32 >& offset )
82 throw (::com::sun::star::uno::RuntimeException);
83 sal_Unicode SAL_CALL getNativeNumberChar( const sal_Unicode inChar,
84 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nNativeNumberMode )
85 throw(com::sun::star::uno::RuntimeException) ;
87 private:
88 ::com::sun::star::lang::Locale aLocale;
89 sal_Bool useOffset;
92 } } } }
94 #endif