1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_util_SearchFlags_idl__
21 #define __com_sun_star_util_SearchFlags_idl__
25 module com
{ module sun
{ module star
{ module util
{
28 /// Flags for search methods
29 published constants SearchFlags
32 @deprecated The constant ALL_IGNORE_CASE is never supported - use
33 com::sun::star::i18n::TransliterationModules::IGNORE_CASE
35 SearchOptions::transliterateFlags()
38 @see com::sun::star::i18n::TransliterationModules
40 const long ALL_IGNORE_CASE
= 0x00000001;
42 /** Flag for normal (Boyer-Moore) search / Search for word only. */
43 const long NORM_WORD_ONLY
= 0x00000010;
45 /** Flag for "regular expression" search / Interpret as extended
48 @deprecated The flag is currently not supported by OOo.
50 const long REG_EXTENDED
= 0x00000100;
52 /** Flag for "regular expression" search / No register information
53 or backreferences, i.e., avoid sub expressions. Return only
54 true/false if matched or not.
56 @deprecated The flag is currently not supported by OOo.
58 const long REG_NOSUB
= 0x00000200;
60 /** Flag for "regular expression" search / Special new line
63 @deprecated The flag is currently not supported by OOo.
65 <p> A NEWLINE character in string will not be matched by a
66 period outside bracket expression or by any form of a non
69 <p> A circumflex (^) in pattern when used to specify expression
70 anchoring will match the zero length string immediately after a
71 newline in string, regardless of the setting of
72 REG_NOT_BEGINOFLINE. </p>
74 <p> A dollar-sign ($) in pattern when used to specify expression
75 anchoring, will match zero-length string immediately before a
76 new line in string, regardless of the setting of
77 REG_NOT_ENDOFLINE. </p>
79 const long REG_NEWLINE
= 0x00000400;
81 /** The first character in the string is not the beginning of the
82 line therefore ^ will not match with first character of the
85 const long REG_NOT_BEGINOFLINE
= 0x00000800;
87 /** The last character in the string is not the end of the line
88 therefore $ will not match with last character of the string.
90 const long REG_NOT_ENDOFLINE
= 0x00001000;
92 /** Flag for "Weighted Levenshtein Distance" search / Relaxed
93 checking of limit, split weigh pools.
95 <p> If not specified (<b>strict</b>), the search is successful if
96 the WLD is within a calculated limit where each insertion,
97 deletion and replacement adds a weight to a common pool of
98 weights. This is the mathematically correct WLD. </p>
100 <p> From a user's point of view the strict WLD is an
101 exclusive-OR of the arguments given, for example if allowed
102 insertions=2 and allowed replacements=2, the search fails if 2
103 characters had been inserted and an additional operation would
104 be needed to match. Depending on the weights it may also fail if
105 1 character was inserted and 1 character replaced and an
106 additional operation would be needed to match. The strict
107 algorithm may match less than expected from a first glance of
108 the specified arguments, but does not return false positives. </p>
110 <p> If specified (<b>relaxed</b>), the search is also successful
111 if the combined pool for insertions and deletions is below a
112 doubled calculated limit and replacements are treated
113 differently. Additionally, swapped characters are counted as one
116 <p> From a user's point of view the relaxed WLD is an
117 inclusive-OR of the arguments given, for example if allowed
118 insertions=2 and allowed replacements=2, the search succeeds if
119 2 characters had been inserted and an additional replacement is
120 needed to match. The relaxed algorithm may return false
121 positives, but meets user expectation better. </p>
123 const long LEV_RELAXED
= 0x00010000;
125 /** Flag for wildcards search if entire selection must match the
128 <p> If com::sun::star::util::SearchOptions2::AlgorithmType2 is
129 com::sun::star::util::SearchAlgorithms2::WILDCARD specifies
130 whether a wildcard pattern must match the entire selected range
131 of the string from start position to end position or a substring
132 match is allowed. </p>
134 <p> If set, the entire selection must match. If not set, a
135 substring match is allowed. </p>
137 @since LibreOffice 5.2
139 const long WILD_MATCH_SELECTION
= 0x00100000;
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */