]> git.lyx.org Git - lyx.git/blob - src/lyxfr1.h
Fixed various "missing features" in the tabular/textinset code.
[lyx.git] / src / lyxfr1.h
1 // -*- C++ -*-
2 #ifndef LYXFR1_H
3 #define LYXFR1_H
4
5 #ifdef __GNUG__
6 #pragma interface
7 #endif
8
9 #include "lyxparagraph.h"
10 #include "lyxfr0.h"
11
12 class LyXText;
13
14 /** Find and replace in LyXText texts.
15    
16    This class implements Find & Replace in LyXText texts. It is based on
17    LyXFindReplace0, which implements the form related stuff. (see lyxfr0.h)
18 */
19 class LyXFindReplace {
20 public:
21         ///
22         LyXFindReplace();
23         ///
24         ~LyXFindReplace();
25
26         /// Initialize internal variables and search form
27         void StartSearch(BufferView *);
28
29         ///
30         bool SearchCB(bool fForward);
31         ///
32         void SearchReplaceCB();
33         ///
34         void SearchReplaceAllCB();
35 private:
36         /// Set by IsSearchStringInText:
37         mutable int iLenSelected;
38
39         /// Direction we are searching:
40         bool searchForward;
41     
42         ///
43         bool SearchForward(BufferView *);
44         ///
45         bool SearchBackward(BufferView *); 
46
47         /** Compares 2 char values. 
48         return value is
49             \begin{itemize}
50             \item > 0 if ch1 > ch2
51             \item = 0 if ch1 == ch2
52             \item < 0 if ch1 < ch2
53             \end{itemize}
54         */
55         int CompareChars(char chSearch, char chText) const;
56         /// returns true if the specified string is at the specified position 
57         bool IsSearchStringInText(LyXParagraph * par,
58                                   LyXParagraph::size_type pos) const;
59         ///
60         SearchForm SF;
61         ///
62         BufferView * bv;
63 };
64 #endif