]> git.lyx.org Git - lyx.git/blob - src/lyxfr1.h
obvious
[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 FORMS_H_LOCATION
10 class   LyXText;
11 class   LyXParagraph;
12
13 /**
14   LyXFindReplace1"
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 LyXFindReplace1 : public LyXFindReplace0 {
20 public:
21         ///
22         LyXFindReplace1() : LyXFindReplace0() {};
23         ///
24         ~LyXFindReplace1() {};  
25
26         /// Initialize internal variables and search form
27         virtual void StartSearch();
28
29         ///
30         virtual bool SearchCB(bool fForward);
31         ///
32         virtual void SearchReplaceCB();
33         ///
34         virtual void SearchReplaceAllCB();
35 protected:
36         /// Set by IsSearchStringInText:
37         int     iLenSelected;
38
39         /// Direction we are searching:
40         bool searchForward;
41     
42         ///
43         bool SearchForward(LyXText *lt);
44         ///
45         bool SearchBackward(LyXText *lt); 
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);
56
57         /// returns true if the specified string is at the specified position 
58         bool IsSearchStringInText(LyXParagraph *par, int pos);
59 };
60 #endif