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