]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/FindAndReplace.h
Fix handling of the add branch textfield in GuiBranches
[lyx.git] / src / frontends / qt4 / FindAndReplace.h
index b4bc3e1a8472947eec0099782215bffbbcb7edc7..354278b9af53da8905346b511ed95da49981423e 100644 (file)
 #include "GuiWorkArea.h"
 
 #include "DockView.h"
+// This is needed so that ui_FindAndReplaceUi.h can find qt_()
+#include "qt_helpers.h"
 #include "ui_FindAndReplaceUi.h"
 
 #include "BufferView.h"
 #include "Buffer.h"
 #include "LyX.h"
-#include "LyXFunc.h"
 #include "Text.h"
 #include "lyxfind.h"
 
 namespace lyx {
 namespace frontend {
 
-class FindAndReplaceWidget : public QWidget, public Ui::FindAndReplaceUi
+class FindAndReplaceWidget : public QTabWidget, public Ui::FindAndReplaceUi
 {
        Q_OBJECT
 
 public:
        FindAndReplaceWidget(GuiView & view);
        bool initialiseParams(std::string const & params);
+       void updateGUI();
 
 private:
        ///
@@ -46,32 +48,28 @@ private:
        /// add a string to the combo if needed
        void remember(std::string const & find, QComboBox & combo);
 
-       /// FIXME Probably to be merged with findAndReplace(bool, bool)
-       void findAndReplace(
-               bool casesensitive, bool matchword, bool backwards,
-               bool expandmacros, bool ignoreformat, bool replace,
-               bool keep_case
-       );
-
        /// Perform the scope-related buffer switch while searching
-       void findAndReplaceScope(FindAndReplaceOptions & opt);
+       bool findAndReplaceScope(FindAndReplaceOptions & opt, bool replace_all = false);
 
        /// Collect options from the GUI elements, then perform the search
-       void findAndReplace(bool backwards, bool replace);
+       bool findAndReplace(bool backwards, bool replace, bool replace_all = false);
+
+       /// FIXME Probably to be merged with findAndReplace(bool, bool, bool)
+       bool findAndReplace(bool casesensitive, bool matchword, bool backwards,
+               bool expandmacros, bool ignoreformat, bool replace,
+               bool keep_case, bool replace_all = false);
 
        bool eventFilter(QObject *obj, QEvent *event);
 
        void virtual showEvent(QShowEvent *ev);
        void virtual hideEvent(QHideEvent *ev);
 
+       void hideDialog();
+
 protected Q_SLOTS:
        void on_findNextPB_clicked();
-       void on_findPrevPB_clicked();
-       void on_replaceNextPB_clicked();
-       void on_replacePrevPB_clicked();
+       void on_replacePB_clicked();
        void on_replaceallPB_clicked();
-       void on_closePB_clicked();
-       void insertRegexp(QAction *);
 };
 
 
@@ -89,11 +87,12 @@ public:
        bool initialiseParams(std::string const &);
        void clearParams() {}
        void dispatchParams() {}
-       bool isBufferDependent() const { return true; }
+       bool isBufferDependent() const { return false; }
+       bool canApplyToReadOnly() const { return true; }
        void selectAll();
 
        /// update
-       void updateView() {}
+       void updateView();
        //virtual void update_contents() {}
 
 protected: