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
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#include "lyxparagraph.h"
|
2000-03-01 04:56:55 +00:00
|
|
|
#include "lyxfr0.h"
|
1999-11-04 01:40:20 +00:00
|
|
|
|
2000-03-01 04:56:55 +00:00
|
|
|
class LyXText;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
/** 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)
|
|
|
|
*/
|
2000-03-01 04:56:55 +00:00
|
|
|
class LyXFindReplace {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
LyXFindReplace();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
~LyXFindReplace();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Initialize internal variables and search form
|
2000-03-01 04:56:55 +00:00
|
|
|
void StartSearch(BufferView *);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
bool SearchCB(bool fForward);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
void SearchReplaceCB();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
void SearchReplaceAllCB();
|
|
|
|
private:
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Set by IsSearchStringInText:
|
2000-03-01 04:56:55 +00:00
|
|
|
mutable int iLenSelected;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Direction we are searching:
|
|
|
|
bool searchForward;
|
|
|
|
|
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
bool SearchForward(BufferView *);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
bool SearchBackward(BufferView *);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** 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}
|
|
|
|
*/
|
2000-03-01 04:56:55 +00:00
|
|
|
int CompareChars(char chSearch, char chText) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// returns true if the specified string is at the specified position
|
1999-11-15 12:01:38 +00:00
|
|
|
bool IsSearchStringInText(LyXParagraph * par,
|
2000-03-01 04:56:55 +00:00
|
|
|
LyXParagraph::size_type pos) const;
|
|
|
|
///
|
|
|
|
SearchForm SF;
|
|
|
|
///
|
|
|
|
BufferView * bv;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|