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 .
22 module com
{ module sun
{ module star
{ module util
{
25 /// Flags for search methods
26 published constants SearchFlags
29 @deprecated The constant ALL_IGNORE_CASE is never supported - use
30 com::sun::star::i18n::TransliterationModules::IGNORE_CASE
32 SearchOptions::transliterateFlags()
35 @see com::sun::star::i18n::TransliterationModules
37 const long ALL_IGNORE_CASE
= 0x00000001;
39 /** Flag for normal (Boyer-Moore) search / Search for word only. */
40 const long NORM_WORD_ONLY
= 0x00000010;
42 /** Flag for "regular expression" search / Interpret as extended
45 @deprecated The flag is currently not supported by OOo.
47 const long REG_EXTENDED
= 0x00000100;
49 /** Flag for "regular expression" search / No register information
50 or backreferences, i.e., avoid sub expressions. Return only
51 true/false if matched or not.
53 @deprecated The flag is currently not supported by OOo.
55 const long REG_NOSUB
= 0x00000200;
57 /** Flag for "regular expression" search / Special new line
60 @deprecated The flag is currently not supported by OOo.
62 <p> A NEWLINE character in string will not be matched by a
63 period outside bracket expression or by any form of a non
66 <p> A circumflex (^) in pattern when used to specify expression
67 anchoring will match the zero length string immediately after a
68 newline in string, regardless of the setting of
69 REG_NOT_BEGINOFLINE. </p>
71 <p> A dollar-sign ($) in pattern when used to specify expression
72 anchoring, will match zero-length string immediately before a
73 new line in string, regardless of the setting of
74 REG_NOT_ENDOFLINE. </p>
76 const long REG_NEWLINE
= 0x00000400;
78 /** The first character in the string is not the beginning of the
79 line therefore ^ will not match with first character of the
82 const long REG_NOT_BEGINOFLINE
= 0x00000800;
84 /** The last character in the string is not the end of the line
85 therefore $ will not match with last character of the string.
87 const long REG_NOT_ENDOFLINE
= 0x00001000;
89 /** Flag for "Weighted Levenshtein Distance" search / Relaxed
90 checking of limit, split weigh pools.
92 <p> If not specified (<b>strict</b>), the search is successful if
93 the WLD is within a calculated limit where each insertion,
94 deletion and replacement adds a weight to a common pool of
95 weights. This is the mathematically correct WLD. </p>
97 <p> From a user's point of view the strict WLD is an
98 exclusive-OR of the arguments given, for example if allowed
99 insertions=2 and allowed replacements=2, the search fails if 2
100 characters had been inserted and an additional operation would
101 be needed to match. Depending on the weights it may also fail if
102 1 character was inserted and 1 character replaced and an
103 additional operation would be needed to match. The strict
104 algorithm may match less than expected from a first glance of
105 the specified arguments, but does not return false positives. </p>
107 <p> If specified (<b>relaxed</b>), the search is also successful
108 if the combined pool for insertions and deletions is below a
109 doubled calculated limit and replacements are treated
110 differently. Additionally, swapped characters are counted as one
113 <p> From a user's point of view the relaxed WLD is an
114 inclusive-OR of the arguments given, for example if allowed
115 insertions=2 and allowed replacements=2, the search succeeds if
116 2 characters had been inserted and an additional replacement is
117 needed to match. The relaxed algorithm may return false
118 positives, but meets user expectation better. </p>
120 const long LEV_RELAXED
= 0x00010000;
122 /** Flag for wildcards search if entire selection must match the
125 <p> If com::sun::star::util::SearchOptions2::AlgorithmType2 is
126 com::sun::star::util::SearchAlgorithms2::WILDCARD specifies
127 whether a wildcard pattern must match the entire selected range
128 of the string from start position to end position or a substring
129 match is allowed. </p>
131 <p> If set, the entire selection must match. If not set, a
132 substring match is allowed. </p>
134 @since LibreOffice 5.2
136 const long WILD_MATCH_SELECTION
= 0x00100000;
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */