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