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