2002-09-05 14:10:50 +00:00
|
|
|
/**
|
|
|
|
* \file ControlSearch.C
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-03-26 15:25:37 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Angus Leeming
|
2001-03-26 15:25:37 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-03-26 15:25:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2002-05-29 16:21:03 +00:00
|
|
|
#include "ControlSearch.h"
|
2002-08-14 19:19:47 +00:00
|
|
|
|
2004-01-07 17:00:03 +00:00
|
|
|
#include "funcrequest.h"
|
2002-08-14 19:19:47 +00:00
|
|
|
#include "lyxfind.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
using std::string;
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2003-10-06 15:43:21 +00:00
|
|
|
|
2004-01-26 00:43:56 +00:00
|
|
|
ControlSearch::ControlSearch(Dialog & parent)
|
|
|
|
: Dialog::Controller(parent)
|
2002-06-18 15:44:30 +00:00
|
|
|
{}
|
2001-03-26 15:25:37 +00:00
|
|
|
|
|
|
|
|
2004-01-26 00:43:56 +00:00
|
|
|
void ControlSearch::find(string const & search, bool casesensitive,
|
|
|
|
bool matchword, bool forward)
|
2001-03-26 15:25:37 +00:00
|
|
|
{
|
2004-05-19 15:11:37 +00:00
|
|
|
string const data = find::find2string(search, casesensitive,
|
|
|
|
matchword, forward);
|
2004-01-26 00:43:56 +00:00
|
|
|
kernel().dispatch(FuncRequest(LFUN_WORD_FIND, data));
|
2001-03-26 15:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ControlSearch::replace(string const & search, string const & replace,
|
2004-01-26 00:43:56 +00:00
|
|
|
bool casesensitive, bool matchword,
|
|
|
|
bool forward, bool all)
|
2001-03-26 15:25:37 +00:00
|
|
|
{
|
2004-01-07 17:00:03 +00:00
|
|
|
string const data =
|
2004-05-19 15:11:37 +00:00
|
|
|
find::replace2string(search, replace, casesensitive,
|
|
|
|
matchword, all, forward);
|
2004-01-26 00:43:56 +00:00
|
|
|
kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
|
2001-03-26 15:25:37 +00:00
|
|
|
}
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|