xref: /trunk/main/i18npool/inc/collator_unicode.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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_COLLATOR_UNICODE_HXX_
24 #define _I18N_COLLATOR_UNICODE_HXX_
25 
26 #include <com/sun/star/uno/Reference.h>
27 #include <com/sun/star/i18n/XCollator.hpp>
28 #include <cppuhelper/implbase1.hxx>
29 #include <osl/module.h>
30 
31 #include "warnings_guard_unicode_tblcoll.h"
32 
33 //      ----------------------------------------------------
34 //      class Collator_Unicode
35 //      ----------------------------------------------------
36 
37 namespace com { namespace sun { namespace star { namespace i18n {
38 
39 class Collator_Unicode : public cppu::WeakImplHelper1 < XCollator >
40 {
41 public:
42     // Constructors
43     Collator_Unicode();
44     // Destructor
45     ~Collator_Unicode();
46 
47     sal_Int32 SAL_CALL compareSubstring( const rtl::OUString& s1, sal_Int32 off1, sal_Int32 len1,
48         const rtl::OUString& s2, sal_Int32 off2, sal_Int32 len2);
49 
50     sal_Int32 SAL_CALL compareString( const rtl::OUString& s1, const rtl::OUString& s2);
51 
52     sal_Int32 SAL_CALL loadCollatorAlgorithm( const rtl::OUString& impl, const lang::Locale& rLocale,
53         sal_Int32 collatorOptions);
54 
55 
56     // following 4 methods are implemented in collatorImpl.
loadDefaultCollator(const lang::Locale &,sal_Int32)57     sal_Int32 SAL_CALL loadDefaultCollator( const lang::Locale&,  sal_Int32) {throw com::sun::star::uno::RuntimeException();}
loadCollatorAlgorithmWithEndUserOption(const rtl::OUString &,const lang::Locale &,const com::sun::star::uno::Sequence<sal_Int32> &)58     void SAL_CALL loadCollatorAlgorithmWithEndUserOption( const rtl::OUString&, const lang::Locale&,
59         const com::sun::star::uno::Sequence< sal_Int32 >&) {throw com::sun::star::uno::RuntimeException();}
listCollatorAlgorithms(const lang::Locale &)60     com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL listCollatorAlgorithms( const lang::Locale&) {throw com::sun::star::uno::RuntimeException();}
listCollatorOptions(const rtl::OUString &)61     com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL listCollatorOptions( const rtl::OUString& ) {throw com::sun::star::uno::RuntimeException();}
62 
63     //XServiceInfo
64     virtual rtl::OUString SAL_CALL getImplementationName();
65     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName);
66     virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames();
67 
68 protected:
69     const sal_Char *implementationName;
70 private:
71     RuleBasedCollator *uca_base, *collator;
72     oslModule hModule;
73 };
74 
75 } } } }
76 
77 #endif
78