2001-06-14 08:20:41 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file lyxfind.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2001-03-06 10:20:33 +00:00
|
|
|
|
#ifndef LYXFIND_H
|
|
|
|
|
#define LYXFIND_H
|
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
#include "support/types.h"
|
2001-03-06 10:20:33 +00:00
|
|
|
|
|
2003-10-07 06:45:25 +00:00
|
|
|
|
#include <string>
|
|
|
|
|
|
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
|
|
|
|
|
2003-07-27 12:02:58 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace find {
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
|
|
|
|
enum SearchResult {
|
|
|
|
|
//
|
|
|
|
|
SR_NOT_FOUND = 0,
|
|
|
|
|
//
|
|
|
|
|
SR_FOUND,
|
|
|
|
|
//
|
|
|
|
|
SR_FOUND_NOUPDATE
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2003-07-27 12:02:58 +00:00
|
|
|
|
int replace(BufferView * bv,
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const &, std::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.
|
|
|
|
|
*/
|
2003-07-27 12:02:58 +00:00
|
|
|
|
bool find(BufferView *,
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::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.
|
|
|
|
|
*/
|
|
|
|
|
|
2003-07-27 12:02:58 +00:00
|
|
|
|
SearchResult find(BufferView *, LyXText * text,
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const & searchstr, bool forward,
|
2002-06-18 15:44:30 +00:00
|
|
|
|
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
|
|
|
|
|
2003-07-27 12:02:58 +00:00
|
|
|
|
} // namespace find
|
|
|
|
|
} // namespace lyx
|
2003-03-04 09:27:27 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
#endif // LYXFIND_H
|