]> git.lyx.org Git - lyx.git/blob - src/lyxfind.h
Point fix, earlier forgotten
[lyx.git] / src / lyxfind.h
1 // -*- C++ -*-
2 /**
3  * \file lyxfind.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author John Levon
9  * \author Jürgen Vigna
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef LYXFIND_H
15 #define LYXFIND_H
16
17 #include "LString.h"
18 #include "support/types.h"
19
20 class BufferView;
21 class LyXText;
22
23 namespace lyx {
24 namespace find {
25
26 enum SearchResult {
27         //
28         SR_NOT_FOUND = 0,
29         //
30         SR_FOUND,
31         //
32         SR_FOUND_NOUPDATE
33 };
34
35
36 int replace(BufferView * bv,
37                string const &, string const &,
38                bool, bool = true, bool = false,
39                bool = false, bool = false);
40
41 /**
42  * This function is called as a general interface to find some
43  * text from the actual cursor position in whatever direction
44  * we want to go. This does also update the screen.
45  */
46 bool find(BufferView *,
47              string const & searchstr, bool forward,
48              bool casesens = true, bool matchwrd = false);
49
50 /**
51  * This function does search from the cursor position inside the
52  * passed LyXText parameter and regards this LyXText as the root
53  * LyXText. It will NOT update any screen stuff. It will however
54  * set the cursor to the new position inside LyXText, before
55  * returning to the calling function.
56  */
57
58 SearchResult find(BufferView *, LyXText * text,
59                      string const & searchstr, bool forward,
60                      bool casesens = true, bool matchwrd = false);
61
62 /// find the next change in the buffer
63 bool findNextChange(BufferView * bv);
64
65 SearchResult findNextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
66
67 SearchResult nextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
68
69 } // namespace find
70 } // namespace lyx
71
72 #endif // LYXFIND_H