]> git.lyx.org Git - lyx.git/blob - src/lyxfr0.h
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / lyxfr0.h
1 // -*- C++ -*-
2 #ifndef LYXFR0_H
3 #define LYXFR0_H
4
5 #ifdef __GNUG__
6 #pragma interface
7 #endif
8
9 #include "LString.h"
10 #include FORMS_H_LOCATION
11 #include "form1.h"
12 #include <sigc++/signal_system.h>
13
14 class LyXFindReplace;
15
16 #ifdef SIGC_CXX_NAMESPACES
17 using SigC::Object;
18 using SigC::Connection;
19 #endif
20
21 /**
22    The comments below are most likely not valied anymore since
23    the rewrite of LyXFindReplace0 and LyXFindReplace1. (Lgb)
24    
25   LyXFindReplace0
26  
27   This is a virtual base class. It does not handle text specific
28   items. It only manages the Find & Replace form and the variables.
29   
30   To be added:
31
32   - Confirm replace lightbutton (checkbox)
33
34   - A history list for search and replace strings.
35   These 2 stringlists should match, so that you can replay previous replaces.
36   If you select another search string, then the first choice should be the 
37   replace string you have typed before.
38   
39   - regex searches (I'm working on that -- dnaber, 1999-02-24)
40
41 */
42 class SearchForm : public Object {
43 public:
44         ///
45         SearchForm();
46         ///
47         ~SearchForm();  
48         
49         ///
50         bool CaseSensitive() const {
51                 return fl_get_button(search_form->btnCaseSensitive);
52         }
53
54         ///
55         bool MatchWord() const {
56                 return fl_get_button(search_form->btnMatchWord);
57         }
58
59         ///
60         string const SearchString() const {
61                 return fl_get_input(search_form->input_search);
62         }
63
64         /// Initialize internal variables and dialog
65         void StartSearch(LyXFindReplace *);
66
67         ///
68         void replaceEnabled(bool fEnabled);
69         ///
70         bool replaceEnabled() const { return fReplaceEnabled; }
71
72         // Callbacks from form
73         ///
74         void SearchCancelCB();
75
76         // Return values
77         ///
78         void SetSearchString(string const & ls);
79         ///
80         string const ReplaceString() const;
81
82         ///
83         bool ValidSearchData() const { return !(SearchString().empty()); }
84 private:
85         /** Redraw the form (on receipt of a Signal indicating, for example,
86             that the xform colors have been re-mapped).
87         */
88         void redraw();
89         ///
90         FD_form_search * search_form;
91         /// replace buttons enabled?
92         bool fReplaceEnabled;
93         /// Redraw connection.
94         Connection r_;
95 };
96
97 #endif