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