1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "sal/config.h"
31 #include "sal/types.h"
33 #include "unichars.hxx"
35 bool ImplIsControlOrFormat(sal_uInt32 nUtf32
)
38 // <http://www.unicode.org/Public/UNIDATA/UnicodeData.txt>, Version 3.1.1,
39 // that have a General Category of Cc (Other, Control) or Cf (Other,
41 return nUtf32
<= 0x001F
42 || (nUtf32
>= 0x007F && nUtf32
<= 0x009F)
43 || nUtf32
== 0x070F // SYRIAC ABBREVIATION MARK
44 || nUtf32
== 0x180B // MONGOLIAN FREE VARIATION SELECTOR ONE
45 || nUtf32
== 0x180C // MONGOLIAN FREE VARIATION SELECTOR TWO
46 || nUtf32
== 0x180D // MONGOLIAN FREE VARIATION SELECTOR THREE
47 || nUtf32
== 0x180E // MONGOLIAN VOWEL SEPARATOR
48 || nUtf32
== 0x200C // ZERO WIDTH NON-JOINER
49 || nUtf32
== 0x200D // ZERO WIDTH JOINER
50 || nUtf32
== 0x200E // LEFT-TO-RIGHT MARK
51 || nUtf32
== 0x200F // RIGHT-TO-LEFT MARK
52 || nUtf32
== 0x202A // LEFT-TO-RIGHT EMBEDDING
53 || nUtf32
== 0x202B // RIGHT-TO-LEFT EMBEDDING
54 || nUtf32
== 0x202C // POP DIRECTIONAL FORMATTING
55 || nUtf32
== 0x202D // LEFT-TO-RIGHT OVERRIDE
56 || nUtf32
== 0x202E // RIGHT-TO-LEFT OVERRIDE
57 || nUtf32
== 0x206A // INHIBIT SYMMETRIC SWAPPING
58 || nUtf32
== 0x206B // ACTIVATE SYMMETRIC SWAPPING
59 || nUtf32
== 0x206C // INHIBIT ARABIC FORM SHAPING
60 || nUtf32
== 0x206D // ACTIVATE ARABIC FORM SHAPING
61 || nUtf32
== 0x206E // NATIONAL DIGIT SHAPES
62 || nUtf32
== 0x206F // NOMINAL DIGIT SHAPES
63 || nUtf32
== 0xFEFF // ZERO WIDTH NO-BREAK SPACE
64 || nUtf32
== 0xFFF9 // INTERLINEAR ANNOTATION ANCHOR
65 || nUtf32
== 0xFFFA // INTERLINEAR ANNOTATION SEPARATOR
66 || nUtf32
== 0xFFFB // INTERLINEAR ANNOTATION TERMINATOR
67 || nUtf32
== 0x1D173 // MUSICAL SYMBOL BEGIN BEAM
68 || nUtf32
== 0x1D174 // MUSICAL SYMBOL END BEAM
69 || nUtf32
== 0x1D175 // MUSICAL SYMBOL BEGIN TIE
70 || nUtf32
== 0x1D176 // MUSICAL SYMBOL END TIE
71 || nUtf32
== 0x1D177 // MUSICAL SYMBOL BEGIN SLUR
72 || nUtf32
== 0x1D178 // MUSICAL SYMBOL END SLUR
73 || nUtf32
== 0x1D179 // MUSICAL SYMBOL BEGIN PHRASE
74 || nUtf32
== 0x1D17A // MUSICAL SYMBOL END PHRASE
75 || nUtf32
== 0xE0001 // LANGUAGE TAG
76 || (nUtf32
>= 0xE0020 && nUtf32
<= 0xE007F);
79 bool ImplIsPrivateUse(sal_uInt32 nUtf32
)
82 // <http://www.unicode.org/Public/UNIDATA/UnicodeData.txt>, Version 3.1.1,
83 // that have a General Category of Co (Other, Private Use):
84 return (nUtf32
>= 0xE000 && nUtf32
<= 0xF8FF)
85 || (nUtf32
>= 0xF0000 && nUtf32
<= 0xFFFFD)
86 || (nUtf32
>= 0x100000 && nUtf32
<= 0x10FFFD);
89 bool ImplIsZeroWidth(sal_uInt32 nUtf32
)
92 // <http://www.unicode.org/Public/UNIDATA/UnicodeData.txt>, Version 3.1.1,
93 // that have "ZERO WIDTH" in their Character name:
94 return nUtf32
== 0x200B // ZERO WIDTH SPACE
95 || nUtf32
== 0x200C // ZERO WIDTH NON-JOINER
96 || nUtf32
== 0x200D // ZERO WIDTH JOINER
97 || nUtf32
== 0xFEFF; // ZEOR WIDTH NO-BREAK SPACE
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */