]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSearch.C
5 new lfuns, move all apply code out of ControlDocument and into the core.
[lyx.git] / src / frontends / controllers / ControlSearch.C
1 /**
2  * \file ControlSearch.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "ControlSearch.h"
14
15 #include "funcrequest.h"
16 #include "lyxfind.h"
17
18 using std::string;
19
20
21 ControlSearch::ControlSearch(Dialog & parent)
22         : Dialog::Controller(parent)
23 {}
24
25
26 void ControlSearch::find(string const & search, bool casesensitive,
27                          bool matchword, bool forward)
28 {
29         string const data = lyx::find::find2string(search, casesensitive,
30                                                    matchword, forward);
31         kernel().dispatch(FuncRequest(LFUN_WORD_FIND, data));
32 }
33
34
35 void ControlSearch::replace(string const & search, string const & replace,
36                             bool casesensitive, bool matchword,
37                             bool forward, bool all)
38 {
39         string const data =
40                 lyx::find::replace2string(search, replace, casesensitive,
41                                           matchword, all, forward);
42         kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
43 }