2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiSearch.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QSEARCH_H
|
|
|
|
#define QSEARCH_H
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiDialogView.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_SearchUi.h"
|
2007-04-24 13:27:23 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <QDialog>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class ControlSearch;
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiSearch;
|
2007-04-24 13:27:23 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiSearchDialog : public QDialog, public Ui::SearchUi {
|
2007-04-24 13:27:23 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiSearchDialog(GuiSearch * form);
|
2007-04-24 13:27:23 +00:00
|
|
|
|
|
|
|
virtual void show();
|
|
|
|
protected Q_SLOTS:
|
|
|
|
void findChanged();
|
|
|
|
void findClicked();
|
|
|
|
void replaceClicked();
|
|
|
|
void replaceallClicked();
|
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent * e);
|
|
|
|
|
|
|
|
private:
|
|
|
|
// add a string to the combo if needed
|
|
|
|
void remember(std::string const & find, QComboBox & combo);
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiSearch * form_;
|
2007-04-24 13:27:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiSearch
|
|
|
|
: public QController<ControlSearch, GuiView<GuiSearchDialog> >
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
2007-08-31 05:53:55 +00:00
|
|
|
friend class GuiSearchDialog;
|
2006-03-05 17:24:44 +00:00
|
|
|
///
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiSearch(Dialog &);
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
|
|
|
/// Apply changes
|
|
|
|
virtual void apply() {}
|
|
|
|
/// update
|
|
|
|
virtual void update_contents() {}
|
|
|
|
/// build the dialog
|
|
|
|
virtual void build_dialog();
|
|
|
|
|
2006-12-10 11:52:46 +00:00
|
|
|
void find(docstring const & str, bool casesens,
|
2006-03-05 17:24:44 +00:00
|
|
|
bool words, bool backwards);
|
|
|
|
|
2006-12-10 11:52:46 +00:00
|
|
|
void replace(docstring const & findstr,
|
|
|
|
docstring const & replacestr,
|
2006-03-05 17:24:44 +00:00
|
|
|
bool casesens, bool words, bool backwards, bool all);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QSEARCH_H
|