]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QSearch.C
dont use pragma impementation and interface anymore
[lyx.git] / src / frontends / qt2 / QSearch.C
1 /**
2  * \file QSearch.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13
14 #include "LyXView.h"
15 #include "ControlSearch.h"
16 #include "qt_helpers.h"
17
18 #include "QSearch.h"
19 #include "QSearchDialog.h"
20 #include "Qt2BC.h"
21
22 #include <qpushbutton.h>
23 #include <qcheckbox.h>
24 #include <qcombobox.h>
25
26
27 typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
28
29
30 QSearch::QSearch()
31         : base_class(qt_("Search"))
32 {
33 }
34
35
36 void QSearch::build_dialog()
37 {
38         dialog_.reset(new QSearchDialog(this));
39
40         bc().setCancel(dialog_->closePB);
41         bc().addReadOnly(dialog_->replaceCO);
42         bc().addReadOnly(dialog_->replacePB);
43         bc().addReadOnly(dialog_->replaceallPB);
44         bc().addReadOnly(dialog_->caseCB);
45         bc().addReadOnly(dialog_->wordsCB);
46         bc().addReadOnly(dialog_->backwardsCB);
47
48         dialog_->replacePB->setEnabled(false);
49         dialog_->replaceallPB->setEnabled(false);
50 }
51
52
53 void QSearch::find(string const & str, bool casesens,
54                    bool words, bool backwards)
55 {
56         controller().find(str, casesens, words, !backwards);
57 }
58
59
60 void QSearch::replace(string const & findstr, string const & replacestr,
61         bool casesens, bool words, bool all)
62 {
63         controller().replace(findstr, replacestr, casesens, words, all);
64 }