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

kate

ISearchPlugin.h

00001  /* This file is part of the KDE libraries
00002     Copyright (C) 2002 by John Firebaugh <jfirebaugh@kde.org>
00003     
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License version 2 as published by the Free Software Foundation.
00007     
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012     
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016     Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef _ISearchPlugin_H_
00020 #define _ISearchPlugin_H_
00021 
00022 #include <tdetexteditor/plugin.h>
00023 #include <tdetexteditor/view.h>
00024 #include <tdetexteditor/document.h>
00025 #include <tdetexteditor/searchinterface.h>
00026 #include <tdetexteditor/viewcursorinterface.h>
00027 #include <tdetexteditor/selectioninterface.h>        
00028 
00029 #include <kxmlguiclient.h>
00030 #include <tqobject.h>
00031 #include <tqguardedptr.h>
00032 
00033 class TQLabel;
00034 
00035 class ISearchPlugin : public KTextEditor::Plugin, public KTextEditor::PluginViewInterface
00036 {
00037     Q_OBJECT
00038     
00039 public:
00040     ISearchPlugin( TQObject *parent = 0, const char* name = 0, const TQStringList &args = TQStringList() );
00041     virtual ~ISearchPlugin();
00042     
00043     void addView (KTextEditor::View *view);
00044     void removeView (KTextEditor::View *view);
00045     
00046 private:
00047     TQPtrList<class ISearchPluginView> m_views;
00048 };
00049 
00050 class ISearchPluginView : public TQObject, public KXMLGUIClient
00051 {
00052     Q_OBJECT
00053     
00054 public:
00055     ISearchPluginView( KTextEditor::View *view );
00056     virtual ~ISearchPluginView();
00057     
00058     virtual bool eventFilter( TQObject*, TQEvent* );
00059     
00060     void setView( KTextEditor::View* view );   
00061     
00062 public slots:
00063     void setCaseSensitive( bool );
00064     void setFromBeginning( bool );
00065     void setRegExp( bool );
00066     void setAutoWrap( bool );
00067     
00068 private slots:
00069     void slotSearchForwardAction();
00070     void slotSearchBackwardAction();
00071     void slotSearchAction( bool reverse );
00072     void slotTextChanged( const TQString& text );
00073     void slotReturnPressed( const TQString& text );
00074     void slotAddContextMenuItems( TQPopupMenu *menu);
00075     
00076 private:
00077     void readConfig();
00078     void writeConfig();
00079     
00080     void updateLabelText( bool failing = false, bool reverse = false,
00081                           bool wrapped = false, bool overwrapped = false );
00082     void startSearch();
00083     void endSearch();
00084     void quitToView( const TQString &text );
00085 
00086     void nextMatch( bool reverse );
00087     bool iSearch( uint startLine, uint startCol,
00088                   const TQString& text, bool reverse, bool autoWrap );
00089     
00090     KTextEditor::View*     m_view;
00091     KTextEditor::Document* m_doc;
00092     KTextEditor::SearchInterface* m_searchIF;
00093     KTextEditor::ViewCursorInterface* m_cursorIF;
00094     KTextEditor::SelectionInterface* m_selectIF;
00095     TDEAction*               m_searchForwardAction;
00096     TDEAction*               m_searchBackwardAction;
00097     KWidgetAction*         m_comboAction;
00098     TQGuardedPtr<TQLabel>    m_label;
00099     TQGuardedPtr<KHistoryCombo> m_combo;
00100     TQString        m_lastString;
00101     bool           m_searchBackward;
00102     bool           m_caseSensitive;
00103     bool           m_fromBeginning;
00104     bool           m_regExp;
00105     bool           m_autoWrap;
00106     bool           m_wrapped;
00107     uint           m_startLine, m_startCol;
00108     uint           m_searchLine, m_searchCol;
00109     uint           m_foundLine, m_foundCol, m_matchLen;
00110     bool           m_toolBarWasHidden;
00111     enum { NoSearch, TextSearch, MatchSearch } state;
00112 };
00113 
00114 #endif // _ISearchPlugin_H_

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.6.3
This website is maintained by Timothy Pearson.