1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _I18N_TEXTCONERSION_HXX_ 24 #define _I18N_TEXTCONERSION_HXX_ 25 26 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 27 #include <com/sun/star/lang/XServiceInfo.hpp> 28 #include <com/sun/star/i18n/XExtendedTextConversion.hpp> 29 #include <cppuhelper/implbase2.hxx> // helper for implementations 30 31 namespace com { namespace sun { namespace star { namespace i18n { 32 33 // ---------------------------------------------------- 34 // class TextConversion 35 // ---------------------------------------------------- 36 class TextConversionImpl : public cppu::WeakImplHelper2 37 < 38 com::sun::star::i18n::XExtendedTextConversion, 39 com::sun::star::lang::XServiceInfo 40 > 41 { 42 public: TextConversionImpl(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> & rxMSF)43 TextConversionImpl( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ) : xMSF(rxMSF) {}; 44 45 // Methods 46 com::sun::star::i18n::TextConversionResult SAL_CALL 47 getConversions( const ::rtl::OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, 48 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nTextConversionType, 49 sal_Int32 nTextConversionOptions ) 50 throw( com::sun::star::uno::RuntimeException, 51 com::sun::star::lang::IllegalArgumentException, 52 com::sun::star::lang::NoSupportException ); 53 rtl::OUString SAL_CALL 54 getConversion( const ::rtl::OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, 55 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nTextConversionType, 56 sal_Int32 nTextConversionOptions ) 57 throw( com::sun::star::uno::RuntimeException, 58 com::sun::star::lang::IllegalArgumentException, 59 com::sun::star::lang::NoSupportException ); 60 rtl::OUString SAL_CALL 61 getConversionWithOffset( const ::rtl::OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, 62 const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nTextConversionType, 63 sal_Int32 nTextConversionOptions, com::sun::star::uno::Sequence< sal_Int32 >& offset ) 64 throw( com::sun::star::uno::RuntimeException, 65 com::sun::star::lang::IllegalArgumentException, 66 com::sun::star::lang::NoSupportException ); 67 sal_Bool SAL_CALL 68 interactiveConversion( const ::com::sun::star::lang::Locale& aLocale, 69 sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions ) 70 throw( com::sun::star::uno::RuntimeException, 71 com::sun::star::lang::IllegalArgumentException, 72 com::sun::star::lang::NoSupportException ); 73 74 //XServiceInfo 75 rtl::OUString SAL_CALL 76 getImplementationName() 77 throw( com::sun::star::uno::RuntimeException ); 78 sal_Bool SAL_CALL 79 supportsService(const rtl::OUString& ServiceName) 80 throw( com::sun::star::uno::RuntimeException ); 81 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL 82 getSupportedServiceNames() 83 throw( com::sun::star::uno::RuntimeException ); 84 private : 85 com::sun::star::lang::Locale aLocale; 86 com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedTextConversion > xTC; 87 com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF; 88 89 void SAL_CALL getLocaleSpecificTextConversion( const com::sun::star::lang::Locale& rLocale ) 90 throw( com::sun::star::lang::NoSupportException ); 91 }; 92 93 } // i18n 94 } // star 95 } // sun 96 } // com 97 98 99 #endif 100