xref: /aoo41x/main/i18npool/inc/localedata.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _I18N_LOCALEDATA_HXX_
28*cdf0e10cSrcweir #define _I18N_LOCALEDATA_HXX_
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include <com/sun/star/i18n/XLocaleData2.hpp>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> // helper for implementations
38*cdf0e10cSrcweir #include <cppu/macros.hxx>
39*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.h>
42*cdf0e10cSrcweir #include <com/sun/star/i18n/Calendar.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/i18n/FormatElement.hpp>
44*cdf0e10cSrcweir #include <com/sun/star/i18n/Currency.hpp>
45*cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp>
46*cdf0e10cSrcweir #include <com/sun/star/i18n/LocaleDataItem.hpp>
47*cdf0e10cSrcweir #include <com/sun/star/i18n/UnicodeScript.hpp>
48*cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp>
49*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
50*cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp>
51*cdf0e10cSrcweir #include <rtl/ustring.hxx>
52*cdf0e10cSrcweir #include <vector>
53*cdf0e10cSrcweir #include <memory>
54*cdf0e10cSrcweir #include <osl/module.hxx>
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir //
57*cdf0e10cSrcweir #include <defaultnumberingprovider.hxx>
58*cdf0e10cSrcweir #include <com/sun/star/style/NumberingType.hpp>
59*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
60*cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientation.hpp>
61*cdf0e10cSrcweir //
62*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
63*cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp>
64*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir struct LocaleDataLookupTableItem;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace i18n {
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir inline sal_Bool operator ==(const com::sun::star::lang::Locale& l1, const com::sun::star::lang::Locale& l2) {
71*cdf0e10cSrcweir     return l1.Language == l2.Language && l1.Country == l2.Country && l1.Variant == l2.Variant;
72*cdf0e10cSrcweir };
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir class LocaleData : public cppu::WeakImplHelper2
75*cdf0e10cSrcweir <
76*cdf0e10cSrcweir 	XLocaleData2,
77*cdf0e10cSrcweir 	com::sun::star::lang::XServiceInfo
78*cdf0e10cSrcweir >
79*cdf0e10cSrcweir {
80*cdf0e10cSrcweir public:
81*cdf0e10cSrcweir     LocaleData();
82*cdf0e10cSrcweir     ~LocaleData();
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	virtual LanguageCountryInfo SAL_CALL getLanguageCountryInfo( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
85*cdf0e10cSrcweir 	virtual LocaleDataItem SAL_CALL getLocaleItem( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
86*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Calendar > SAL_CALL getAllCalendars( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
87*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Currency > SAL_CALL getAllCurrencies( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
88*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Currency2 > SAL_CALL getAllCurrencies2( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
89*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< FormatElement > SAL_CALL getAllFormats( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
90*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< Implementation > SAL_CALL getCollatorImplementations( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
91*cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getCollatorRuleByAlgorithm( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
92*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getTransliterations( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
93*cdf0e10cSrcweir 	virtual ForbiddenCharacters SAL_CALL getForbiddenCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
94*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getReservedWord( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException) ;
95*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getBreakIteratorRules( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException) ;
96*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< com::sun::star::lang::Locale > SAL_CALL getAllInstalledLocaleNames() throw(com::sun::star::uno::RuntimeException);
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSearchOptions( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
99*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getCollationOptions( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
100*cdf0e10cSrcweir 	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);
101*cdf0e10cSrcweir 	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);
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     // following methods are used by indexentry service
104*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getIndexAlgorithm( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
105*cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getDefaultIndexAlgorithm( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
106*cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getIndexKeysByAlgorithm( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
107*cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getIndexModuleByAlgorithm( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
108*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< UnicodeScript > SAL_CALL getUnicodeScripts( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
109*cdf0e10cSrcweir     virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getFollowPageWords( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
110*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasPhonetic( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
111*cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isPhonetic( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& algorithm ) throw(com::sun::star::uno::RuntimeException);
112*cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getHangingCharacters( const com::sun::star::lang::Locale& rLocale ) throw(com::sun::star::uno::RuntimeException);
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 	//XServiceInfo
115*cdf0e10cSrcweir 	virtual rtl::OUString SAL_CALL getImplementationName() throw( com::sun::star::uno::RuntimeException );
116*cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( com::sun::star::uno::RuntimeException );
117*cdf0e10cSrcweir 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( com::sun::star::uno::RuntimeException );
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir private :
120*cdf0e10cSrcweir 	friend sal_Bool operator ==(const com::sun::star::lang::Locale& l1, const com::sun::star::lang::Locale& l2);
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     ::std::auto_ptr< LocaleDataLookupTableItem > cachedItem;
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir 	oslGenericFunction SAL_CALL getFunctionSymbol( const com::sun::star::lang::Locale& rLocale, const sal_Char* pFunction ) throw( com::sun::star::uno::RuntimeException );
125*cdf0e10cSrcweir 	oslGenericFunction SAL_CALL getFunctionSymbolByName( const rtl::OUString& localeName, const sal_Char* pFunction );
126*cdf0e10cSrcweir     sal_Unicode ** SAL_CALL getIndexArray(const com::sun::star::lang::Locale& rLocale, sal_Int16& indexCount);
127*cdf0e10cSrcweir     sal_Unicode ** SAL_CALL getIndexArrayForAlgorithm(const com::sun::star::lang::Locale& rLocale, const rtl::OUString& rAlgorithm);
128*cdf0e10cSrcweir 	com::sun::star::i18n::Calendar ref_cal;
129*cdf0e10cSrcweir 	rtl::OUString ref_name;
130*cdf0e10cSrcweir 	com::sun::star::uno::Sequence< com::sun::star::i18n::CalendarItem > &
131*cdf0e10cSrcweir 		getCalendarItemByName(const rtl::OUString& name,
132*cdf0e10cSrcweir 		const com::sun::star::lang::Locale& rLocale,
133*cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< com::sun::star::i18n::Calendar >& calendarsSeq,
134*cdf0e10cSrcweir 		sal_Int16 len, sal_Int16 item) throw( com::sun::star::uno::RuntimeException );
135*cdf0e10cSrcweir };
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir } } } }
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir #endif // _I18N_LOCALEDATA_HXX_
140