]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/FindAndReplace.h
Oops.. compile fix.
[lyx.git] / src / frontends / qt4 / FindAndReplace.h
1 // -*- C++ -*-
2 /**
3  * \file FindAndReplace.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Tommaso Cucinotta
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QSEARCHADV_H
13 #define QSEARCHADV_H
14
15 #include "GuiWorkArea.h"
16
17 #include "DockView.h"
18 #include "ui_FindAndReplaceUi.h"
19
20 #include "BufferView.h"
21 #include "Buffer.h"
22 #include "LyX.h"
23 #include "LyXFunc.h"
24 #include "Text.h"
25
26 #include <QDialog>
27
28 #include <string>
29
30 namespace lyx {
31 namespace frontend {
32
33 class FindAndReplace : public DockView, public Ui::FindAndReplaceUi
34 {
35         Q_OBJECT
36 public:
37         FindAndReplace(GuiView & parent);
38
39         bool initialiseParams(std::string const &);
40         void clearParams() {}
41         void dispatchParams() {}
42         bool isBufferDependent() const { return true; }
43         void selectAll();
44
45         /// update
46         void updateView() {}
47         //virtual void update_contents() {}
48
49 protected Q_SLOTS:
50         void on_findNextPB_clicked();
51         void on_findPrevPB_clicked();
52         void on_replacePB_clicked();
53         void on_replaceallPB_clicked();
54         void on_closePB_clicked();
55         void on_regexpInsertCombo_currentIndexChanged(int index);
56
57 protected:
58         void find(bool backwards);
59         virtual bool wantInitialFocus() const { return true; }
60
61 private:
62         // add a string to the combo if needed
63         void remember(std::string const & find, QComboBox & combo);
64         void findAdv(bool casesensitive,
65                         bool matchword, bool backwards,
66                         bool expandmacros, bool ignoreformat);
67
68 private:
69         /// Apply changes
70         virtual void apply() {}
71
72         void find(docstring const & str, int len, bool casesens,
73                   bool words, bool backwards, bool expandmacros);
74
75         void replace(docstring const & findstr,
76                      docstring const & replacestr,
77                      bool casesens, bool words, bool backwards, bool expandmacros, bool all);
78         bool eventFilter(QObject *obj, QEvent *event);
79 };
80
81
82 } // namespace frontend
83 } // namespace lyx
84
85 #endif // QSEARCHADV_H