]> git.lyx.org Git - lyx.git/blob - src/lyxfr1.h
Fix small bug in reading \set_color in lyxrc
[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 /**
15   LyXFindReplace"
16
17   This class implements Find & Replace in LyXText texts. It is based on
18   LyXFindReplace0, which implements the form related stuff. (see lyxfr0.h)
19   */
20 class LyXFindReplace {
21 public:
22         ///
23         LyXFindReplace();
24         ///
25         ~LyXFindReplace();
26
27         /// Initialize internal variables and search form
28         void StartSearch(BufferView *);
29
30         ///
31         bool SearchCB(bool fForward);
32         ///
33         void SearchReplaceCB();
34         ///
35         void SearchReplaceAllCB();
36 private:
37         /// Set by IsSearchStringInText:
38         mutable int iLenSelected;
39
40         /// Direction we are searching:
41         bool searchForward;
42     
43         ///
44         bool SearchForward(BufferView *);
45         ///
46         bool SearchBackward(BufferView *); 
47
48         /** Compares 2 char values. 
49         return value is
50             \begin{itemize}
51             \item > 0 if ch1 > ch2
52             \item = 0 if ch1 == ch2
53             \item < 0 if ch1 < ch2
54             \end{itemize}
55         */
56         int CompareChars(char chSearch, char chText) const;
57         /// returns true if the specified string is at the specified position 
58         bool IsSearchStringInText(LyXParagraph * par,
59                                   LyXParagraph::size_type pos) const;
60         ///
61         SearchForm SF;
62         ///
63         BufferView * bv;
64 };
65 #endif