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
|
|
|
|
|
|
2007-10-31 22:40:34 +00:00
|
|
|
|
#include "support/strfwd.h"
|
2003-10-07 06:45:25 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2001-03-06 10:20:33 +00:00
|
|
|
|
class BufferView;
|
2004-01-07 17:00:03 +00:00
|
|
|
|
class FuncRequest;
|
2007-04-29 23:33:02 +00:00
|
|
|
|
class Text;
|
2001-03-06 10:20:33 +00:00
|
|
|
|
|
2004-01-07 17:00:03 +00:00
|
|
|
|
/** Encode the parameters needed to find \c search as a string
|
|
|
|
|
* that can be dispatched to the LyX core in a FuncRequest wrapper.
|
2003-11-04 12:01:15 +00:00
|
|
|
|
*/
|
2006-12-10 11:52:46 +00:00
|
|
|
|
docstring const find2string(docstring const & search,
|
2004-01-07 17:00:03 +00:00
|
|
|
|
bool casesensitive,
|
|
|
|
|
bool matchword,
|
|
|
|
|
bool forward);
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
2004-01-07 17:00:03 +00:00
|
|
|
|
/** Encode the parameters needed to replace \c search with \c replace
|
|
|
|
|
* as a string that can be dispatched to the LyX core in a FuncRequest
|
|
|
|
|
* wrapper.
|
2002-06-18 15:44:30 +00:00
|
|
|
|
*/
|
2006-12-10 11:52:46 +00:00
|
|
|
|
docstring const replace2string(docstring const & search,
|
|
|
|
|
docstring const & replace,
|
2004-01-07 17:00:03 +00:00
|
|
|
|
bool casesensitive,
|
|
|
|
|
bool matchword,
|
|
|
|
|
bool all,
|
|
|
|
|
bool forward);
|
2003-11-04 12:01:15 +00:00
|
|
|
|
|
2004-01-07 17:00:03 +00:00
|
|
|
|
/** Parse the string encoding of the find request that is found in
|
|
|
|
|
* \c ev.argument and act on it.
|
|
|
|
|
* The string is encoded by \c find2string.
|
2008-02-10 18:52:32 +00:00
|
|
|
|
* \return true if the string was found.
|
2002-06-18 15:44:30 +00:00
|
|
|
|
*/
|
2008-02-10 18:52:32 +00:00
|
|
|
|
bool find(BufferView * bv, FuncRequest const & ev);
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
2004-01-07 17:00:03 +00:00
|
|
|
|
/** Parse the string encoding of the replace request that is found in
|
|
|
|
|
* \c ev.argument and act on it.
|
|
|
|
|
* The string is encoded by \c replace2string.
|
|
|
|
|
*/
|
2007-06-19 21:48:04 +00:00
|
|
|
|
void replace(BufferView * bv, FuncRequest const &, bool has_deleted = 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-07-27 12:02:58 +00:00
|
|
|
|
} // namespace lyx
|
2003-03-04 09:27:27 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
#endif // LYXFIND_H
|