1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
1999-10-19 21:13:22 +00:00
|
|
|
#ifndef LYXFR1_H
|
|
|
|
#define LYXFR1_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include FORMS_H_LOCATION
|
1999-11-04 01:40:20 +00:00
|
|
|
#include "lyxparagraph.h"
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
class LyXText;
|
|
|
|
|
|
|
|
/**
|
|
|
|
LyXFindReplace1"
|
|
|
|
|
|
|
|
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 {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
LyXFindReplace1() : LyXFindReplace0() {};
|
|
|
|
///
|
|
|
|
~LyXFindReplace1() {};
|
|
|
|
|
|
|
|
/// Initialize internal variables and search form
|
|
|
|
virtual void StartSearch();
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual bool SearchCB(bool fForward);
|
|
|
|
///
|
|
|
|
virtual void SearchReplaceCB();
|
|
|
|
///
|
|
|
|
virtual void SearchReplaceAllCB();
|
|
|
|
protected:
|
|
|
|
/// Set by IsSearchStringInText:
|
|
|
|
int iLenSelected;
|
|
|
|
|
|
|
|
/// Direction we are searching:
|
|
|
|
bool searchForward;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool SearchForward(LyXText *lt);
|
|
|
|
///
|
|
|
|
bool SearchBackward(LyXText *lt);
|
|
|
|
|
|
|
|
/** Compares 2 char values.
|
|
|
|
return value is
|
|
|
|
\begin{itemize}
|
|
|
|
\item > 0 if ch1 > ch2
|
|
|
|
\item = 0 if ch1 == ch2
|
|
|
|
\item < 0 if ch1 < ch2
|
|
|
|
\end{itemize}
|
|
|
|
*/
|
|
|
|
int CompareChars(char chSearch, char chText);
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifdef NEW_TEXT
|
1999-09-27 18:44:28 +00:00
|
|
|
/// returns true if the specified string is at the specified position
|
1999-11-04 01:40:20 +00:00
|
|
|
bool IsSearchStringInText(LyXParagraph * par, LyXParagraph::size_type pos);
|
|
|
|
#else
|
|
|
|
/// returns true if the specified string is at the specified position
|
|
|
|
bool IsSearchStringInText(LyXParagraph * par, int pos);
|
|
|
|
#endif
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|