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
|
2003-11-04 12:01:15 +00:00
|
|
|
|
* \author Alfredo Braunstein
|
2003-08-23 00:17:00 +00:00
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
2003-11-04 12:01:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* This function replaces an ocurrence of \param search with the
|
|
|
|
|
* string \param replace
|
|
|
|
|
*
|
|
|
|
|
* \param bv the BufferView in which the search is to be performed,
|
|
|
|
|
* starting at the current cursor position.
|
|
|
|
|
* \param search the string we're looking for.
|
|
|
|
|
* \param replace if \c search is found, replace it with this.
|
|
|
|
|
* \param cs perform a case-sensitive search for \c search.
|
|
|
|
|
* \param mw match whole words only.
|
|
|
|
|
* \param fw search forward from the current cursor position.
|
|
|
|
|
*/
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
2003-07-27 12:02:58 +00:00
|
|
|
|
int replace(BufferView * bv,
|
2003-11-04 12:01:15 +00:00
|
|
|
|
std::string const & search, std::string const & replace,
|
|
|
|
|
bool cs, bool mw, bool fw);
|
2002-06-18 15:44:30 +00:00
|
|
|
|
/**
|
2003-11-04 12:01:15 +00:00
|
|
|
|
* This function replaces all ocurrences of \param search with
|
|
|
|
|
* the string \param replace
|
|
|
|
|
*
|
|
|
|
|
* \param bv the BufferView in which the search is to be performed,
|
|
|
|
|
* starting at the current cursor position.
|
|
|
|
|
* \param search the string we're looking for.
|
|
|
|
|
* \param replace if \c search is found, replace it with this.
|
|
|
|
|
* \param cs perform a case-sensitive search for \c search.
|
|
|
|
|
* \param mw match whole words only.
|
2002-06-18 15:44:30 +00:00
|
|
|
|
*/
|
2003-11-04 12:01:15 +00:00
|
|
|
|
|
|
|
|
|
int replaceAll(BufferView * bv,
|
|
|
|
|
std::string const & search, std::string const & replace,
|
|
|
|
|
bool cs, bool mw);
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2003-11-04 12:01:15 +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.
|
2002-06-18 15:44:30 +00:00
|
|
|
|
*/
|
2003-11-04 12:01:15 +00:00
|
|
|
|
bool find(BufferView *, std::string const & search,
|
|
|
|
|
bool cs, bool mw, bool fw);
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
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-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
|