1*bae3752eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*bae3752eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*bae3752eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*bae3752eSAndrew Rist  * distributed with this work for additional information
6*bae3752eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*bae3752eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*bae3752eSAndrew Rist  * "License"); you may not use this file except in compliance
9*bae3752eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*bae3752eSAndrew Rist  *
11*bae3752eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*bae3752eSAndrew Rist  *
13*bae3752eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*bae3752eSAndrew Rist  * software distributed under the License is distributed on an
15*bae3752eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*bae3752eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*bae3752eSAndrew Rist  * specific language governing permissions and limitations
18*bae3752eSAndrew Rist  * under the License.
19*bae3752eSAndrew Rist  *
20*bae3752eSAndrew Rist  *************************************************************/
21*bae3752eSAndrew Rist 
22*bae3752eSAndrew Rist 
23cdf0e10cSrcweir #include "unotools/unotoolsdllapi.h"
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef _UNOTOOLS_COLLATORWRAPPER_HXX
26cdf0e10cSrcweir #define _UNOTOOLS_COLLATORWRAPPER_HXX
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_XCOLLATOR_HPP_
29cdf0e10cSrcweir #include <com/sun/star/i18n/XCollator.hpp>
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace lang {
33cdf0e10cSrcweir 		class XMultiServiceFactory;
34cdf0e10cSrcweir }}}}
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class UNOTOOLS_DLLPUBLIC CollatorWrapper
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 	private:
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 		::com::sun::star::uno::Reference<
41cdf0e10cSrcweir 				::com::sun::star::lang::XMultiServiceFactory
42cdf0e10cSrcweir 			> mxServiceFactory;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 		::com::sun::star::uno::Reference<
45cdf0e10cSrcweir 				::com::sun::star::i18n::XCollator
46cdf0e10cSrcweir 			> mxInternationalCollator;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 	public:
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     	CollatorWrapper (
51cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference<
52cdf0e10cSrcweir 					::com::sun::star::lang::XMultiServiceFactory > &xServiceFactoryIn);
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     	~CollatorWrapper();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     	sal_Int32
57cdf0e10cSrcweir 		compareSubstring (
58cdf0e10cSrcweir 				const ::rtl::OUString& s1, sal_Int32 off1, sal_Int32 len1,
59cdf0e10cSrcweir                 const ::rtl::OUString& s2, sal_Int32 off2, sal_Int32 len2) const;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir    		sal_Int32
62cdf0e10cSrcweir 		compareString (
63cdf0e10cSrcweir                 const ::rtl::OUString& s1, const ::rtl::OUString& s2) const;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     	::com::sun::star::uno::Sequence< ::rtl::OUString >
66cdf0e10cSrcweir 		listCollatorAlgorithms (
67cdf0e10cSrcweir                 const ::com::sun::star::lang::Locale& rLocale) const;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     	::com::sun::star::uno::Sequence< sal_Int32 >
70cdf0e10cSrcweir 		listCollatorOptions (
71cdf0e10cSrcweir                 const ::rtl::OUString& rAlgorithm) const;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     	sal_Int32
74cdf0e10cSrcweir 		loadDefaultCollator (
75cdf0e10cSrcweir 				const ::com::sun::star::lang::Locale& rLocale, sal_Int32 nOption);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     	sal_Int32
78cdf0e10cSrcweir 		loadCollatorAlgorithm (
79cdf0e10cSrcweir 				const ::rtl::OUString& rAlgorithm,
80cdf0e10cSrcweir 				const ::com::sun::star::lang::Locale& rLocale, sal_Int32 nOption);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     	void
83cdf0e10cSrcweir 		loadCollatorAlgorithmWithEndUserOption (
84cdf0e10cSrcweir 				const ::rtl::OUString& rAlgorithm,
85cdf0e10cSrcweir 				const ::com::sun::star::lang::Locale& rLocale,
86cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< sal_Int32 >& rOption);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	protected:
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 		CollatorWrapper();
91cdf0e10cSrcweir };
92cdf0e10cSrcweir 
93cdf0e10cSrcweir #endif /* _UNOTOOLS_COLLATORWRAPPER_HXX */
94