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>
|
|
|
|
|
|
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;
|
2002-08-08 21:08:02 +00:00
|
|
|
|
class LyXText;
|
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
|
|
|
|
*/
|
2004-01-07 17:00:03 +00:00
|
|
|
|
std::string const find2string(std::string const & search,
|
|
|
|
|
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
|
|
|
|
*/
|
2004-01-07 17:00:03 +00:00
|
|
|
|
std::string const replace2string(std::string const & search,
|
|
|
|
|
std::string const & replace,
|
|
|
|
|
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.
|
2002-06-18 15:44:30 +00:00
|
|
|
|
*/
|
2004-01-15 17:34:44 +00:00
|
|
|
|
void 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.
|
|
|
|
|
*/
|
2004-01-15 17:34:44 +00:00
|
|
|
|
void replace(BufferView * bv, FuncRequest const &);
|
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
|