3 * \file FindAndReplace.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Tommaso Cucinotta
9 * Full author contact details are available in file CREDITS.
15 #include "GuiWorkArea.h"
18 #include "ui_FindAndReplaceUi.h"
20 #include "BufferView.h"
33 class FindAndReplace : public DockView, public Ui::FindAndReplaceUi
37 FindAndReplace(GuiView & parent);
41 bool initialiseParams(std::string const &) { return true; }
43 void dispatchParams() {}
44 bool isBufferDependent() const { return true; }
47 void showEvent(QShowEvent * ev);
48 void hideEvent(QHideEvent * ev);
52 //virtual void update_contents() {}
55 void on_findNextPB_clicked();
56 void on_findPrevPB_clicked();
57 void on_replacePB_clicked();
58 void on_replaceallPB_clicked();
59 void on_closePB_clicked();
60 void on_regexpInsertCombo_currentIndexChanged(int index);
63 void find(bool backwards);
64 virtual bool wantInitialFocus() const { return true; }
67 // add a string to the combo if needed
68 void remember(std::string const & find, QComboBox & combo);
69 void findAdv(bool casesensitive,
70 bool matchword, bool backwards,
71 bool expandmacros, bool ignoreformat);
73 GuiView & parent_view_;
75 Buffer *searchBuffer_;
76 BufferView *searchBufferView_;
78 GuiWorkArea * searchWorkArea_; // The work area defining what to search
80 /// @TODO: Investigate on focus issue and remove this ugly hack, please !
81 QTimer delayedFocusTimer_;
82 void disableSearchWorkArea();
86 virtual void apply() {}
88 void find(docstring const & str, int len, bool casesens,
89 bool words, bool backwards, bool expandmacros);
91 void replace(docstring const & findstr,
92 docstring const & replacestr,
93 bool casesens, bool words, bool backwards, bool expandmacros, bool all);
94 bool eventFilter(QObject *obj, QEvent *event);
97 /// this happens when the dialog is simply closed/hidden
98 void closeEvent(QCloseEvent * e);
99 /// this happens 100ms after dialog showEvent()
100 void onDelayedFocus();
104 } // namespace frontend
107 #endif // QSEARCHADV_H