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