xref: /aoo41x/main/i18npool/inc/localedata.hxx (revision f7bd9df4)
1*f7bd9df4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f7bd9df4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f7bd9df4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f7bd9df4SAndrew Rist  * distributed with this work for additional information
6*f7bd9df4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f7bd9df4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f7bd9df4SAndrew Rist  * "License"); you may not use this file except in compliance
9*f7bd9df4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f7bd9df4SAndrew Rist  *
11*f7bd9df4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f7bd9df4SAndrew Rist  *
13*f7bd9df4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f7bd9df4SAndrew Rist  * software distributed under the License is distributed on an
15*f7bd9df4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f7bd9df4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f7bd9df4SAndrew Rist  * specific language governing permissions and limitations
18*f7bd9df4SAndrew Rist  * under the License.
19*f7bd9df4SAndrew Rist  *
20*f7bd9df4SAndrew Rist  *************************************************************/
21*f7bd9df4SAndrew Rist 
22*f7bd9df4SAndrew Rist 
23cdf0e10cSrcweir #ifndef _I18N_LOCALEDATA_HXX_
24cdf0e10cSrcweir #define _I18N_LOCALEDATA_HXX_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <com/sun/star/i18n/XLocaleData2.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> // helper for implementations
34cdf0e10cSrcweir #include <cppu/macros.hxx>
35cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.h>
38cdf0e10cSrcweir #include <com/sun/star/i18n/Calendar.hpp>
39cdf0e10cSrcweir #include <com/sun/star/i18n/FormatElement.hpp>
40cdf0e10cSrcweir #include <com/sun/star/i18n/Currency.hpp>
41cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp>
42cdf0e10cSrcweir #include <com/sun/star/i18n/LocaleDataItem.hpp>
43cdf0e10cSrcweir #include <com/sun/star/i18n/UnicodeScript.hpp>
44cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp>
45cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
46cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp>
47cdf0e10cSrcweir #include <rtl/ustring.hxx>
48cdf0e10cSrcweir #include <vector>
49cdf0e10cSrcweir #include <memory>
50cdf0e10cSrcweir #include <osl/module.hxx>
51cdf0e10cSrcweir 
52cdf0e10cSrcweir //
53cdf0e10cSrcweir #include <defaultnumberingprovider.hxx>
54cdf0e10cSrcweir #include <com/sun/star/style/NumberingType.hpp>
55cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
56cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientation.hpp>
57cdf0e10cSrcweir //
58cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
59cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp>
60cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
61cdf0e10cSrcweir 
62cdf0e10cSrcweir struct LocaleDataLookupTableItem;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace i18n {
65cdf0e10cSrcweir 
operator ==(const com::sun::star::lang::Locale & l1,const com::sun::star::lang::Locale & l2)66cdf0e10cSrcweir inline sal_Bool operator ==(const com::sun::star::lang::Locale& l1, const com::sun::star::lang::Locale& l2) {
67cdf0e10cSrcweir     return l1.Language == l2.Language && l1.Country == l2.Country && l1.Variant == l2.Variant;
68cdf0e10cSrcweir };
69cdf0e10cSrcweir 
70cdf0e10cSrcweir class LocaleData : public cppu::WeakImplHelper2
71cdf0e10cSrcweir <
72cdf0e10cSrcweir 	XLocaleData2,
73cdf0e10cSrcweir 	com::sun::star::lang::XServiceInfo
74cdf0e10cSrcweir >
75cdf0e10cSrcweir {
76cdf0e10cSrcweir public:
77cdf0e10cSrcweir     LocaleData();
78cdf0e10cSrcweir     ~LocaleData();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	virtual LanguageCountryInfo SAL_CALL getLanguageCountryInfo( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir 	virtual LocaleDataItem SAL_CALL getLocaleItem( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
82cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Calendar > SAL_CALL getAllCalendars( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
83cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Currency > SAL_CALL getAllCurrencies( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
84cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Currency2 > SAL_CALL getAllCurrencies2( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
85cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< FormatElement > SAL_CALL getAllFormats( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
86cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Implementation > SAL_CALL getCollatorImplementations( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
87cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getCollatorRuleByAlgorithm( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
88cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getTransliterations( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
89cdf0e10cSrcweir 	virtual ForbiddenCharacters SAL_CALL getForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getReservedWord( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException) ;
91cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getBreakIteratorRules( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException) ;
92cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< com::sun::star::lang::Locale > SAL_CALL getAllInstalledLocaleNames() throw(com::sun::star::uno::RuntimeException);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSearchOptions( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getCollationOptions( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< beans::PropertyValue > > SAL_CALL getContinuousNumberingLevels( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
97cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< com::sun::star::uno::Reference< container::XIndexAccess > > SAL_CALL getOutlineNumberingLevels( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     // following methods are used by indexentry service
100cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getIndexAlgorithm( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
101cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getDefaultIndexAlgorithm( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getIndexKeysByAlgorithm( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
103cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getIndexModuleByAlgorithm( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
104cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< UnicodeScript > SAL_CALL getUnicodeScripts( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
105cdf0e10cSrcweir     virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getFollowPageWords( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasPhonetic( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
107cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isPhonetic( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
108cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getHangingCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	//XServiceInfo
111cdf0e10cSrcweir 	virtual rtl::OUString SAL_CALL getImplementationName() throw( com::sun::star::uno::RuntimeException );
112cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( com::sun::star::uno::RuntimeException );
113cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( com::sun::star::uno::RuntimeException );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir private :
116cdf0e10cSrcweir 	friend sal_Bool operator ==(const com::sun::star::lang::Locale& l1, const com::sun::star::lang::Locale& l2);
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     ::std::auto_ptr< LocaleDataLookupTableItem > cachedItem;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	oslGenericFunction SAL_CALL getFunctionSymbol( const com::sun::star::lang::Locale& rLocale, const sal_Char* pFunction ) throw( com::sun::star::uno::RuntimeException );
121cdf0e10cSrcweir 	oslGenericFunction SAL_CALL getFunctionSymbolByName( const rtl::OUString& localeName, const sal_Char* pFunction );
122cdf0e10cSrcweir     sal_Unicode ** SAL_CALL getIndexArray(const com::sun::star::lang::Locale& rLocale, sal_Int16& indexCount);
123cdf0e10cSrcweir     sal_Unicode ** SAL_CALL getIndexArrayForAlgorithm(const com::sun::star::lang::Locale& rLocale, const rtl::OUString& rAlgorithm);
124cdf0e10cSrcweir 	com::sun::star::i18n::Calendar ref_cal;
125cdf0e10cSrcweir 	rtl::OUString ref_name;
126cdf0e10cSrcweir 	com::sun::star::uno::Sequence< com::sun::star::i18n::CalendarItem > &
127cdf0e10cSrcweir 		getCalendarItemByName(const rtl::OUString& name,
128cdf0e10cSrcweir 		const com::sun::star::lang::Locale& rLocale,
129cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< com::sun::star::i18n::Calendar >& calendarsSeq,
130cdf0e10cSrcweir 		sal_Int16 len, sal_Int16 item) throw( com::sun::star::uno::RuntimeException );
131cdf0e10cSrcweir };
132cdf0e10cSrcweir 
133cdf0e10cSrcweir } } } }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir #endif // _I18N_LOCALEDATA_HXX_
136