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 __com_sun_star_i18n_KParseTokens_idl__ 24#define __com_sun_star_i18n_KParseTokens_idl__ 25 26//============================================================================ 27 28module com { module sun { module star { module i18n { 29 30//============================================================================ 31 32/** 33 These constants specify the characters a name or identifier token to 34 be parsed can have. 35 36 <p> They are passed to 37 <member>XCharacterClassification::parseAnyToken()</member> and 38 <member>XCharacterClassification::parsePredefinedToken()</member>. 39 They are also set in the <member>ParseResult::StartFlags</member> 40 and <member>ParseResult::ContFlags</member>. </p> 41 */ 42 43published constants KParseTokens 44{ 45 /// ASCII A-Z upper alpha 46 const long ASC_UPALPHA = 0x00000001; 47 48 /// ASCII a-z lower alpha 49 const long ASC_LOALPHA = 0x00000002; 50 51 /// ASCII 0-9 digit 52 const long ASC_DIGIT = 0x00000004; 53 54 /// ASCII '_' underscore 55 const long ASC_UNDERSCORE = 0x00000008; 56 57 /// ASCII '$' dollar 58 const long ASC_DOLLAR = 0x00000010; 59 60 /// ASCII '.' dot/point 61 const long ASC_DOT = 0x00000020; 62 63 /// ASCII ':' colon 64 const long ASC_COLON = 0x00000040; 65 66 /// Special value to allow control characters (0x00 < char < 0x20) 67 const long ASC_CONTROL = 0x00000200; 68 69 /** Special value to allow anything below 128 except control 70 characters. <strong>Not</strong> set in 71 <type>ParseResult</type>. */ 72 const long ASC_ANY_BUT_CONTROL = 0x00000400; 73 74 /** Additional flag set in <member>ParseResult::StartFlags</member> 75 or <member>ParseResult::ContFlags</member>. Set if none of the 76 above ASC_... (except ASC_ANY_...) single values match an ASCII 77 character parsed. */ 78 const long ASC_OTHER = 0x00000800; 79 80 /// Unicode (above 127) upper case letter 81 const long UNI_UPALPHA = 0x00001000; 82 83 /// Unicode (above 127) lower case letter 84 const long UNI_LOALPHA = 0x00002000; 85 86 /// Unicode (above 127) decimal digit number 87 const long UNI_DIGIT = 0x00004000; 88 89 /// Unicode (above 127) title case letter 90 const long UNI_TITLE_ALPHA = 0x00008000; 91 92 /// Unicode (above 127) modifier letter 93 const long UNI_MODIFIER_LETTER = 0x00010000; 94 95 /// Unicode (above 127) other letter 96 const long UNI_OTHER_LETTER = 0x00020000; 97 98 /// Unicode (above 127) letter number 99 const long UNI_LETTER_NUMBER = 0x00040000; 100 101 /// Unicode (above 127) other number 102 const long UNI_OTHER_NUMBER = 0x00080000; 103 104 /** If this bit is set in <em>nContCharFlags</em> parameters and a 105 string enclosed in double quotes is parsed and two consecutive 106 double quotes are encountered, the string is ended. If this bit 107 is not set, the two double quotes are parsed as one escaped 108 double quote and string parsing continues. The bit is ignored in 109 <em>nStartCharFlags</em> parameters. 110 111 <p> Example: <br/> 112 "abc""def" --> bit not set => abc"def <br/> 113 "abc""def" --> bit set => abc </p> 114 */ 115 const long TWO_DOUBLE_QUOTES_BREAK_STRING = 0x10000000; 116 117 /** Additional flag set in <member>ParseResult::StartFlags</member> 118 or <member>ParseResult::ContFlags</member>. Set if none of the 119 above UNI_... single values match a Unicode character parsed. */ 120 const long UNI_OTHER = 0x20000000; 121 122 /** Only valid for <em>nStartCharFlags</em> parameter to 123 <method>ChararacterClassification::parseAnyToken</method> and 124 <method>ChararacterClassification::parsePredefinedToken</method>, 125 ignored on <em>nContCharFlags</em> parameter. 126 <strong>Not</strong> set in <type>ParseResult</type>. */ 127 const long IGNORE_LEADING_WS = 0x40000000; 128 129 130 // useful combinations 131 132 /// ASCII a-zA-Z lower or upper alpha 133 const long ASC_ALPHA = ASC_UPALPHA | ASC_LOALPHA; 134 135 /// ASCII a-zA-Z0-9 alphanumeric 136 const long ASC_ALNUM = ASC_ALPHA | ASC_DIGIT; 137 138 /// Unicode (above 127) lower or upper or title case alpha 139 const long UNI_ALPHA = UNI_UPALPHA | UNI_LOALPHA | UNI_TITLE_ALPHA; 140 141 /// Unicode (above 127) alphanumeric 142 const long UNI_ALNUM = UNI_ALPHA | UNI_DIGIT; 143 144 /// Unicode (above 127) alpha or letter 145 const long UNI_LETTER = UNI_ALPHA | UNI_MODIFIER_LETTER | 146 UNI_OTHER_LETTER; 147 148 /// Unicode (above 127) number 149 const long UNI_NUMBER = UNI_DIGIT | UNI_LETTER_NUMBER | 150 UNI_OTHER_NUMBER; 151 152 /// any (ASCII or Unicode) alpha 153 const long ANY_ALPHA = ASC_ALPHA | UNI_ALPHA; 154 155 /// any (ASCII or Unicode) digit 156 const long ANY_DIGIT = ASC_DIGIT | UNI_DIGIT; 157 158 /// any (ASCII or Unicode) alphanumeric 159 const long ANY_ALNUM = ASC_ALNUM | UNI_ALNUM; 160 161 /// any (ASCII or Unicode) letter 162 const long ANY_LETTER = ASC_ALPHA | UNI_LETTER; 163 164 /// any (ASCII or Unicode) number 165 const long ANY_NUMBER = ASC_DIGIT | UNI_NUMBER; 166 167 /// any (ASCII or Unicode) letter or number 168 const long ANY_LETTER_OR_NUMBER = ANY_LETTER | ANY_NUMBER; 169}; 170 171//============================================================================ 172}; }; }; }; 173 174#endif 175