]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/GuiSearch.h
GuiSearch: catch global shortcuts to find forwards/backwards (#11170)
[lyx.git] / src / frontends / qt / GuiSearch.h
1 // -*- C++ -*-
2 /**
3  * \file GuiSearch.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUISEARCH_H
14 #define GUISEARCH_H
15
16 #include "GuiDialog.h"
17 #include "ui_SearchUi.h"
18
19 namespace lyx {
20 namespace frontend {
21
22 class GuiSearch : public GuiDialog, public Ui::SearchUi
23 {
24         Q_OBJECT
25
26 public:
27         GuiSearch(GuiView & lv);
28
29 private Q_SLOTS:
30         void findChanged();
31         void findClicked(bool const backwards = false);
32         void replaceClicked();
33         void replaceallClicked();
34
35 private:
36         ///
37         void keyPressEvent(QKeyEvent * e) override;
38         ///
39         void showEvent(QShowEvent * e) override;
40         ///
41         bool initialiseParams(std::string const &) override { return true; }
42         void clearParams() override {}
43         void dispatchParams() override {}
44         bool isBufferDependent() const override { return true; }
45
46         /// Searches occurrence of string
47         void find(docstring const & search,
48                   bool casesensitive, bool matchword, bool forward);
49
50         /// Replaces occurrence of string
51         void replace(docstring const & search, docstring const & replace,
52                      bool casesensitive, bool matchword,
53                      bool forward, bool all);
54 };
55
56 } // namespace frontend
57 } // namespace lyx
58
59 #endif // GUISEARCH_H