1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27#ifndef __com_sun_star_i18n_KParseTokens_idl__ 28#define __com_sun_star_i18n_KParseTokens_idl__ 29 30//============================================================================ 31 32module com { module sun { module star { module i18n { 33 34//============================================================================ 35 36/** 37 These constants specify the characters a name or identifier token to 38 be parsed can have. 39 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> 45 */ 46 47published constants KParseTokens 48{ 49 /// ASCII A-Z upper alpha 50 const long ASC_UPALPHA = 0x00000001; 51 52 /// ASCII a-z lower alpha 53 const long ASC_LOALPHA = 0x00000002; 54 55 /// ASCII 0-9 digit 56 const long ASC_DIGIT = 0x00000004; 57 58 /// ASCII '_' underscore 59 const long ASC_UNDERSCORE = 0x00000008; 60 61 /// ASCII '$' dollar 62 const long ASC_DOLLAR = 0x00000010; 63 64 /// ASCII '.' dot/point 65 const long ASC_DOT = 0x00000020; 66 67 /// ASCII ':' colon 68 const long ASC_COLON = 0x00000040; 69 70 /// Special value to allow control characters (0x00 < char < 0x20) 71 const long ASC_CONTROL = 0x00000200; 72 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; 77 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; 83 84 /// Unicode (above 127) upper case letter 85 const long UNI_UPALPHA = 0x00001000; 86 87 /// Unicode (above 127) lower case letter 88 const long UNI_LOALPHA = 0x00002000; 89 90 /// Unicode (above 127) decimal digit number 91 const long UNI_DIGIT = 0x00004000; 92 93 /// Unicode (above 127) title case letter 94 const long UNI_TITLE_ALPHA = 0x00008000; 95 96 /// Unicode (above 127) modifier letter 97 const long UNI_MODIFIER_LETTER = 0x00010000; 98 99 /// Unicode (above 127) other letter 100 const long UNI_OTHER_LETTER = 0x00020000; 101 102 /// Unicode (above 127) letter number 103 const long UNI_LETTER_NUMBER = 0x00040000; 104 105 /// Unicode (above 127) other number 106 const long UNI_OTHER_NUMBER = 0x00080000; 107 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. 114 115 <p> Example: <br/> 116 "abc""def" --> bit not set => abc"def <br/> 117 "abc""def" --> bit set => abc </p> 118 */ 119 const long TWO_DOUBLE_QUOTES_BREAK_STRING = 0x10000000; 120 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; 125 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; 132 133 134 // useful combinations 135 136 /// ASCII a-zA-Z lower or upper alpha 137 const long ASC_ALPHA = ASC_UPALPHA | ASC_LOALPHA; 138 139 /// ASCII a-zA-Z0-9 alphanumeric 140 const long ASC_ALNUM = ASC_ALPHA | ASC_DIGIT; 141 142 /// Unicode (above 127) lower or upper or title case alpha 143 const long UNI_ALPHA = UNI_UPALPHA | UNI_LOALPHA | UNI_TITLE_ALPHA; 144 145 /// Unicode (above 127) alphanumeric 146 const long UNI_ALNUM = UNI_ALPHA | UNI_DIGIT; 147 148 /// Unicode (above 127) alpha or letter 149 const long UNI_LETTER = UNI_ALPHA | UNI_MODIFIER_LETTER | 150 UNI_OTHER_LETTER; 151 152 /// Unicode (above 127) number 153 const long UNI_NUMBER = UNI_DIGIT | UNI_LETTER_NUMBER | 154 UNI_OTHER_NUMBER; 155 156 /// any (ASCII or Unicode) alpha 157 const long ANY_ALPHA = ASC_ALPHA | UNI_ALPHA; 158 159 /// any (ASCII or Unicode) digit 160 const long ANY_DIGIT = ASC_DIGIT | UNI_DIGIT; 161 162 /// any (ASCII or Unicode) alphanumeric 163 const long ANY_ALNUM = ASC_ALNUM | UNI_ALNUM; 164 165 /// any (ASCII or Unicode) letter 166 const long ANY_LETTER = ASC_ALPHA | UNI_LETTER; 167 168 /// any (ASCII or Unicode) number 169 const long ANY_NUMBER = ASC_DIGIT | UNI_NUMBER; 170 171 /// any (ASCII or Unicode) letter or number 172 const long ANY_LETTER_OR_NUMBER = ANY_LETTER | ANY_NUMBER; 173}; 174 175//============================================================================ 176}; }; }; }; 177 178#endif 179