xref: /trunk/main/offapi/com/sun/star/util/SearchFlags.idl (revision b63233d8)
1*b63233d8Sdamjan/**************************************************************
2*b63233d8Sdamjan *
3*b63233d8Sdamjan * Licensed to the Apache Software Foundation (ASF) under one
4*b63233d8Sdamjan * or more contributor license agreements.  See the NOTICE file
5*b63233d8Sdamjan * distributed with this work for additional information
6*b63233d8Sdamjan * regarding copyright ownership.  The ASF licenses this file
7*b63233d8Sdamjan * to you under the Apache License, Version 2.0 (the
8*b63233d8Sdamjan * "License"); you may not use this file except in compliance
9*b63233d8Sdamjan * with the License.  You may obtain a copy of the License at
10*b63233d8Sdamjan *
11*b63233d8Sdamjan *   http://www.apache.org/licenses/LICENSE-2.0
12*b63233d8Sdamjan *
13*b63233d8Sdamjan * Unless required by applicable law or agreed to in writing,
14*b63233d8Sdamjan * software distributed under the License is distributed on an
15*b63233d8Sdamjan * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b63233d8Sdamjan * KIND, either express or implied.  See the License for the
17*b63233d8Sdamjan * specific language governing permissions and limitations
18*b63233d8Sdamjan * under the License.
19*b63233d8Sdamjan *
20*b63233d8Sdamjan *************************************************************/
21*b63233d8Sdamjan
22*b63233d8Sdamjan
23*b63233d8Sdamjan
24*b63233d8Sdamjan#ifndef __com_sun_star_lang_SearchFlags_idl__
25*b63233d8Sdamjan#define __com_sun_star_lang_SearchFlags_idl__
26*b63233d8Sdamjan
27*b63233d8Sdamjan
28*b63233d8Sdamjan//=============================================================================
29*b63233d8Sdamjan
30*b63233d8Sdamjanmodule com { module sun { module star { module util {
31*b63233d8Sdamjan
32*b63233d8Sdamjan//=============================================================================
33*b63233d8Sdamjan
34*b63233d8Sdamjan/// Flags for search methods
35*b63233d8Sdamjanpublished constants SearchFlags
36*b63233d8Sdamjan{
37*b63233d8Sdamjan    /**
38*b63233d8Sdamjan        @deprecated The constant ALL_IGNORE_CASE is never supported - use
39*b63233d8Sdamjan                    <const scope="com::sun::star::i18n">TransliterationModules::IGNORE_CASE</const>
40*b63233d8Sdamjan                    with
41*b63233d8Sdamjan                    <member>SearchOptions::transliterateFlags</member>
42*b63233d8Sdamjan                    instead.
43*b63233d8Sdamjan
44*b63233d8Sdamjan        @see <type scope="com::sun::star::i18n">TransliterationModules</type>
45*b63233d8Sdamjan    */
46*b63233d8Sdamjan    const long  ALL_IGNORE_CASE     = 0x00000001;
47*b63233d8Sdamjan
48*b63233d8Sdamjan    /** Flag for normal (Boyer-Moore) search / Search for word only. */
49*b63233d8Sdamjan    const long  NORM_WORD_ONLY      = 0x00000010;
50*b63233d8Sdamjan
51*b63233d8Sdamjan    /** Flag for "regular expression" search / Interpret as extended
52*b63233d8Sdamjan        regular expression.
53*b63233d8Sdamjan
54*b63233d8Sdamjan        @deprecated The flag is currently not supported by OOo.
55*b63233d8Sdamjan    */
56*b63233d8Sdamjan    const long  REG_EXTENDED        = 0x00000100;
57*b63233d8Sdamjan
58*b63233d8Sdamjan    /** Flag for "regular expression" search / No register information
59*b63233d8Sdamjan        or backreferences, i.e., avoid sub expressions. Return only
60*b63233d8Sdamjan        true/false if matched or not.
61*b63233d8Sdamjan
62*b63233d8Sdamjan        @deprecated The flag is currently not supported by OOo.
63*b63233d8Sdamjan    */
64*b63233d8Sdamjan    const long  REG_NOSUB           = 0x00000200;
65*b63233d8Sdamjan
66*b63233d8Sdamjan    /** Flag for "regular expression" search / Special new line
67*b63233d8Sdamjan        treatment.
68*b63233d8Sdamjan
69*b63233d8Sdamjan        @deprecated The flag is currently not supported by OOo.
70*b63233d8Sdamjan
71*b63233d8Sdamjan        <p> A NEWLINE character in string will not be matched by a
72*b63233d8Sdamjan        period outside bracket expression or by any form of a non
73*b63233d8Sdamjan        matching list. </p>
74*b63233d8Sdamjan
75*b63233d8Sdamjan        <p> A circumflex (^) in pattern when used to specify expression
76*b63233d8Sdamjan        anchoring will match the zero length string immediately after a
77*b63233d8Sdamjan        newline in string, regardless of the setting of
78*b63233d8Sdamjan        REG_NOT_BEGINOFLINE. </p>
79*b63233d8Sdamjan
80*b63233d8Sdamjan        <p> A dollar-sign ($) in pattern when used to specify expression
81*b63233d8Sdamjan        anchoring, will match zero-length string immediately before a
82*b63233d8Sdamjan        new line in string, regardless of the setting of
83*b63233d8Sdamjan        REG_NOT_ENDOFLINE. </p>
84*b63233d8Sdamjan    */
85*b63233d8Sdamjan    const long  REG_NEWLINE         = 0x00000400;
86*b63233d8Sdamjan
87*b63233d8Sdamjan    /** The first character in the string is not the beginning of the
88*b63233d8Sdamjan        line therefore ^ will not match with first character of the
89*b63233d8Sdamjan        string.
90*b63233d8Sdamjan    */
91*b63233d8Sdamjan    const long  REG_NOT_BEGINOFLINE = 0x00000800;
92*b63233d8Sdamjan
93*b63233d8Sdamjan    /** The last character in the string is not the end of the line
94*b63233d8Sdamjan        therefore $ will not match with last character of the string.
95*b63233d8Sdamjan    */
96*b63233d8Sdamjan    const long  REG_NOT_ENDOFLINE   = 0x00001000;
97*b63233d8Sdamjan
98*b63233d8Sdamjan    /** Flag for "Weighted Levenshtein Distance" search / Relaxed
99*b63233d8Sdamjan        checking of limit, split weigh pools.
100*b63233d8Sdamjan
101*b63233d8Sdamjan        <p> If not specified (<b>strict</b>), the search is sucessful if
102*b63233d8Sdamjan        the WLD is within a calculated limit where each insertion,
103*b63233d8Sdamjan        deletion and replacement adds a weight to a common pool of
104*b63233d8Sdamjan        weights. This is the mathematically correct WLD. </p>
105*b63233d8Sdamjan
106*b63233d8Sdamjan        <p> From a user's point of view the strict WLD is an
107*b63233d8Sdamjan        exclusive-OR of the arguments given, for example if allowed
108*b63233d8Sdamjan        insertions=2 and allowed replacements=2, the search fails if 2
109*b63233d8Sdamjan        characters had been inserted and an additional operation would
110*b63233d8Sdamjan        be needed to match. Depending on the weights it may also fail if
111*b63233d8Sdamjan        1 character was inserted and 1 character replaced and an
112*b63233d8Sdamjan        additional operation would be needed to match. The strict
113*b63233d8Sdamjan        algorithm may match less than expected from a first glance of
114*b63233d8Sdamjan        the specified arguments, but does not return false positives. </p>
115*b63233d8Sdamjan
116*b63233d8Sdamjan        <p> If specified (<b>relaxed</b>), the search is also successful
117*b63233d8Sdamjan        if the combined pool for insertions and deletions is below a
118*b63233d8Sdamjan        doubled calculated limit and replacements are treated
119*b63233d8Sdamjan        differently. Additionally, swapped characters are counted as one
120*b63233d8Sdamjan        replacement. </p>
121*b63233d8Sdamjan
122*b63233d8Sdamjan        <p> From a user's point of view the relaxed WLD is an
123*b63233d8Sdamjan        inclusive-OR of the arguments given, for example if allowed
124*b63233d8Sdamjan        insertions=2 and allowed replacements=2, the search succeeds if
125*b63233d8Sdamjan        2 characters had been inserted and an additional replacement is
126*b63233d8Sdamjan        needed to match. The relaxed algorithm may return false
127*b63233d8Sdamjan        positives, but meets user expectation better. </p>
128*b63233d8Sdamjan    */
129*b63233d8Sdamjan    const long  LEV_RELAXED     = 0x00010000;
130*b63233d8Sdamjan};
131*b63233d8Sdamjan
132*b63233d8Sdamjan//=============================================================================
133*b63233d8Sdamjan}; }; }; };
134*b63233d8Sdamjan
135*b63233d8Sdamjan#endif
136*b63233d8Sdamjan
137