Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_I18NUTIL_CASEFOLDING_HXX
20 : #define INCLUDED_I18NUTIL_CASEFOLDING_HXX
21 :
22 : #include <sal/types.h>
23 : #include <com/sun/star/i18n/TransliterationModules.hpp>
24 : #include <com/sun/star/lang/Locale.hpp>
25 : #include <com/sun/star/uno/RuntimeException.hpp>
26 : #include "i18nutildllapi.h"
27 :
28 : namespace com { namespace sun { namespace star { namespace i18n {
29 :
30 : #define MappingTypeLowerToUpper (1 << 0) // Upper to Lower mapping
31 : #define MappingTypeUpperToLower (1 << 1) // Lower to Upper mapping
32 : #define MappingTypeToUpper (1 << 2) // to Upper mapping
33 : #define MappingTypeToLower (1 << 3) // to Lower mapping
34 : #define MappingTypeToTitle (1 << 4) // to Title mapping
35 : #define MappingTypeSimpleFolding (1 << 5) // Simple Case Folding
36 : #define MappingTypeFullFolding (1 << 6) // Full Case Folding
37 : #define MappingTypeMask (MappingTypeLowerToUpper|MappingTypeUpperToLower|\
38 : MappingTypeToUpper|MappingTypeToLower|MappingTypeToTitle|\
39 : MappingTypeSimpleFolding|MappingTypeFullFolding)
40 :
41 : #define ValueTypeNotValue (1 << 7) // Value field is an address
42 :
43 : #define CasedLetter (MappingTypeMask) // for final sigmar
44 :
45 : struct Value
46 : {
47 : sal_uInt8 type;
48 : sal_uInt16 value; // value or address, depend on the type
49 : };
50 :
51 : struct Mapping
52 : {
53 : sal_uInt8 type;
54 : sal_Int8 nmap;
55 : #define NMAPPINGMAX 3
56 : sal_Unicode map[NMAPPINGMAX];
57 : }; // for Unconditional mapping
58 :
59 : struct MappingElement
60 : {
61 10174 : MappingElement() {element.nmap = current = 0;}
62 : Mapping element;
63 : sal_Int8 current;
64 : };
65 :
66 : class I18NUTIL_DLLPUBLIC casefolding
67 : {
68 : public:
69 : static Mapping& getValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 len, com::sun::star::lang::Locale& aLocale, sal_uInt8 nMappingType) throw (com::sun::star::uno::RuntimeException);
70 : static Mapping& getConditionalValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 len, com::sun::star::lang::Locale& aLocale, sal_uInt8 nMappingType) throw (com::sun::star::uno::RuntimeException);
71 : static sal_Unicode getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, com::sun::star::lang::Locale& aLocale,sal_uInt8 nMappingtype, TransliterationModules moduleLoaded) throw (com::sun::star::uno::RuntimeException);
72 :
73 : };
74 :
75 : } } } }
76 :
77 : #endif
78 :
79 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|