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 /// FIXME Probably to be merged with findAndReplace(bool, bool)
50 bool casesensitive, bool matchword, bool backwards,
51 bool expandmacros, bool ignoreformat, bool replace,
55 /// Perform the scope-related buffer switch while searching
56 void findAndReplaceScope(FindAndReplaceOptions & opt);
58 /// Collect options from the GUI elements, then perform the search
59 void findAndReplace(bool backwards, bool replace);
61 bool eventFilter(QObject *obj, QEvent *event);
63 void virtual showEvent(QShowEvent *ev);
64 void virtual hideEvent(QHideEvent *ev);
69 void on_findNextPB_clicked();
70 void on_replacePB_clicked();
71 void on_replaceallPB_clicked();
75 class FindAndReplace : public DockView
80 GuiView & parent, ///< the main window where to dock.
81 Qt::DockWidgetArea area = Qt::RightDockWidgetArea, ///< Position of the dock (and also drawer)
82 Qt::WindowFlags flags = 0);
86 bool initialiseParams(std::string const &);
88 void dispatchParams() {}
89 bool isBufferDependent() const { return true; }
94 //virtual void update_contents() {}
97 virtual bool wantInitialFocus() const { return true; }
100 /// The encapsulated widget.
101 FindAndReplaceWidget * widget_;
105 } // namespace frontend
108 #endif // QSEARCHADV_H