xref: /trunk/main/offapi/com/sun/star/util/SearchFlags.idl (revision 21947a42)
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_lang_SearchFlags_idl__
25#define __com_sun_star_lang_SearchFlags_idl__
26
27
28//=============================================================================
29
30module com { module sun { module star { module util {
31
32//=============================================================================
33
34/// Flags for search methods
35published constants SearchFlags
36{
37    /**
38        @deprecated The constant ALL_IGNORE_CASE is never supported - use
39                    <const scope="com::sun::star::i18n">TransliterationModules::IGNORE_CASE</const>
40                    with
41                    <member>SearchOptions::transliterateFlags</member>
42                    instead.
43
44        @see <type scope="com::sun::star::i18n">TransliterationModules</type>
45    */
46    const long  ALL_IGNORE_CASE     = 0x00000001;
47
48    /** Flag for normal (Boyer-Moore) search / Search for word only. */
49    const long  NORM_WORD_ONLY      = 0x00000010;
50
51    /** Flag for "regular expression" search / Interpret as extended
52        regular expression.
53
54        @deprecated The flag is currently not supported by OOo.
55    */
56    const long  REG_EXTENDED        = 0x00000100;
57
58    /** Flag for "regular expression" search / No register information
59        or backreferences, i.e., avoid sub expressions. Return only
60        true/false if matched or not.
61
62        @deprecated The flag is currently not supported by OOo.
63    */
64    const long  REG_NOSUB           = 0x00000200;
65
66    /** Flag for "regular expression" search / Special new line
67        treatment.
68
69        @deprecated The flag is currently not supported by OOo.
70
71        <p> A NEWLINE character in string will not be matched by a
72        period outside bracket expression or by any form of a non
73        matching list. </p>
74
75        <p> A circumflex (^) in pattern when used to specify expression
76        anchoring will match the zero length string immediately after a
77        newline in string, regardless of the setting of
78        REG_NOT_BEGINOFLINE. </p>
79
80        <p> A dollar-sign ($) in pattern when used to specify expression
81        anchoring, will match zero-length string immediately before a
82        new line in string, regardless of the setting of
83        REG_NOT_ENDOFLINE. </p>
84    */
85    const long  REG_NEWLINE         = 0x00000400;
86
87    /** The first character in the string is not the beginning of the
88        line therefore ^ will not match with first character of the
89        string.
90    */
91    const long  REG_NOT_BEGINOFLINE = 0x00000800;
92
93    /** The last character in the string is not the end of the line
94        therefore $ will not match with last character of the string.
95    */
96    const long  REG_NOT_ENDOFLINE   = 0x00001000;
97
98    /** Flag for "Weighted Levenshtein Distance" search / Relaxed
99        checking of limit, split weigh pools.
100
101        <p> If not specified (<b>strict</b>), the search is successful if
102        the WLD is within a calculated limit where each insertion,
103        deletion and replacement adds a weight to a common pool of
104        weights. This is the mathematically correct WLD. </p>
105
106        <p> From a user's point of view the strict WLD is an
107        exclusive-OR of the arguments given, for example if allowed
108        insertions=2 and allowed replacements=2, the search fails if 2
109        characters had been inserted and an additional operation would
110        be needed to match. Depending on the weights it may also fail if
111        1 character was inserted and 1 character replaced and an
112        additional operation would be needed to match. The strict
113        algorithm may match less than expected from a first glance of
114        the specified arguments, but does not return false positives. </p>
115
116        <p> If specified (<b>relaxed</b>), the search is also successful
117        if the combined pool for insertions and deletions is below a
118        doubled calculated limit and replacements are treated
119        differently. Additionally, swapped characters are counted as one
120        replacement. </p>
121
122        <p> From a user's point of view the relaxed WLD is an
123        inclusive-OR of the arguments given, for example if allowed
124        insertions=2 and allowed replacements=2, the search succeeds if
125        2 characters had been inserted and an additional replacement is
126        needed to match. The relaxed algorithm may return false
127        positives, but meets user expectation better. </p>
128    */
129    const long  LEV_RELAXED     = 0x00010000;
130};
131
132//=============================================================================
133}; }; }; };
134
135#endif
136
137