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 FindAndReplaceWidget : public QTabWidget, public Ui::FindAndReplaceUi
38 FindAndReplaceWidget(GuiView & view);
39 bool initialiseParams(std::string const & params);
45 /// add a string to the combo if needed
46 void remember(std::string const & find, QComboBox & combo);
48 /// Perform the scope-related buffer switch while searching
49 bool findAndReplaceScope(FindAndReplaceOptions & opt, bool replace_all = false);
51 /// Collect options from the GUI elements, then perform the search
52 bool findAndReplace(bool backwards, bool replace, bool replace_all = false);
54 /// FIXME Probably to be merged with findAndReplace(bool, bool, bool)
55 bool findAndReplace(bool casesensitive, bool matchword, bool backwards,
56 bool expandmacros, bool ignoreformat, bool replace,
57 bool keep_case, bool replace_all = false);
59 bool eventFilter(QObject *obj, QEvent *event);
61 void virtual showEvent(QShowEvent *ev);
62 void virtual hideEvent(QHideEvent *ev);
67 void on_findNextPB_clicked();
68 void on_replacePB_clicked();
69 void on_replaceallPB_clicked();
73 class FindAndReplace : public DockView
78 GuiView & parent, ///< the main window where to dock.
79 Qt::DockWidgetArea area = Qt::RightDockWidgetArea, ///< Position of the dock (and also drawer)
80 Qt::WindowFlags flags = 0);
84 bool initialiseParams(std::string const &);
86 void dispatchParams() {}
87 bool isBufferDependent() const { return true; }
92 //virtual void update_contents() {}
95 virtual bool wantInitialFocus() const { return true; }
98 /// The encapsulated widget.
99 FindAndReplaceWidget * widget_;
103 } // namespace frontend
106 #endif // QSEARCHADV_H