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;
79 srCancel = KDialogBase::Cancel,
80 srAll = KDialogBase::User1,
81 srLast = KDialogBase::User2,
82 srNo = KDialogBase::User3,
83 srYes = KDialogBase::Ok
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 );
Simple cursor class with no document pointer.
Extension to the Command interface, allowing to interact with commands during typing.
KateReplacePrompt(TQWidget *parent)
Constructor.
void done(int result)
dialog done
void slotClose()
close pressed
void slotUser1()
replace all pressed
virtual TQStringList cmds()=0
Pure text start part of the commands which can be handled by this object which means i...
The Kate::View text editor interface.
virtual bool wantsToProcessText(const TQString &cmdname)
virtual bool exec(View *view, const TQString &cmd, TQString &msg)=0
Execute this command for the given view and cmd string, return a bool about success, msg for status.
simple replace prompt dialog
void slotUser3()
Yes pressed.
const TDEShortcut & find()
const TDEShortcut & replace()
virtual void processText(Kate::View *view, const TQString &text)
This is called by the commandline each time the argument text for the command changes, if wantsToProcessText() returns true.
virtual bool help(View *view, const TQString &cmd, TQString &msg)=0
Shows help for the given view and cmd string, return a bool about success, msg for status...
void clicked()
button clicked
void slotUser2()
last pressed