]> git.lyx.org Git - lyx.git/blob - src/lyxfr0.h
Initial revision
[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 FORMS_H_LOCATION
10
11
12 /**
13   LyXFindReplace0
14  
15   This is a virtual base class. It does not handle text specific
16   items. It only manages the Find & Replace form and the variables.
17   
18 To be added:
19
20 - Confirm replace lightbutton (checkbox)
21
22 - A history list for search and replace strings.
23 These 2 stringlists should match, so that you can replay previous replaces.
24 If you select another search string, then the first choice should be the 
25 replace string you have typed before.
26
27 - regex searches (I'm working on that -- dnaber, 1999-02-24)
28
29 */
30 class LyXFindReplace0 {
31 public:
32         ///
33         LyXFindReplace0();
34         ///
35         virtual ~LyXFindReplace0() {};  
36         
37         /// Initialize internal variables and dialog
38         virtual void StartSearch();
39
40         // Callbacks from form
41         ///
42         virtual void SearchCancelCB();
43         ///
44         virtual bool SearchCB(bool fForward) = 0;
45         ///
46         virtual void SearchReplaceCB() = 0;
47         ///
48         virtual void SearchReplaceAllCB() = 0;
49 protected:
50         ///
51         bool            fCaseSensitive;
52         /// Match complete word only.
53         bool            fMatchWord;
54         /// replace buttons enabled?
55         bool            fReplaceEnabled;
56         /// search string
57         LString         lsSearch;
58
59         ///
60         void SetReplaceEnabled(bool fEnabled);
61         ///
62         bool ReplaceEnabled() { return fReplaceEnabled; }
63
64         /// Initialize search variables from Find & Replace form
65         virtual void ReInitFromForm();
66
67         // Return values
68         ///
69         bool CaseSensitive() { return fCaseSensitive; }
70         ///
71         bool MatchWord() { return fMatchWord; }
72         ///
73         LString const SearchString() { return lsSearch; }
74         ///
75         void SetSearchString(LString const &ls);
76         ///
77         LString const ReplaceString();
78
79         ///
80         bool ValidSearchData() { return !lsSearch.empty(); }            
81 };
82
83 #endif