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.
16 // This is needed so that ui_FindAndReplaceUi.h can find qt_()
17 #include "qt_helpers.h"
18 #include "ui_FindAndReplaceUi.h"
19 #include "support/docstring.h"
25 class FindAndReplaceOptions;
29 class FindAndReplaceWidget : public QTabWidget, public Ui::FindAndReplaceUi
34 FindAndReplaceWidget(GuiView & view);
35 bool initialiseParams(std::string const & params);
41 void dockLocationChanged(Qt::DockWidgetArea area);
49 /// add a string to the combo if needed
50 void remember(std::string const & find, QComboBox & combo);
52 /// Perform the scope-related buffer switch while searching
53 bool findAndReplaceScope(FindAndReplaceOptions & opt, bool replace_all = false);
55 /// Collect options from the GUI elements, then perform the search
56 bool findAndReplace(bool backwards, bool replace, bool replace_all = false);
58 /// FIXME Probably to be merged with findAndReplace(bool, bool, bool)
59 bool findAndReplace(bool casesensitive, bool matchword, bool backwards,
60 bool expandmacros, bool ignoreformat, bool replace,
61 bool keep_case, bool replace_all = false);
63 bool eventFilter(QObject *obj, QEvent *event) override;
65 void virtual showEvent(QShowEvent *ev) override;
66 void virtual hideEvent(QHideEvent *ev) override;
70 void setFormatIgnores(bool const b);
72 docstring const checkState(std::string const s, bool const b);
75 void on_findNextPB_clicked();
76 void on_replacePB_clicked();
77 void on_replaceallPB_clicked();
78 void on_searchbackCB_clicked();
79 void on_selectAllPB_clicked();
80 void on_deselectAllPB_clicked();
84 class FindAndReplace : public DockView
89 GuiView & parent, ///< the main window where to dock.
90 Qt::DockWidgetArea area = Qt::RightDockWidgetArea, ///< Position of the dock (and also drawer)
91 Qt::WindowFlags flags = {});
95 bool initialiseParams(std::string const &) override;
96 void clearParams() override {}
97 void dispatchParams() override {}
98 bool isBufferDependent() const override { return false; }
99 bool canApplyToReadOnly() const override { return true; }
103 void updateView() override;
104 //virtual void update_contents() {}
107 bool wantInitialFocus() const override { return true; }
110 /// The encapsulated widget.
111 FindAndReplaceWidget * widget_;
115 } // namespace frontend
118 #endif // QSEARCHADV_H