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