]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiSearch.h
Make code a bit easier to read
[lyx.git] / src / frontends / qt / GuiSearch.h
index 6e05f49754d9cd2fdbd2b41160af47a5fd5b36d0..89234fe4441de657a64f2655fb20cb1a0b61a949 100644 (file)
@@ -15,7 +15,9 @@
 
 #include "GuiDialog.h"
 #include "DockView.h"
+#include "FancyLineEdit.h"
 
+#include <QMenu>
 #include <QDockWidget>
 
 #include "ui_SearchUi.h"
@@ -30,7 +32,7 @@ class GuiSearchWidget : public QWidget, public Ui::SearchUi
        Q_OBJECT
 
 public:
-       GuiSearchWidget(QWidget * parent);
+       GuiSearchWidget(QWidget * parent, GuiView & view);
        ///
        void saveSession(QSettings & settings, QString const & session_key) const;
        ///
@@ -45,13 +47,18 @@ public:
 private Q_SLOTS:
        void findChanged();
        void findBufferChanged();
-       void findClicked(bool const backwards = false,
-                        bool const instant = false);
+       void findClicked();
        void findPrevClicked();
-       void replaceClicked(bool const backwards = false);
+       void replaceClicked();
        void replacePrevClicked();
        void replaceallClicked();
        void minimizeClicked(bool const toggle = true);
+       void caseSenseActTriggered();
+       void wholeWordsActTriggered();
+       void searchSelActTriggered();
+       void immediateActTriggered();
+       void immediateClicked();
+       void wrapActTriggered();
 Q_SIGNALS:
        void needTitleBarUpdate() const;
        void needSizeUpdate() const;
@@ -61,6 +68,13 @@ private:
        void keyPressEvent(QKeyEvent * e) override;
        ///
        void showEvent(QShowEvent * e) override;
+       ///
+       void hideEvent(QHideEvent * e) override;
+       ///
+       void doFind(bool const backwards = false,
+                   bool const instant = false);
+       ///
+       void doReplace(bool const backwards = false);
        /// Searches occurrence of string
        void find(docstring const & search,
                  bool casesensitive, bool matchword,
@@ -70,9 +84,27 @@ private:
                     bool casesensitive, bool matchword,
                     bool forward, bool all, bool wrap, bool onlysel);
        ///
+       void handleIndicators();
+       ///
        BufferView const * bv_ = nullptr;
        ///
+       GuiView & view_;
+       ///
        bool minimized_ = false;
+       /// contains the search box
+       FancyLineEdit * findLE_;
+       /// The options menu
+       QMenu * menu_;
+       /// And its actions
+       QAction * act_casesense_ = new QAction(this);
+       ///
+       QAction * act_wholewords_ = new QAction(this);
+       ///
+       QAction * act_selection_ = new QAction(this);
+       ///
+       QAction * act_immediate_ = new QAction(this);
+       ///
+       QAction * act_wrap_ = new QAction(this);
 };
 
 
@@ -100,6 +132,9 @@ public:
 
 protected:
        bool wantInitialFocus() const override { return true; }
+       void mouseMoveEvent(QMouseEvent * event) override;
+       void mousePressEvent(QMouseEvent * event) override;
+       void mouseDoubleClickEvent(QMouseEvent *event) override;
 
 public Q_SLOTS:
        ///
@@ -114,6 +149,8 @@ private Q_SLOTS:
 private:
        /// The encapsulated widget.
        GuiSearchWidget * widget_;
+       ///
+       QPoint dragPosition;
 };
 
 } // namespace frontend