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_DEFAULT_NUMBERING_PROVIDER_HXX_ 28 #define _I18N_DEFAULT_NUMBERING_PROVIDER_HXX_ 29 30 #include <com/sun/star/text/XDefaultNumberingProvider.hpp> 31 #include <com/sun/star/text/XNumberingFormatter.hpp> 32 #include <com/sun/star/text/XNumberingTypeInfo.hpp> 33 #include <com/sun/star/lang/XServiceInfo.hpp> 34 #include <cppuhelper/implbase4.hxx> 35 #include <com/sun/star/i18n/XTransliteration.hpp> 36 #include <com/sun/star/container/XHierarchicalNameAccess.hpp> 37 38 #include <transliterationImpl.hxx> 39 40 namespace com { namespace sun { namespace star { namespace i18n { 41 42 class DefaultNumberingProvider : public cppu::WeakImplHelper4 43 < 44 com::sun::star::text::XDefaultNumberingProvider, 45 com::sun::star::text::XNumberingFormatter, 46 com::sun::star::text::XNumberingTypeInfo, 47 com::sun::star::lang::XServiceInfo 48 > 49 { 50 void GetCharStrN( sal_Int32 nValue, sal_Int16 nType, rtl::OUString& rStr ) const; 51 void GetCharStr( sal_Int32 nValue, sal_Int16 nType, rtl::OUString& rStr ) const; 52 void GetRomanString( sal_Int32 nValue, sal_Int16 nType, rtl::OUString& rStr ) const; 53 void impl_loadTranslit(); 54 public: 55 DefaultNumberingProvider( 56 const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xMSF ); 57 ~DefaultNumberingProvider(); 58 59 //XDefaultNumberingProvider 60 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Reference< 61 com::sun::star::container::XIndexAccess > > SAL_CALL 62 getDefaultOutlineNumberings( const com::sun::star::lang::Locale& aLocale ) 63 throw(com::sun::star::uno::RuntimeException); 64 65 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< 66 com::sun::star::beans::PropertyValue > > SAL_CALL 67 getDefaultContinuousNumberingLevels( const com::sun::star::lang::Locale& aLocale ) 68 throw(com::sun::star::uno::RuntimeException); 69 70 //XNumberingFormatter 71 virtual rtl::OUString SAL_CALL makeNumberingString( 72 const com::sun::star::uno::Sequence< 73 com::sun::star::beans::PropertyValue >& aProperties, 74 const com::sun::star::lang::Locale& aLocale ) 75 throw(com::sun::star::lang::IllegalArgumentException, 76 com::sun::star::uno::RuntimeException); 77 78 //XNumberingTypeInfo 79 virtual com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedNumberingTypes( ) 80 throw(com::sun::star::uno::RuntimeException); 81 virtual sal_Int16 SAL_CALL getNumberingType( const rtl::OUString& NumberingIdentifier ) 82 throw(com::sun::star::uno::RuntimeException); 83 virtual sal_Bool SAL_CALL hasNumberingType( const rtl::OUString& NumberingIdentifier ) 84 throw(com::sun::star::uno::RuntimeException); 85 virtual rtl::OUString SAL_CALL getNumberingIdentifier( sal_Int16 NumberingType ) 86 throw(com::sun::star::uno::RuntimeException); 87 88 //XServiceInfo 89 virtual rtl::OUString SAL_CALL getImplementationName(void) 90 throw( com::sun::star::uno::RuntimeException ); 91 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) 92 throw( com::sun::star::uno::RuntimeException ); 93 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) 94 throw( com::sun::star::uno::RuntimeException ); 95 private: 96 com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xSMgr; 97 com::sun::star::uno::Reference < com::sun::star::container::XHierarchicalNameAccess > xHierarchicalNameAccess; 98 TransliterationImpl* translit; 99 rtl::OUString SAL_CALL makeNumberingIdentifier( sal_Int16 index ) 100 throw(com::sun::star::uno::RuntimeException); 101 sal_Bool SAL_CALL isScriptFlagEnabled(const rtl::OUString& aName ) 102 throw(com::sun::star::uno::RuntimeException); 103 }; 104 } } } } 105 106 #endif 107