1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef __com_sun_star_i18n_KParseTokens_idl__
20 #define __com_sun_star_i18n_KParseTokens_idl__
23 module com
{ module sun
{ module star
{ module i18n
{
27 These constants specify the characters a name or identifier token to
30 <p> They are passed to
31 XCharacterClassification::parseAnyToken() and
32 XCharacterClassification::parsePredefinedToken().
33 They are also set in the ParseResult::StartFlags
34 and ParseResult::ContFlags. </p>
37 published constants KParseTokens
39 /// ASCII A-Z upper alpha
40 const long ASC_UPALPHA
= 0x00000001;
42 /// ASCII a-z lower alpha
43 const long ASC_LOALPHA
= 0x00000002;
46 const long ASC_DIGIT
= 0x00000004;
48 /// ASCII '_' underscore
49 const long ASC_UNDERSCORE
= 0x00000008;
52 const long ASC_DOLLAR
= 0x00000010;
54 /// ASCII '.' dot/point
55 const long ASC_DOT
= 0x00000020;
58 const long ASC_COLON
= 0x00000040;
60 /// Special value to allow control characters (0x00 < char < 0x20)
61 const long ASC_CONTROL
= 0x00000200;
63 /** Special value to allow anything below 128 except control
64 characters. <strong>Not</strong> set in
66 const long ASC_ANY_BUT_CONTROL
= 0x00000400;
68 /** Additional flag set in ParseResult::StartFlags
69 or ParseResult::ContFlags. Set if none of the
70 above ASC_... (except ASC_ANY_...) single values match an ASCII
72 const long ASC_OTHER
= 0x00000800;
74 /// Unicode (above 127) upper case letter
75 const long UNI_UPALPHA
= 0x00001000;
77 /// Unicode (above 127) lower case letter
78 const long UNI_LOALPHA
= 0x00002000;
80 /// Unicode (above 127) decimal digit number
81 const long UNI_DIGIT
= 0x00004000;
83 /// Unicode (above 127) title case letter
84 const long UNI_TITLE_ALPHA
= 0x00008000;
86 /// Unicode (above 127) modifier letter
87 const long UNI_MODIFIER_LETTER
= 0x00010000;
89 /// Unicode (above 127) other letter
90 const long UNI_OTHER_LETTER
= 0x00020000;
92 /// Unicode (above 127) letter number
93 const long UNI_LETTER_NUMBER
= 0x00040000;
95 /// Unicode (above 127) other number
96 const long UNI_OTHER_NUMBER
= 0x00080000;
98 /** If this bit is set in <em>nContCharFlags</em> parameters and a
99 string enclosed in double quotes is parsed and two consecutive
100 double quotes are encountered, the string is ended. If this bit
101 is not set, the two double quotes are parsed as one escaped
102 double quote and string parsing continues. The bit is ignored in
103 <em>nStartCharFlags</em> parameters.
106 "abc""def" --> bit not set => abc"def <br/>
107 "abc""def" --> bit set => abc </p>
109 const long TWO_DOUBLE_QUOTES_BREAK_STRING
= 0x10000000;
111 /** Additional flag set in ParseResult::StartFlags
112 or ParseResult::ContFlags. Set if none of the
113 above UNI_... single values match a Unicode character parsed. */
114 const long UNI_OTHER
= 0x20000000;
116 /** Only valid for <em>nStartCharFlags</em> parameter to
117 ChararacterClassification::parseAnyToken() and
118 ChararacterClassification::parsePredefinedToken(),
119 ignored on <em>nContCharFlags</em> parameter.
120 <strong>Not</strong> set in ParseResult. */
121 const long IGNORE_LEADING_WS
= 0x40000000;
124 // useful combinations
126 /// ASCII a-zA-Z lower or upper alpha
127 const long ASC_ALPHA
= ASC_UPALPHA | ASC_LOALPHA
;
129 /// ASCII a-zA-Z0-9 alphanumeric
130 const long ASC_ALNUM
= ASC_ALPHA | ASC_DIGIT
;
132 /// Unicode (above 127) lower or upper or title case alpha
133 const long UNI_ALPHA
= UNI_UPALPHA | UNI_LOALPHA | UNI_TITLE_ALPHA
;
135 /// Unicode (above 127) alphanumeric
136 const long UNI_ALNUM
= UNI_ALPHA | UNI_DIGIT
;
138 /// Unicode (above 127) alpha or letter
139 const long UNI_LETTER
= UNI_ALPHA | UNI_MODIFIER_LETTER |
142 /// Unicode (above 127) number
143 const long UNI_NUMBER
= UNI_DIGIT | UNI_LETTER_NUMBER |
146 /// any (ASCII or Unicode) alpha
147 const long ANY_ALPHA
= ASC_ALPHA | UNI_ALPHA
;
149 /// any (ASCII or Unicode) digit
150 const long ANY_DIGIT
= ASC_DIGIT | UNI_DIGIT
;
152 /// any (ASCII or Unicode) alphanumeric
153 const long ANY_ALNUM
= ASC_ALNUM | UNI_ALNUM
;
155 /// any (ASCII or Unicode) letter
156 const long ANY_LETTER
= ASC_ALPHA | UNI_LETTER
;
158 /// any (ASCII or Unicode) number
159 const long ANY_NUMBER
= ASC_DIGIT | UNI_NUMBER
;
161 /// any (ASCII or Unicode) letter or number
162 const long ANY_LETTER_OR_NUMBER
= ANY_LETTER | ANY_NUMBER
;
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */