]> git.lyx.org Git - lyx.git/blob - src/lyxfind.h
rename Inset to InsetOld
[lyx.git] / src / lyxfind.h
1 // -*- C++ -*-
2 #ifndef LYXFIND_H
3 #define LYXFIND_H
4
5 #include "LString.h"
6 #include "support/types.h"
7
8 class BufferView;
9 class LyXText;
10
11 namespace lyxfind {
12
13 enum SearchResult {
14         //
15         SR_NOT_FOUND = 0,
16         //
17         SR_FOUND,
18         //
19         SR_FOUND_NOUPDATE
20 };
21
22
23 int LyXReplace(BufferView * bv,
24                string const &, string const &,
25                bool, bool = true, bool = false,
26                bool = false, bool = false);
27
28 /**
29  * This function is called as a general interface to find some
30  * text from the actual cursor position in whatever direction
31  * we want to go. This does also update the screen.
32  */
33 bool LyXFind(BufferView *,
34              string const & searchstr, bool forward,
35              bool casesens = true, bool matchwrd = false);
36
37 /**
38  * This function does search from the cursor position inside the
39  * passed LyXText parameter and regards this LyXText as the root
40  * LyXText. It will NOT update any screen stuff. It will however
41  * set the cursor to the new position inside LyXText, before
42  * returning to the calling function.
43  */
44
45 SearchResult LyXFind(BufferView *, LyXText * text,
46                      string const & searchstr, bool forward,
47                      bool casesens = true, bool matchwrd = false);
48
49 /// find the next change in the buffer
50 bool findNextChange(BufferView * bv);
51
52 SearchResult findNextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
53
54 SearchResult nextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
55
56 } // end namespace LyXFind
57
58 #endif // LYXFIND_H