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