23 #ifndef __KATE_SEARCH_H__
24 #define __KATE_SEARCH_H__
26 #include "katecursor.h"
27 #include "../interfaces/document.h"
29 #include <kdialogbase.h>
33 #include <tqstringlist.h>
34 #include <tqvaluelist.h>
38 class KateSuperRangeList;
42 class KateSearch :
public TQObject
46 friend class KateDocument;
52 bool caseSensitive :1;
54 bool fromBeginning :1;
87 KateSearch( KateView* );
105 void find(
const TQString &pattern,
long flags,
bool add=
true,
bool shownotfound=
false );
115 void replace(
const TQString &pattern,
const TQString &replacement,
long flags );
116 void findAgain(
bool reverseDirection );
120 void slotFindNext() { findAgain(
false ); }
121 void slotFindPrev() { findAgain(
true ); }
124 static void addToList( TQStringList&,
const TQString& );
125 static void addToSearchList(
const TQString& s ) { addToList( s_searchList, s ); }
126 static void addToReplaceList(
const TQString& s ) { addToList( s_replaceList, s ); }
127 static TQStringList s_searchList;
128 static TQStringList s_replaceList;
129 static TQString s_pattern;
131 void search( SearchFlags flags );
136 void promptReplace();
141 TQString getSearchText();
143 bool doSearch(
const TQString& text );
146 inline KateView* view() {
return m_view; }
147 inline KateDocument* doc() {
return m_doc; }
152 KateSuperRangeList* m_arbitraryHLList;
156 TQValueList<SConfig> m_searchResults;
160 TQDialog* replacePrompt;
161 TQString m_replacement;
215 void done (
int result);
221 SearchCommand() : m_ifindFlags(0) {;}
222 bool exec(
class Kate::View *view,
const TQString &cmd, TQString &errorMsg);
232 void ifindInit(
const TQString &cmd );