2001-06-14 08:20:41 +00:00
|
|
|
// -*- C++ -*-
|
2001-03-06 10:20:33 +00:00
|
|
|
#ifndef LYXFIND_H
|
|
|
|
#define LYXFIND_H
|
|
|
|
|
|
|
|
#include "LString.h"
|
2003-02-08 19:18:01 +00:00
|
|
|
#include "support/types.h"
|
2001-03-06 10:20:33 +00:00
|
|
|
|
|
|
|
class BufferView;
|
2002-08-08 21:08:02 +00:00
|
|
|
class LyXText;
|
2001-03-06 10:20:33 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
namespace lyxfind {
|
|
|
|
|
|
|
|
enum SearchResult {
|
|
|
|
//
|
|
|
|
SR_NOT_FOUND = 0,
|
|
|
|
//
|
|
|
|
SR_FOUND,
|
|
|
|
//
|
|
|
|
SR_FOUND_NOUPDATE
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int LyXReplace(BufferView * bv,
|
|
|
|
string const &, string const &,
|
2002-03-21 17:27:08 +00:00
|
|
|
bool, bool = true, bool = false,
|
|
|
|
bool = false, bool = false);
|
2001-03-06 10:20:33 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
/**
|
|
|
|
* This function is called as a general interface to find some
|
|
|
|
* text from the actual cursor position in whatever direction
|
|
|
|
* we want to go. This does also update the screen.
|
|
|
|
*/
|
2001-07-20 14:18:48 +00:00
|
|
|
bool LyXFind(BufferView *,
|
2002-03-21 17:27:08 +00:00
|
|
|
string const & searchstr, bool forward,
|
2002-06-18 15:44:30 +00:00
|
|
|
bool casesens = true, bool matchwrd = false);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function does search from the cursor position inside the
|
|
|
|
* passed LyXText parameter and regards this LyXText as the root
|
|
|
|
* LyXText. It will NOT update any screen stuff. It will however
|
|
|
|
* set the cursor to the new position inside LyXText, before
|
|
|
|
* returning to the calling function.
|
|
|
|
*/
|
|
|
|
|
|
|
|
SearchResult LyXFind(BufferView *, LyXText * text,
|
|
|
|
string const & searchstr, bool forward,
|
|
|
|
bool casesens = true, bool matchwrd = false);
|
2001-03-06 10:20:33 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
/// find the next change in the buffer
|
|
|
|
bool findNextChange(BufferView * bv);
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
SearchResult findNextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
SearchResult nextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
} // end namespace LyXFind
|
2003-03-04 09:27:27 +00:00
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
#endif // LYXFIND_H
|