1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
1999-10-19 21:13:22 +00:00
|
|
|
#ifndef LYXFR0_H
|
|
|
|
#define LYXFR0_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-03-01 04:56:55 +00:00
|
|
|
#include "LString.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
#include FORMS_H_LOCATION
|
2000-03-01 04:56:55 +00:00
|
|
|
#include "form1.h"
|
2000-11-28 06:46:06 +00:00
|
|
|
#include <sigc++/signal_system.h>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-03-01 04:56:55 +00:00
|
|
|
class LyXFindReplace;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-11-28 06:46:06 +00:00
|
|
|
#ifdef SIGC_CXX_NAMESPACES
|
|
|
|
using SigC::Object;
|
2000-12-04 09:15:51 +00:00
|
|
|
using SigC::Connection;
|
2000-11-28 06:46:06 +00:00
|
|
|
#endif
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/**
|
2000-03-01 04:56:55 +00:00
|
|
|
The comments below are most likely not valied anymore since
|
|
|
|
the rewrite of LyXFindReplace0 and LyXFindReplace1. (Lgb)
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
LyXFindReplace0
|
|
|
|
|
|
|
|
This is a virtual base class. It does not handle text specific
|
|
|
|
items. It only manages the Find & Replace form and the variables.
|
|
|
|
|
2000-03-01 04:56:55 +00:00
|
|
|
To be added:
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-03-01 04:56:55 +00:00
|
|
|
- Confirm replace lightbutton (checkbox)
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-03-01 04:56:55 +00:00
|
|
|
- A history list for search and replace strings.
|
|
|
|
These 2 stringlists should match, so that you can replay previous replaces.
|
|
|
|
If you select another search string, then the first choice should be the
|
|
|
|
replace string you have typed before.
|
|
|
|
|
|
|
|
- regex searches (I'm working on that -- dnaber, 1999-02-24)
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
*/
|
2000-11-28 06:46:06 +00:00
|
|
|
class SearchForm : public Object {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
SearchForm();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
~SearchForm();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
bool CaseSensitive() const {
|
|
|
|
return fl_get_button(search_form->btnCaseSensitive);
|
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
bool MatchWord() const {
|
|
|
|
return fl_get_button(search_form->btnMatchWord);
|
|
|
|
}
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
string const SearchString() const {
|
2000-03-01 04:56:55 +00:00
|
|
|
return fl_get_input(search_form->input_search);
|
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-03-01 04:56:55 +00:00
|
|
|
/// Initialize internal variables and dialog
|
|
|
|
void StartSearch(LyXFindReplace *);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
void replaceEnabled(bool fEnabled);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
bool replaceEnabled() const { return fReplaceEnabled; }
|
|
|
|
|
|
|
|
// Callbacks from form
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
void SearchCancelCB();
|
|
|
|
|
|
|
|
// Return values
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
void SetSearchString(string const & ls);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
string const ReplaceString() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-03-01 04:56:55 +00:00
|
|
|
bool ValidSearchData() const { return !(SearchString().empty()); }
|
|
|
|
private:
|
2000-11-28 06:46:06 +00:00
|
|
|
/** Redraw the form (on receipt of a Signal indicating, for example,
|
|
|
|
that the xform colors have been re-mapped).
|
|
|
|
*/
|
|
|
|
void redraw();
|
2000-03-01 04:56:55 +00:00
|
|
|
///
|
|
|
|
FD_form_search * search_form;
|
|
|
|
/// replace buttons enabled?
|
|
|
|
bool fReplaceEnabled;
|
2000-11-28 06:46:06 +00:00
|
|
|
/// Redraw connection.
|
2000-12-04 09:15:51 +00:00
|
|
|
Connection r_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|