]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfr0.h
Dekels tabular/textinset patches
[lyx.git] / src / lyxfr0.h
index 923a4af19bc5f1ae04659e06ca6a94dfefa784c7..e30e4f25ad14c80167e92a5ee96b4dd7aaa83131 100644 (file)
@@ -6,78 +6,92 @@
 #pragma interface
 #endif
 
+#include "LString.h"
 #include FORMS_H_LOCATION
+#include "form1.h"
+#include <sigc++/signal_system.h>
 
+class LyXFindReplace;
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Object;
+using SigC::Connection;
+#endif
 
 /**
+   The comments below are most likely not valied anymore since
+   the rewrite of LyXFindReplace0 and LyXFindReplace1. (Lgb)
+   
   LyXFindReplace0
  
   This is a virtual base class. It does not handle text specific
   items. It only manages the Find & Replace form and the variables.
   
-To be added:
-
-- Confirm replace lightbutton (checkbox)
+  To be added:
 
-- 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.
+  - Confirm replace lightbutton (checkbox)
 
-- regex searches (I'm working on that -- dnaber, 1999-02-24)
+  - 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)
 
 */
-class LyXFindReplace0 {
+class SearchForm : public Object {
 public:
        ///
-       LyXFindReplace0();
+       SearchForm();
        ///
-       virtual ~LyXFindReplace0() {};  
+       ~SearchForm();  
        
-       /// Initialize internal variables and dialog
-       virtual void StartSearch();
-
-       // Callbacks from form
-       ///
-       virtual void SearchCancelCB();
-       ///
-       virtual bool SearchCB(bool fForward) = 0;
-       ///
-       virtual void SearchReplaceCB() = 0;
-       ///
-       virtual void SearchReplaceAllCB() = 0;
-protected:
        ///
-       bool            fCaseSensitive;
-       /// Match complete word only.
-       bool            fMatchWord;
-       /// replace buttons enabled?
-       bool            fReplaceEnabled;
-       /// search string
-       string          lsSearch;
+       bool CaseSensitive() const {
+               return fl_get_button(search_form->btnCaseSensitive);
+       }
 
        ///
-       void SetReplaceEnabled(bool fEnabled);
+       bool MatchWord() const {
+               return fl_get_button(search_form->btnMatchWord);
+       }
+
        ///
-       bool ReplaceEnabled() { return fReplaceEnabled; }
+       string const SearchString() const {
+               return fl_get_input(search_form->input_search);
+       }
 
-       /// Initialize search variables from Find & Replace form
-       virtual void ReInitFromForm();
+       /// Initialize internal variables and dialog
+       void StartSearch(LyXFindReplace *);
 
-       // Return values
        ///
-       bool CaseSensitive() { return fCaseSensitive; }
+       void replaceEnabled(bool fEnabled);
        ///
-       bool MatchWord() { return fMatchWord; }
+       bool replaceEnabled() const { return fReplaceEnabled; }
+
+       // Callbacks from form
        ///
-       string const SearchString() { return lsSearch; }
+       void SearchCancelCB();
+
+       // Return values
        ///
-       void SetSearchString(string const &ls);
+       void SetSearchString(string const & ls);
        ///
-       string const ReplaceString();
+       string const ReplaceString() const;
 
        ///
-       bool ValidSearchData() { return !lsSearch.empty(); }            
+       bool ValidSearchData() const { return !(SearchString().empty()); }
+private:
+       /** Redraw the form (on receipt of a Signal indicating, for example,
+           that the xform colors have been re-mapped).
+       */
+       void redraw();
+       ///
+       FD_form_search * search_form;
+       /// replace buttons enabled?
+       bool fReplaceEnabled;
+       /// Redraw connection.
+       Connection r_;
 };
 
 #endif