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