]> git.lyx.org Git - lyx.git/blob - src/lyxfind.h
code cosmetics to the iterator fix
[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 FuncRequest;
24 class LyXText;
25
26 namespace lyx {
27 namespace find {
28
29 /** Encode the parameters needed to find \c search as a string
30  *  that can be dispatched to the LyX core in a FuncRequest wrapper.
31  */
32 std::string const find2string(std::string const & search,
33                               bool casesensitive,
34                               bool matchword,
35                               bool forward);
36
37 /** Encode the parameters needed to replace \c search with \c replace
38  *  as a string that can be dispatched to the LyX core in a FuncRequest
39  *  wrapper.
40  */
41 std::string const replace2string(std::string const & search,
42                                  std::string const & replace,
43                                  bool casesensitive,
44                                  bool matchword,
45                                  bool all,
46                                  bool forward);
47
48 /** Parse the string encoding of the find request that is found in
49  *  \c ev.argument and act on it.
50  * The string is encoded by \c find2string.
51  */
52 void find(BufferView * bv, FuncRequest const & ev);
53
54 /** Parse the string encoding of the replace request that is found in
55  *  \c ev.argument and act on it.
56  * The string is encoded by \c replace2string.
57  */
58 void replace(BufferView * bv, FuncRequest const &);
59
60 /// find the next change in the buffer
61 bool findNextChange(BufferView * bv);
62
63 } // namespace find
64 } // namespace lyx
65
66 #endif // LYXFIND_H