]> git.lyx.org Git - lyx.git/blob - src/lyxfind.h
61e3977053bd935b4bdd1a5df94b525c93a5967b
[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  * \author Alfredo Braunstein
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef LYXFIND_H
16 #define LYXFIND_H
17
18 #include "support/types.h"
19
20 #include <string>
21
22 class BufferView;
23 class LyXText;
24
25 namespace lyx {
26 namespace find {
27
28 /**
29  * This function replaces an ocurrence of \param search with the
30  * string \param replace
31  *
32  *  \param bv the BufferView in which the search is to be performed,
33  *         starting at the current cursor position.
34  *  \param search the string we're looking for.
35  *  \param replace if \c search is found, replace it with this.
36  *  \param cs perform a case-sensitive search for \c search.
37  *  \param mw match whole words only.
38  *  \param fw search forward from the current cursor position.
39  */
40
41 int replace(BufferView * bv,
42             std::string const & search, std::string const & replace,
43             bool cs, bool mw, bool fw);
44 /**
45  * This function replaces all ocurrences of \param search with
46  * the string \param replace
47  *
48  *  \param bv the BufferView in which the search is to be performed,
49  *         starting at the current cursor position.
50  *  \param search the string we're looking for.
51  *  \param replace if \c search is found, replace it with this.
52  *  \param cs perform a case-sensitive search for \c search.
53  *  \param mw match whole words only.
54  */
55
56 int replaceAll(BufferView * bv,
57                std::string const & search, std::string const & replace,
58                bool cs, bool mw);
59
60 /**
61  * This function is called as a general interface to find some text
62  * from the actual cursor position in whatever direction we want to
63  * go. This does also update the screen.
64  */
65 bool find(BufferView *, std::string const & search, 
66           bool cs, bool mw, bool fw);
67
68
69 /// find the next change in the buffer
70 bool findNextChange(BufferView * bv);
71
72 } // namespace find
73 } // namespace lyx
74
75 #endif // LYXFIND_H