1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_i18n_KParseTokens_idl__
24cdf0e10cSrcweir#define __com_sun_star_i18n_KParseTokens_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir//============================================================================
27cdf0e10cSrcweir
28cdf0e10cSrcweirmodule com {  module sun {  module star {  module i18n {
29cdf0e10cSrcweir
30cdf0e10cSrcweir//============================================================================
31cdf0e10cSrcweir
32cdf0e10cSrcweir/**
33cdf0e10cSrcweir    These constants specify the characters a name or identifier token to
34cdf0e10cSrcweir    be parsed can have.
35cdf0e10cSrcweir
36cdf0e10cSrcweir    <p> They are passed to
37cdf0e10cSrcweir    <member>XCharacterClassification::parseAnyToken()</member> and
38cdf0e10cSrcweir    <member>XCharacterClassification::parsePredefinedToken()</member>.
39cdf0e10cSrcweir    They are also set in the <member>ParseResult::StartFlags</member>
40cdf0e10cSrcweir    and <member>ParseResult::ContFlags</member>. </p>
41cdf0e10cSrcweir */
42cdf0e10cSrcweir
43cdf0e10cSrcweirpublished constants KParseTokens
44cdf0e10cSrcweir{
45cdf0e10cSrcweir    /// ASCII A-Z upper alpha
46cdf0e10cSrcweir    const long ASC_UPALPHA          = 0x00000001;
47cdf0e10cSrcweir
48cdf0e10cSrcweir    /// ASCII a-z lower alpha
49cdf0e10cSrcweir    const long ASC_LOALPHA          = 0x00000002;
50cdf0e10cSrcweir
51cdf0e10cSrcweir    /// ASCII 0-9 digit
52cdf0e10cSrcweir    const long ASC_DIGIT            = 0x00000004;
53cdf0e10cSrcweir
54cdf0e10cSrcweir    /// ASCII '_' underscore
55cdf0e10cSrcweir    const long ASC_UNDERSCORE       = 0x00000008;
56cdf0e10cSrcweir
57cdf0e10cSrcweir    /// ASCII '$' dollar
58cdf0e10cSrcweir    const long ASC_DOLLAR           = 0x00000010;
59cdf0e10cSrcweir
60cdf0e10cSrcweir    /// ASCII '.' dot/point
61cdf0e10cSrcweir    const long ASC_DOT              = 0x00000020;
62cdf0e10cSrcweir
63cdf0e10cSrcweir    /// ASCII ':' colon
64cdf0e10cSrcweir    const long ASC_COLON            = 0x00000040;
65cdf0e10cSrcweir
66cdf0e10cSrcweir    /// Special value to allow control characters (0x00 &lt; char &lt; 0x20)
67cdf0e10cSrcweir    const long ASC_CONTROL          = 0x00000200;
68cdf0e10cSrcweir
69cdf0e10cSrcweir    /** Special value to allow anything below 128 except control
70cdf0e10cSrcweir        characters. <strong>Not</strong> set in
71cdf0e10cSrcweir        <type>ParseResult</type>. */
72cdf0e10cSrcweir    const long ASC_ANY_BUT_CONTROL  = 0x00000400;
73cdf0e10cSrcweir
74cdf0e10cSrcweir    /** Additional flag set in <member>ParseResult::StartFlags</member>
75cdf0e10cSrcweir        or <member>ParseResult::ContFlags</member>. Set if none of the
76cdf0e10cSrcweir        above ASC_... (except ASC_ANY_...) single values match an ASCII
77cdf0e10cSrcweir        character parsed. */
78cdf0e10cSrcweir    const long ASC_OTHER            = 0x00000800;
79cdf0e10cSrcweir
80cdf0e10cSrcweir    /// Unicode (above 127) upper case letter
81cdf0e10cSrcweir    const long UNI_UPALPHA          = 0x00001000;
82cdf0e10cSrcweir
83cdf0e10cSrcweir    /// Unicode (above 127) lower case letter
84cdf0e10cSrcweir    const long UNI_LOALPHA          = 0x00002000;
85cdf0e10cSrcweir
86cdf0e10cSrcweir    /// Unicode (above 127) decimal digit number
87cdf0e10cSrcweir    const long UNI_DIGIT            = 0x00004000;
88cdf0e10cSrcweir
89cdf0e10cSrcweir    /// Unicode (above 127) title case letter
90cdf0e10cSrcweir    const long UNI_TITLE_ALPHA      = 0x00008000;
91cdf0e10cSrcweir
92cdf0e10cSrcweir    /// Unicode (above 127) modifier letter
93cdf0e10cSrcweir    const long UNI_MODIFIER_LETTER  = 0x00010000;
94cdf0e10cSrcweir
95cdf0e10cSrcweir    /// Unicode (above 127) other letter
96cdf0e10cSrcweir    const long UNI_OTHER_LETTER     = 0x00020000;
97cdf0e10cSrcweir
98cdf0e10cSrcweir    /// Unicode (above 127) letter number
99cdf0e10cSrcweir    const long UNI_LETTER_NUMBER    = 0x00040000;
100cdf0e10cSrcweir
101cdf0e10cSrcweir    /// Unicode (above 127) other number
102cdf0e10cSrcweir    const long UNI_OTHER_NUMBER     = 0x00080000;
103cdf0e10cSrcweir
104cdf0e10cSrcweir    /** If this bit is set in <em>nContCharFlags</em> parameters and a
105cdf0e10cSrcweir        string enclosed in double quotes is parsed and two consecutive
106cdf0e10cSrcweir        double quotes are encountered, the string is ended. If this bit
107cdf0e10cSrcweir        is not set, the two double quotes are parsed as one escaped
108cdf0e10cSrcweir        double quote and string parsing continues. The bit is ignored in
109cdf0e10cSrcweir        <em>nStartCharFlags</em> parameters.
110cdf0e10cSrcweir
111cdf0e10cSrcweir        <p> Example: <br/>
112cdf0e10cSrcweir        "abc""def"  -->  bit not set  =>  abc"def <br/>
113cdf0e10cSrcweir        "abc""def"  -->  bit set  =>  abc </p>
114cdf0e10cSrcweir      */
115cdf0e10cSrcweir    const long TWO_DOUBLE_QUOTES_BREAK_STRING   = 0x10000000;
116cdf0e10cSrcweir
117cdf0e10cSrcweir    /** Additional flag set in <member>ParseResult::StartFlags</member>
118cdf0e10cSrcweir        or <member>ParseResult::ContFlags</member>. Set if none of the
119cdf0e10cSrcweir        above UNI_... single values match a Unicode character parsed. */
120cdf0e10cSrcweir    const long UNI_OTHER            = 0x20000000;
121cdf0e10cSrcweir
122cdf0e10cSrcweir    /** Only valid for <em>nStartCharFlags</em> parameter to
123cdf0e10cSrcweir        <method>ChararacterClassification::parseAnyToken</method> and
124cdf0e10cSrcweir        <method>ChararacterClassification::parsePredefinedToken</method>,
125cdf0e10cSrcweir        ignored on <em>nContCharFlags</em> parameter.
126cdf0e10cSrcweir        <strong>Not</strong> set in <type>ParseResult</type>. */
127cdf0e10cSrcweir    const long IGNORE_LEADING_WS    = 0x40000000;
128cdf0e10cSrcweir
129cdf0e10cSrcweir
130cdf0e10cSrcweir    // useful combinations
131cdf0e10cSrcweir
132cdf0e10cSrcweir    /// ASCII a-zA-Z lower or upper alpha
133cdf0e10cSrcweir    const long ASC_ALPHA            = ASC_UPALPHA | ASC_LOALPHA;
134cdf0e10cSrcweir
135cdf0e10cSrcweir    /// ASCII a-zA-Z0-9 alphanumeric
136cdf0e10cSrcweir    const long ASC_ALNUM            = ASC_ALPHA | ASC_DIGIT;
137cdf0e10cSrcweir
138cdf0e10cSrcweir    /// Unicode (above 127) lower or upper or title case alpha
139cdf0e10cSrcweir    const long UNI_ALPHA            = UNI_UPALPHA | UNI_LOALPHA | UNI_TITLE_ALPHA;
140cdf0e10cSrcweir
141cdf0e10cSrcweir    /// Unicode (above 127) alphanumeric
142cdf0e10cSrcweir    const long UNI_ALNUM            = UNI_ALPHA | UNI_DIGIT;
143cdf0e10cSrcweir
144cdf0e10cSrcweir    /// Unicode (above 127) alpha or letter
145cdf0e10cSrcweir    const long UNI_LETTER           = UNI_ALPHA | UNI_MODIFIER_LETTER |
146cdf0e10cSrcweir                                        UNI_OTHER_LETTER;
147cdf0e10cSrcweir
148cdf0e10cSrcweir    /// Unicode (above 127) number
149cdf0e10cSrcweir    const long UNI_NUMBER           = UNI_DIGIT | UNI_LETTER_NUMBER |
150cdf0e10cSrcweir                                        UNI_OTHER_NUMBER;
151cdf0e10cSrcweir
152cdf0e10cSrcweir    /// any (ASCII or Unicode) alpha
153cdf0e10cSrcweir    const long ANY_ALPHA            = ASC_ALPHA | UNI_ALPHA;
154cdf0e10cSrcweir
155cdf0e10cSrcweir    /// any (ASCII or Unicode) digit
156cdf0e10cSrcweir    const long ANY_DIGIT            = ASC_DIGIT | UNI_DIGIT;
157cdf0e10cSrcweir
158cdf0e10cSrcweir    /// any (ASCII or Unicode) alphanumeric
159cdf0e10cSrcweir    const long ANY_ALNUM            = ASC_ALNUM | UNI_ALNUM;
160cdf0e10cSrcweir
161cdf0e10cSrcweir    /// any (ASCII or Unicode) letter
162cdf0e10cSrcweir    const long ANY_LETTER           = ASC_ALPHA | UNI_LETTER;
163cdf0e10cSrcweir
164cdf0e10cSrcweir    /// any (ASCII or Unicode) number
165cdf0e10cSrcweir    const long ANY_NUMBER           = ASC_DIGIT | UNI_NUMBER;
166cdf0e10cSrcweir
167cdf0e10cSrcweir    /// any (ASCII or Unicode) letter or number
168cdf0e10cSrcweir    const long ANY_LETTER_OR_NUMBER = ANY_LETTER | ANY_NUMBER;
169cdf0e10cSrcweir};
170cdf0e10cSrcweir
171cdf0e10cSrcweir//============================================================================
172cdf0e10cSrcweir}; }; }; };
173cdf0e10cSrcweir
174cdf0e10cSrcweir#endif
175