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