// -*- C++ -*-
-#ifndef _LYXFR1_H
-#define _LYXFR1_H
+#ifndef LYXFR1_H
+#define LYXFR1_H
#ifdef __GNUG__
#pragma interface
#endif
-#include FORMS_H_LOCATION
-class LyXText;
-class LyXParagraph;
+#include "lyxparagraph.h"
+#include "lyxfr0.h"
-/**
- LyXFindReplace1"
+class LyXText;
- This class implements Find & Replace in LyXText texts. It is based on
- LyXFindReplace0, which implements the form related stuff. (see lyxfr0.h)
- */
-class LyXFindReplace1 : public LyXFindReplace0 {
+/** Find and replace in LyXText texts.
+
+ This class implements Find & Replace in LyXText texts. It is based on
+ LyXFindReplace0, which implements the form related stuff. (see lyxfr0.h)
+*/
+class LyXFindReplace {
public:
///
- LyXFindReplace1() : LyXFindReplace0() {};
+ LyXFindReplace();
///
- ~LyXFindReplace1() {};
+ ~LyXFindReplace();
/// Initialize internal variables and search form
- virtual void StartSearch();
+ void StartSearch(BufferView *);
///
- virtual bool SearchCB(bool fForward);
+ bool SearchCB(bool fForward);
///
- virtual void SearchReplaceCB();
+ void SearchReplaceCB();
///
- virtual void SearchReplaceAllCB();
-protected:
+ void SearchReplaceAllCB();
+private:
/// Set by IsSearchStringInText:
- int iLenSelected;
+ mutable int iLenSelected;
/// Direction we are searching:
bool searchForward;
///
- bool SearchForward(LyXText *lt);
+ bool SearchForward(BufferView *);
///
- bool SearchBackward(LyXText *lt);
+ bool SearchBackward(BufferView *);
/** Compares 2 char values.
return value is
\item < 0 if ch1 < ch2
\end{itemize}
*/
- int CompareChars(char chSearch, char chText);
-
+ int CompareChars(char chSearch, char chText) const;
/// returns true if the specified string is at the specified position
- bool IsSearchStringInText(LyXParagraph *par, int pos);
+ bool IsSearchStringInText(LyXParagraph * par,
+ LyXParagraph::size_type pos) const;
+ ///
+ SearchForm SF;
+ ///
+ BufferView * bv;
};
#endif