1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _I18N_TEXTCONERSION_HXX_ 28 #define _I18N_TEXTCONERSION_HXX_ 29 30 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 31 #include <com/sun/star/lang/XServiceInfo.hpp> 32 #include <com/sun/star/i18n/XExtendedTextConversion.hpp> 33 #include <cppuhelper/implbase2.hxx> // helper for implementations 34 35 namespace com { namespace sun { namespace star { namespace i18n { 36 37 // ---------------------------------------------------- 38 // class TextConversion 39 // ---------------------------------------------------- 40 class TextConversionImpl : public cppu::WeakImplHelper2 41 < 42 com::sun::star::i18n::XExtendedTextConversion, 43 com::sun::star::lang::XServiceInfo 44 > 45 { 46 public: 47 TextConversionImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ) : xMSF(rxMSF) {}; 48 49 // Methods 50 com::sun::star::i18n::TextConversionResult SAL_CALL 51 getConversions( const ::rtl::OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, 52 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nTextConversionType, 53 sal_Int32 nTextConversionOptions ) 54 throw( com::sun::star::uno::RuntimeException, 55 com::sun::star::lang::IllegalArgumentException, 56 com::sun::star::lang::NoSupportException ); 57 rtl::OUString SAL_CALL 58 getConversion( const ::rtl::OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, 59 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nTextConversionType, 60 sal_Int32 nTextConversionOptions ) 61 throw( com::sun::star::uno::RuntimeException, 62 com::sun::star::lang::IllegalArgumentException, 63 com::sun::star::lang::NoSupportException ); 64 rtl::OUString SAL_CALL 65 getConversionWithOffset( const ::rtl::OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, 66 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nTextConversionType, 67 sal_Int32 nTextConversionOptions, com::sun::star::uno::Sequence< sal_Int32 >& offset ) 68 throw( com::sun::star::uno::RuntimeException, 69 com::sun::star::lang::IllegalArgumentException, 70 com::sun::star::lang::NoSupportException ); 71 sal_Bool SAL_CALL 72 interactiveConversion( const ::com::sun::star::lang::Locale& aLocale, 73 sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions ) 74 throw( com::sun::star::uno::RuntimeException, 75 com::sun::star::lang::IllegalArgumentException, 76 com::sun::star::lang::NoSupportException ); 77 78 //XServiceInfo 79 rtl::OUString SAL_CALL 80 getImplementationName() 81 throw( com::sun::star::uno::RuntimeException ); 82 sal_Bool SAL_CALL 83 supportsService(const rtl::OUString& ServiceName) 84 throw( com::sun::star::uno::RuntimeException ); 85 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL 86 getSupportedServiceNames() 87 throw( com::sun::star::uno::RuntimeException ); 88 private : 89 com::sun::star::lang::Locale aLocale; 90 com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedTextConversion > xTC; 91 com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF; 92 93 void SAL_CALL getLocaleSpecificTextConversion( const com::sun::star::lang::Locale& rLocale ) 94 throw( com::sun::star::lang::NoSupportException ); 95 }; 96 97 } // i18n 98 } // star 99 } // sun 100 } // com 101 102 103 #endif 104