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