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"
27 class FindAndReplaceWidget : public QTabWidget, public Ui::FindAndReplaceUi
32 FindAndReplaceWidget(GuiView & view);
33 bool initialiseParams(std::string const & params);
38 void dockLocationChanged(Qt::DockWidgetArea area);
46 /// add a string to the combo if needed
47 void remember(std::string const & find, QComboBox & combo);
49 /// Perform the scope-related buffer switch while searching
50 bool findAndReplaceScope(FindAndReplaceOptions & opt, bool replace_all = false);
52 /// Collect options from the GUI elements, then perform the search
53 bool findAndReplace(bool backwards, bool replace, bool replace_all = false);
55 /// FIXME Probably to be merged with findAndReplace(bool, bool, bool)
56 bool findAndReplace(bool casesensitive, bool matchword, bool backwards,
57 bool expandmacros, bool ignoreformat, bool replace,
58 bool keep_case, bool replace_all = false);
60 bool eventFilter(QObject *obj, QEvent *event);
62 void virtual showEvent(QShowEvent *ev);
63 void virtual hideEvent(QHideEvent *ev);
68 void on_findNextPB_clicked();
69 void on_replacePB_clicked();
70 void on_replaceallPB_clicked();
74 class FindAndReplace : public DockView
79 GuiView & parent, ///< the main window where to dock.
80 Qt::DockWidgetArea area = Qt::RightDockWidgetArea, ///< Position of the dock (and also drawer)
81 Qt::WindowFlags flags = 0);
85 bool initialiseParams(std::string const &) override;
86 void clearParams() override {}
87 void dispatchParams() override {}
88 bool isBufferDependent() const override { return false; }
89 bool canApplyToReadOnly() const override { return true; }
93 void updateView() override;
94 //virtual void update_contents() {}
97 bool wantInitialFocus() const override { return true; }
100 /// The encapsulated widget.
101 FindAndReplaceWidget * widget_;
105 } // namespace frontend
108 #endif // QSEARCHADV_H