]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlSearch.C
the monster patch
[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 #include "frontends/LyXView.h"
19
20 using std::string;
21
22
23 /* The ControlSeach class is now in a fit state to derive from
24    Dialog::Controller
25 */
26 ControlSearch::ControlSearch(LyXView & lv, Dialogs & d)
27         : ControlDialogBD(lv, d)
28 {}
29
30
31 void ControlSearch::find(string const & search,
32                          bool casesensitive, bool matchword, bool forward)
33 {
34         string const data =
35                 lyx::find::find2string(search,
36                                        casesensitive, matchword, forward);
37         lv_.dispatch(FuncRequest(LFUN_WORD_FIND, data));
38 }
39
40
41 void ControlSearch::replace(string const & search, string const & replace,
42                             bool casesensitive, bool matchword, bool forward, bool all)
43 {
44         string const data =
45                 lyx::find::replace2string(search, replace,
46                                           casesensitive, matchword, all, forward);
47         lv_.dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
48 }