• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • plugins
  • isearch
ISearchPlugin.h
1  /* This file is part of the KDE libraries
2  Copyright (C) 2002 by John Firebaugh <jfirebaugh@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef _ISearchPlugin_H_
20 #define _ISearchPlugin_H_
21 
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>
28 
29 #include <kxmlguiclient.h>
30 #include <tqobject.h>
31 #include <tqguardedptr.h>
32 
33 class TQLabel;
34 
35 class ISearchPlugin : public KTextEditor::Plugin, public KTextEditor::PluginViewInterface
36 {
37  Q_OBJECT
38 
39 public:
40  ISearchPlugin( TQObject *parent = 0, const char* name = 0, const TQStringList &args = TQStringList() );
41  virtual ~ISearchPlugin();
42 
43  void addView (KTextEditor::View *view);
44  void removeView (KTextEditor::View *view);
45 
46 private:
47  TQPtrList<class ISearchPluginView> m_views;
48 };
49 
50 class ISearchPluginView : public TQObject, public KXMLGUIClient
51 {
52  Q_OBJECT
53 
54 public:
55  ISearchPluginView( KTextEditor::View *view );
56  virtual ~ISearchPluginView();
57 
58  virtual bool eventFilter( TQObject*, TQEvent* );
59 
60  void setView( KTextEditor::View* view );
61 
62 public slots:
63  void setCaseSensitive( bool );
64  void setFromBeginning( bool );
65  void setRegExp( bool );
66  void setAutoWrap( bool );
67 
68 private slots:
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);
75 
76 private:
77  void readConfig();
78  void writeConfig();
79 
80  void updateLabelText( bool failing = false, bool reverse = false,
81  bool wrapped = false, bool overwrapped = false );
82  void startSearch();
83  void endSearch();
84  void quitToView( const TQString &text );
85 
86  void nextMatch( bool reverse );
87  bool iSearch( uint startLine, uint startCol,
88  const TQString& text, bool reverse, bool autoWrap );
89 
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;
95  TDEAction* m_searchForwardAction;
96  TDEAction* m_searchBackwardAction;
97  KWidgetAction* m_comboAction;
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;
104  bool m_regExp;
105  bool m_autoWrap;
106  bool m_wrapped;
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;
112 };
113 
114 #endif // _ISearchPlugin_H_
KXMLGUIClient
KWidgetAction
TDEAction

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.8.8
This website is maintained by Timothy Pearson.