merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / i18n / KParseTokens.idl
blobfccaf55e31fbcaa62c4b3642b87ce5f05b92b001
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_i18n_KParseTokens_idl__
28 #define __com_sun_star_i18n_KParseTokens_idl__
30 //============================================================================
32 module com { module sun { module star { module i18n {
34 //============================================================================
36 /**
37 These constants specify the characters a name or identifier token to
38 be parsed can have.
40 <p> They are passed to
41 <member>XCharacterClassification::parseAnyToken()</member> and
42 <member>XCharacterClassification::parsePredefinedToken()</member>.
43 They are also set in the <member>ParseResult::StartFlags</member>
44 and <member>ParseResult::ContFlags</member>. </p>
47 published constants KParseTokens
49 /// ASCII A-Z upper alpha
50 const long ASC_UPALPHA = 0x00000001;
52 /// ASCII a-z lower alpha
53 const long ASC_LOALPHA = 0x00000002;
55 /// ASCII 0-9 digit
56 const long ASC_DIGIT = 0x00000004;
58 /// ASCII '_' underscore
59 const long ASC_UNDERSCORE = 0x00000008;
61 /// ASCII '$' dollar
62 const long ASC_DOLLAR = 0x00000010;
64 /// ASCII '.' dot/point
65 const long ASC_DOT = 0x00000020;
67 /// ASCII ':' colon
68 const long ASC_COLON = 0x00000040;
70 /// Special value to allow control characters (0x00 &lt; char &lt; 0x20)
71 const long ASC_CONTROL = 0x00000200;
73 /** Special value to allow anything below 128 except control
74 characters. <strong>Not</strong> set in
75 <type>ParseResult</type>. */
76 const long ASC_ANY_BUT_CONTROL = 0x00000400;
78 /** Additional flag set in <member>ParseResult::StartFlags</member>
79 or <member>ParseResult::ContFlags</member>. Set if none of the
80 above ASC_... (except ASC_ANY_...) single values match an ASCII
81 character parsed. */
82 const long ASC_OTHER = 0x00000800;
84 /// Unicode (above 127) upper case letter
85 const long UNI_UPALPHA = 0x00001000;
87 /// Unicode (above 127) lower case letter
88 const long UNI_LOALPHA = 0x00002000;
90 /// Unicode (above 127) decimal digit number
91 const long UNI_DIGIT = 0x00004000;
93 /// Unicode (above 127) title case letter
94 const long UNI_TITLE_ALPHA = 0x00008000;
96 /// Unicode (above 127) modifier letter
97 const long UNI_MODIFIER_LETTER = 0x00010000;
99 /// Unicode (above 127) other letter
100 const long UNI_OTHER_LETTER = 0x00020000;
102 /// Unicode (above 127) letter number
103 const long UNI_LETTER_NUMBER = 0x00040000;
105 /// Unicode (above 127) other number
106 const long UNI_OTHER_NUMBER = 0x00080000;
108 /** If this bit is set in <em>nContCharFlags</em> parameters and a
109 string enclosed in double quotes is parsed and two consecutive
110 double quotes are encountered, the string is ended. If this bit
111 is not set, the two double quotes are parsed as one escaped
112 double quote and string parsing continues. The bit is ignored in
113 <em>nStartCharFlags</em> parameters.
115 <p> Example: <br/>
116 "abc""def" --> bit not set => abc"def <br/>
117 "abc""def" --> bit set => abc </p>
119 const long TWO_DOUBLE_QUOTES_BREAK_STRING = 0x10000000;
121 /** Additional flag set in <member>ParseResult::StartFlags</member>
122 or <member>ParseResult::ContFlags</member>. Set if none of the
123 above UNI_... single values match a Unicode character parsed. */
124 const long UNI_OTHER = 0x20000000;
126 /** Only valid for <em>nStartCharFlags</em> parameter to
127 <method>ChararacterClassification::parseAnyToken</method> and
128 <method>ChararacterClassification::parsePredefinedToken</method>,
129 ignored on <em>nContCharFlags</em> parameter.
130 <strong>Not</strong> set in <type>ParseResult</type>. */
131 const long IGNORE_LEADING_WS = 0x40000000;
134 // useful combinations
136 /// ASCII a-zA-Z lower or upper alpha
137 const long ASC_ALPHA = ASC_UPALPHA | ASC_LOALPHA;
139 /// ASCII a-zA-Z0-9 alphanumeric
140 const long ASC_ALNUM = ASC_ALPHA | ASC_DIGIT;
142 /// Unicode (above 127) lower or upper or title case alpha
143 const long UNI_ALPHA = UNI_UPALPHA | UNI_LOALPHA | UNI_TITLE_ALPHA;
145 /// Unicode (above 127) alphanumeric
146 const long UNI_ALNUM = UNI_ALPHA | UNI_DIGIT;
148 /// Unicode (above 127) alpha or letter
149 const long UNI_LETTER = UNI_ALPHA | UNI_MODIFIER_LETTER |
150 UNI_OTHER_LETTER;
152 /// Unicode (above 127) number
153 const long UNI_NUMBER = UNI_DIGIT | UNI_LETTER_NUMBER |
154 UNI_OTHER_NUMBER;
156 /// any (ASCII or Unicode) alpha
157 const long ANY_ALPHA = ASC_ALPHA | UNI_ALPHA;
159 /// any (ASCII or Unicode) digit
160 const long ANY_DIGIT = ASC_DIGIT | UNI_DIGIT;
162 /// any (ASCII or Unicode) alphanumeric
163 const long ANY_ALNUM = ASC_ALNUM | UNI_ALNUM;
165 /// any (ASCII or Unicode) letter
166 const long ANY_LETTER = ASC_ALPHA | UNI_LETTER;
168 /// any (ASCII or Unicode) number
169 const long ANY_NUMBER = ASC_DIGIT | UNI_NUMBER;
171 /// any (ASCII or Unicode) letter or number
172 const long ANY_LETTER_OR_NUMBER = ANY_LETTER | ANY_NUMBER;
175 //============================================================================
176 }; }; }; };
178 #endif