19 #ifndef _ISearchPlugin_H_
20 #define _ISearchPlugin_H_
22 #include <tdetexteditor/plugin.h>
23 #include <tdetexteditor/view.h>
24 #include <tdetexteditor/document.h>
25 #include <tdetexteditor/searchinterface.h>
26 #include <tdetexteditor/viewcursorinterface.h>
27 #include <tdetexteditor/selectioninterface.h>
29 #include <kxmlguiclient.h>
31 #include <tqguardedptr.h>
35 class ISearchPlugin :
public KTextEditor::Plugin,
public KTextEditor::PluginViewInterface
40 ISearchPlugin( TQObject *parent = 0,
const char* name = 0,
const TQStringList &args = TQStringList() );
41 virtual ~ISearchPlugin();
43 void addView (KTextEditor::View *view);
44 void removeView (KTextEditor::View *view);
47 TQPtrList<class ISearchPluginView> m_views;
50 class ISearchPluginView :
public TQObject,
public KXMLGUIClient
55 ISearchPluginView( KTextEditor::View *view );
56 virtual ~ISearchPluginView();
58 virtual bool eventFilter( TQObject*, TQEvent* );
60 void setView( KTextEditor::View* view );
63 void setCaseSensitive(
bool );
64 void setFromBeginning(
bool );
65 void setRegExp(
bool );
66 void setAutoWrap(
bool );
69 void slotSearchForwardAction();
70 void slotSearchBackwardAction();
71 void slotSearchAction(
bool reverse );
72 void slotTextChanged(
const TQString& text );
73 void slotReturnPressed(
const TQString& text );
74 void slotAddContextMenuItems( TQPopupMenu *menu);
80 void updateLabelText(
bool failing =
false,
bool reverse =
false,
81 bool wrapped =
false,
bool overwrapped =
false );
84 void quitToView(
const TQString &text );
86 void nextMatch(
bool reverse );
87 bool iSearch( uint startLine, uint startCol,
88 const TQString& text,
bool reverse,
bool autoWrap );
90 KTextEditor::View* m_view;
91 KTextEditor::Document* m_doc;
92 KTextEditor::SearchInterface* m_searchIF;
93 KTextEditor::ViewCursorInterface* m_cursorIF;
94 KTextEditor::SelectionInterface* m_selectIF;
98 TQGuardedPtr<TQLabel> m_label;
99 TQGuardedPtr<KHistoryCombo> m_combo;
100 TQString m_lastString;
101 bool m_searchBackward;
102 bool m_caseSensitive;
103 bool m_fromBeginning;
107 uint m_startLine, m_startCol;
108 uint m_searchLine, m_searchCol;
109 uint m_foundLine, m_foundCol, m_matchLen;
110 bool m_toolBarWasHidden;
111 enum { NoSearch, TextSearch, MatchSearch } state;